lp_add_home() patch

Gerald Carter gcarter at valinux.com
Tue Sep 4 07:16:03 GMT 2001


Monyo,

I was looking at the patch from you I had in my mailbox (back from July I
think).  I don't think this should be included, but it will break
installations that use 'root preexec' scripts to create the home
directory as needed.  Do you agree?

I'm also not quite sure how it fits in with something like
pam_mkhomedir.so and the PAM session management phase. Althought I
think it is ok here.


Index: param/loadparm.c
===================================================================
RCS file: /data/cvs/samba/source/param/loadparm.c,v
retrieving revision 1.251.2.64
diff -u -r1.251.2.64 loadparm.c
--- param/loadparm.c    24 Aug 2001 19:03:08 -0000      1.251.2.64
+++ param/loadparm.c    4 Sep 2001 14:11:47 -0000
@@ -1849,7 +1849,15 @@

***************************************************************************/
 BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir)
 {
-       int i = add_a_service(ServicePtrs[iDefaultService], pszHomename);
+       int i;
+       SMB_STRUCT_STAT buf;
+
+       /* if the user's home directory doesn't exist, then don't
+          add it to the list of available shares */
+       if (sys_stat(pszHomedir, &buf))
+               return False;
+
+       i = add_a_service(ServicePtrs[iDefaultService], pszHomename);

        if (i < 0)
                return (False);








cheers, jerry
 ---------------------------------------------------------------------
 www.samba.org              SAMBA Team              jerry_at_samba.org
 www.plainjoe.org                                jerry_at_plainjoe.org
 --"I never saved anything for the swim back." Ethan Hawk in Gattaca--





More information about the samba-technical mailing list