svn commit: samba r10693 - in branches/SAMBA_3_0/source/smbd: .

jra at samba.org jra at samba.org
Mon Oct 3 18:14:11 GMT 2005


Author: jra
Date: 2005-10-03 18:14:09 +0000 (Mon, 03 Oct 2005)
New Revision: 10693

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10693

Log:
Fix bug #3129, reported by Adam Porter <sambabugzilla at alphapapa.net>.
Rotten error message caused hours of wasted time.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/smbd/service.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/service.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/service.c	2005-10-03 18:14:07 UTC (rev 10692)
+++ branches/SAMBA_3_0/source/smbd/service.c	2005-10-03 18:14:09 UTC (rev 10693)
@@ -272,6 +272,7 @@
 	SMB_STRUCT_STAT st;
 	fstring user;
 	fstring dev;
+	int ret;
 
 	*user = 0;
 	fstrcpy(dev, pdev);
@@ -554,7 +555,6 @@
 	/* Preexecs are done here as they might make the dir we are to ChDir to below */
 	/* execute any "root preexec = " line */
 	if (*lp_rootpreexec(snum)) {
-		int ret;
 		pstring cmd;
 		pstrcpy(cmd,lp_rootpreexec(snum));
 		standard_sub_conn(conn,cmd,sizeof(cmd));
@@ -584,7 +584,6 @@
 	/* Preexecs are done here as they might make the dir we are to ChDir to below */
 	/* execute any "preexec = " line */
 	if (*lp_preexec(snum)) {
-		int ret;
 		pstring cmd;
 		pstrcpy(cmd,lp_preexec(snum));
 		standard_sub_conn(conn,cmd,sizeof(cmd));
@@ -629,8 +628,13 @@
 	   check during individual operations. To match this behaviour
 	   I have disabled this chdir check (tridge) */
 	/* the alternative is just to check the directory exists */
-	if (SMB_VFS_STAT(conn, conn->connectpath, &st) != 0 || !S_ISDIR(st.st_mode)) {
-		DEBUG(0,("'%s' does not exist or is not a directory, when connecting to [%s]\n", conn->connectpath, lp_servicename(snum)));
+	if ((ret = SMB_VFS_STAT(conn, conn->connectpath, &st)) != 0 || !S_ISDIR(st.st_mode)) {
+		if (ret == 0 && !S_ISDIR(st.st_mode)) {
+			DEBUG(0,("'%s' is not a directory, when connecting to [%s]\n", conn->connectpath, lp_servicename(snum)));
+		} else {
+			DEBUG(0,("'%s' does not exist or permission denied when connecting to [%s] "
+				"Error was %s\n", conn->connectpath, lp_servicename(snum), strerror(errno) ));
+		}
 		change_to_root_user();
 		/* Call VFS disconnect hook */    
 		SMB_VFS_DISCONNECT(conn);



More information about the samba-cvs mailing list