Service-names and computer-names checked for in getpwnam

Mattias.Gronlund Mattias.Gronlund at
Sat Jan 29 09:24:39 GMT 2000


Richard Sharpe wrote:
> Well, actually, I think you will find that the call chain starts in
> service.c in make_connection.  The reply_tcon and reply_tconX routines call
> make_connection, and the first thing make_connection does is call
> find_service (these two routines are in service.c).
> Now, find_service checks to see if the service name is a regular service,
> and if not, then calls get_home_dir passing the service name.  get_home_dir
> treats the service name as a user, and tries to find such a user.
> If the home dir is found, find_service then checks to see if a [homes] share
> exists and uses the params specified there as defaults.
> This is _CONTRARY_ to what the man pages say, which suggest that
> get_home_dir would only be called if the [homes] share exists.
> Perhaps we should fix the code :-)

Yes, you are right about this, this isn't done as the documented.
It would be fixed if the line:

if ((iHomeService = lp_servicenumber(HOMES_NAME)) >= 0)

was moved before the call to get_home_dir.
> I think this might be fixed if find_service checked for a [homes] share
> before diving off looking for home directories ...

> You are right, in that this whole area looks like a mess, with many
> duplicated, and thus useless calls.

I do not think that it is that great a mess, it's just one little glitch
the handling of homes, and there is a strange "session user".

> Perhaps it should be rewritten :-)  The big problem is that this would lead
> to major breakage until we found all the little things that each code path
> is used for.

I do thihk that the above patch should fix the [homes] doc. mismatch.

_BUT_ the problems I get is _not_ related to this, as the service _is_
This means that find_service will _not_ call get_home_dir(service) in my

My problem _is_ the call to add_session_user for services and for

Could someone please tell me what a "session user" is and why it should
be needed?

The only doc I can find about it is in "change-log":

1.7.00: 14/7/94
        - added session_users list, to overcome problem of missing
usernames in SMBTconX.

But if it is to overcome a problem of missing usernames, why isn't it
only "users" that
get added to the list?


More information about the samba-technical mailing list