Sorry if this is an old problem. I have just installed 1.9.18p10 - the latest version. I noticed the nis homedir option in the config file, but have not had much luck in implementing it. I had hoped it would mean my [homes] shares would map to the correct server - the one which physically carries a users home directory - regardless of the machine to which the connection attempt was made. My [homes] sections contain no 'path=' statement. We are running NIS on Solaris 2.5/6 (not NIS+ in yp compatibility mode). I created a NIS map which fulfilled the requirements of homedir map, and named it in the conf file. I assume the path in 'server:/some/file/system' is not critical - it is only the server name it is after. I compiled with -DAUTOMOUNT and -DNETGROUP and put -lrpcsvc in the LIBSM line of the makefile. Looking at the sources - util.c and server.c - it seems that the %N and %p substitutions may be involved. But I have failed to make them work, or %H. Has anyone had similar problems? Is there any more info on using these options? Thanks in advance for any comments. Paul Ostro Dept. Medical Physics UCL Hospitals, London UK +44 171 209 6272
> Reply-to: paulo@medphys.ucl.ac.uk > From: Paul Ostro <paulo@medphys.ucl.ac.uk> > To: Multiple recipients of list <samba@samba.anu.edu.au> > Subject: nis homedir troubles > Date: Wed, 4 Nov 1998 07:03:25 +1100> Has anyone had similar problems? Is there any more info on using these > options?We are running a familiar configuration here: Solaris 2.6-Machine running Samba to share the users' homedirs to the PC/NT-Net. The users' homes are mounted via NIS to /autohome/, so Peter's homedir would be /autohome/peter. We solved the problem of not knowing the physical location of the homedir by the following [homes]-configuration: [homes] comment = Home-Verzeichnisse guest ok = false path = /autohome/%u writable = yes browseable = yes public = no The variable %u in the path-line is expanded to the user's name - that's it.> Thanks in advance for any comments.Hope, this helps.... Yours, Osama Abu-Aish --- Inst. f. Microelectronics Stuttgart (IMS) Allmandring 30a 70569 Stuttgart Germany
I simply have this as my [homes] clause, and it works fine. I also have these in the [global] area: nis homedir = yes homedir map = auto.homes [homes] guest ok = no read only = no I'm running samba-1.9.18p8 on Solaris 2.5.1 11/97 release on a Sparc 5. Hope that helps a little. -- Seeya, Paul ---- plussier@baynetworks.com Broadband Technology Division - Bay Networks (now a Nortel Company, Eh? :) If you're not having fun, you're not doing it right!
Thanks to several people for replying, especially Paul Allen. I think Osama is using the "double-hop" which nis homedir is intended to eliminate. He uses [homes] path = /autohome/%u which I think will result in the machine to which he is connected automounting the home directory, which may be on another Sun, and hence the double-hop. Paul Lussier has>I simply have this as my [homes] clause, and it works fine. I also havethese>in the [global] area: > > [global] > nis homedir = yes > homedir map = auto.homes > > [homes] > guest ok = no > read only = nowhich is more or less what I tried - and it failed. Paul Allen writes:>I just saw your message to the samba mailing list. I'm curious to >know why you left the "path =" line out of your [homes] section? >I tried that, and the log shows the server using the home directory >out of the passwd file instead of the one in the auto_home map. >If I use "path = %p", things work if the directory is local to the >server the user connected to. I've tried variations like >"path = %N:%p" or "path = \\%N\%p". These experiments have generally >produced segmentation faults and a "network error has occurred" >message at the client PC. > >It looks as if the code that does the automount map lookup is only >called from within the routines in lib/util.c that do the parameter >substitution, so you really have to refer to %N and %p somewhere >in order for things to work. I just can't seem to get %N to do >anything reasonable.I did not use path= in my [homes] because it didn't seem necessary at the time. I have [homes] sections of the config files for each Sun which serves home directories. I then 'include' a 'valid users =' clause which has only those users whose home directory is physically on that machine. The include files are generated from the NIS passwd map. That way a user can only mount their home directory from the Sun on which it resides. The 'error message' from other Suns is a request for a password, but..... So when I saw 'nis homedir =' I thought it a better way to do things. The samba.home NIS map I generated gets built by /var/yp/make every time passwd changes. I too looked at the sources (util.c and others), and it seems the automount code only gets used for the substitutions %N and %p. I wasn't even sure from the description in smb.conf.5 that %N and %p referred to home directories - I'm not sure where auto.map comes into it (my ignorance, I think). The auto.home (or my samba.home) map seems to contain all the necessary info - except, where does Samba get the path on the redirected Server from? Does it use the same path as the original server, but with "RediredtedServer:" in front? I too tried various combinations of %N and %p in the path= statement in my [homes] section, but all to no avail. The error messages I got seem very similar to Paul's above. Could anyone on the Samba team confirm what is meant to happen with nis homedir, please? Is it a feature used a lot (and hence I am being daft in not being able to get it working), or has it got known problems? Maybe a docs/homedir.txt file would be useful? Paul Paul Ostro Dept. Medical Physics UCL Hospitals, London UK +44 171 209 6272
Paul Ostro wrote:> Could anyone on the Samba team confirm what is meant to happen with nis > homedir, please? Is it a feature used a lot (and hence I am being daft in > not being able to get it working), or has it got known problems? Maybe a > docs/homedir.txt file would be useful?Paul Allen <paul.allen@redwood.rt.cs.boeing.com> wrote :> I have four pure NFS fileservers. By "pure", I mean that they are > absolutely not NFS clients. I do not automount /home on my fileservers. > I have Samba 2.0.0-alpha13) running on all four servers with these > lines in each smb.conf file: > > nis homedir = True > homedir map = auto_home >This all looks good - but the critical part of this is - is one of these servers acting as a Windows 95/98 logon server ? It's been a while since I looked at the homedir map code but my understanding of this is that you only need these lines in the Samba server that is acting as the logon server. The way it's supposed to work is that the Win95/98 client does a broadcast on port UDP 138 to find the logon server, nmbd responds and then the client attaches to the IPC$ share on the server as the logging on user and does a NetUserGetInfo rap call down the IPC$ pipe to get the info about the user. Part of this info (handled in ipc.c in the Samba code) is the "home server" and "home path" (the names are kind of sketchy without trawling through the code). It's at this point (getting this info) that the substitutions from the NIS automount maps are done. Once the client receives this info back it then goes off and mounts the given share from the given home server as the home directory for the logging on user, ie. contacting the Samba server holding the users home directory directly, not doing anything more with the Samba server that is the logon server. Does this clarification help ? Cheers, Jeremy Allison, Samba Team. -- -------------------------------------------------------- Buying an operating system without source is like buying a self-assembly Space Shuttle with no instructions. --------------------------------------------------------