svn commit: samba r6233 - in trunk/source/smbd: .

jra at samba.org jra at samba.org
Thu Apr 7 18:27:15 GMT 2005


Author: jra
Date: 2005-04-07 18:27:14 +0000 (Thu, 07 Apr 2005)
New Revision: 6233

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

Log:
Fix for possible root squash nfs bugs from psz at maths.usyd.edu.au
Jeremy.

Modified:
   trunk/source/smbd/oplock.c
   trunk/source/smbd/vfs.c


Changeset:
Modified: trunk/source/smbd/oplock.c
===================================================================
--- trunk/source/smbd/oplock.c	2005-04-07 04:58:38 UTC (rev 6232)
+++ trunk/source/smbd/oplock.c	2005-04-07 18:27:14 UTC (rev 6233)
@@ -808,6 +808,12 @@
 	saved_vuid = current_user.vuid;
 	saved_fsp_conn = fsp->conn;
 	change_to_root_user();
+	/*
+	 * Initialize saved_dir to something sensible: vfs_GetWd may not work well
+	 * for root: the directory may be NFS-mounted and exported with root_squash
+	 * (so has no root access).
+	 */
+	pstrcpy(saved_dir,saved_fsp_conn->connectpath);
 	vfs_GetWd(saved_fsp_conn,saved_dir);
 	/* Save the chain fnum. */
 	file_chain_save();

Modified: trunk/source/smbd/vfs.c
===================================================================
--- trunk/source/smbd/vfs.c	2005-04-07 04:58:38 UTC (rev 6232)
+++ trunk/source/smbd/vfs.c	2005-04-07 18:27:14 UTC (rev 6233)
@@ -731,7 +731,9 @@
 		in trouble :-) */
 
 	if (SMB_VFS_STAT(conn, ".",&st) == -1) {
-		DEBUG(0,("Very strange, couldn't stat \".\" path=%s\n", path));
+		/* Known to fail for root: the directory may be
+		 * NFS-mounted and exported with root_squash (so has no root access). */
+		DEBUG(1,("vfs_GetWd: couldn't stat \".\" path=%s error %s (NFS problem ?)\n", path, strerror(errno) ));
 		return(SMB_VFS_GETWD(conn,path));
 	}
 



More information about the samba-cvs mailing list