[prb] lp_add_home() against non existent home dir

TAKAHASHI Motonobu monyo at home.monyo.com
Fri Jul 13 17:02:50 GMT 2001


Hello

The following problem was found at Samba-JP:
If you enable [homes] share and connect to an account whose home
directory does not exist, then its home directory is still shown in
share list but cannot be accessed.

Here is a patch to fix it for Samba 2.2.0 not to call lp_add_home()
against an account whose home directory does not exist.

----- Cut Here For 2.2.0 -----
--- source/param/loadparm.c.org	Tue Jun 12 01:38:17 2001
+++ source/param/loadparm.c	Sun Jul  1 21:01:52 2001
@@ -1802,7 +1802,11 @@
 ***************************************************************************/
 BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir)
 {
-	int i = add_a_service(pSERVICE(iDefaultService), pszHomename);
+        int i;
+        struct stat buf;
+
+        if ( stat(pszHomedir,&buf) ) return (False);
+        i = add_a_service(pSERVICE(iDefaultService),pszHomename);
 
 	if (i < 0)
 		return (False);
----- Cut Here -----

-----
TAKAHASHI Motonobu                    mailto:monyo at samba.gr.jp
Samba Users Group Japan               http://www.samba.gr.jp/




More information about the samba-technical mailing list