svn commit: samba r21950 - in branches/SAMBA_3_0/source: . modules script/tests smbd

jpeach at samba.org jpeach at samba.org
Fri Mar 23 19:31:11 GMT 2007


Author: jpeach
Date: 2007-03-23 19:31:11 +0000 (Fri, 23 Mar 2007)
New Revision: 21950

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

Log:
After discussion with the Apple and Linux client maintainers,
changing the FindFirst response for the UNIX_INFO2 level to include
a length field before the name. The name is not required to be null
terminated. The length field does not count any null.

Also add call to chflags(2) in the default VFS module so that this
will work be default on BSD-derived platform. Add UNIX-INFO2 test
to the build farm to get some non-BSD coverage.

Jeremy and Jerry, please review for inclusion in 3.0.25.

Modified:
   branches/SAMBA_3_0/source/configure.in
   branches/SAMBA_3_0/source/modules/vfs_default.c
   branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh
   branches/SAMBA_3_0/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_0/source/configure.in
===================================================================
--- branches/SAMBA_3_0/source/configure.in	2007-03-23 19:24:21 UTC (rev 21949)
+++ branches/SAMBA_3_0/source/configure.in	2007-03-23 19:31:11 UTC (rev 21950)
@@ -1225,7 +1225,8 @@
 
 AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strerror chown fchown chmod fchmod chroot link mknod mknod64)
 AC_CHECK_FUNCS(strtol strtoll strtoul strtoull strtouq __strtoull)
-AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync memset strlcpy strlcat setpgid)
+AC_CHECK_FUNCS(fstat strchr utime utimes chflags)
+AC_CHECK_FUNCS(getrlimit fsync memset strlcpy strlcat setpgid)
 AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
 AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
 AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf realpath)

Modified: branches/SAMBA_3_0/source/modules/vfs_default.c
===================================================================
--- branches/SAMBA_3_0/source/modules/vfs_default.c	2007-03-23 19:24:21 UTC (rev 21949)
+++ branches/SAMBA_3_0/source/modules/vfs_default.c	2007-03-23 19:31:11 UTC (rev 21950)
@@ -905,8 +905,12 @@
 
 static int vfswrap_chflags(vfs_handle_struct *handle, const char *path, int flags)
 {
+#ifdef HAVE_CHFLAGS
+	return chflags(path, flags);
+#else
 	errno = ENOSYS;
 	return -1;
+#endif
 }
 
 static size_t vfswrap_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc)

Modified: branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh
===================================================================
--- branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh	2007-03-23 19:24:21 UTC (rev 21949)
+++ branches/SAMBA_3_0/source/script/tests/test_posix_s3.sh	2007-03-23 19:31:11 UTC (rev 21950)
@@ -36,11 +36,16 @@
 rpc="RPC-AUTHCONTEXT RPC-BINDSAMBA3 RPC-SAMBA3-SRVSVC RPC-SAMBA3-SHARESEC"
 rpc="$rpc RPC-UNIXINFO RPC-SAMBA3-SPOOLSS RPC-SAMBA3-WKSSVC"
 
+# NOTE: to enable the UNIX-WHOAMI test, we need to change the default share
+# config to allow guest access. I'm not sure whether this would break other
+# tests, so leaving it alone for now -- jpeach
+unix="UNIX-INFO2"
+
 if test x$RUN_FROM_BUILD_FARM = xyes; then
 	rpc="$rpc RPC-NETLOGSAMBA3 RPC-SAMBA3SESSIONKEY RPC-SAMBA3-GETUSERNAME"
 fi
 
-tests="$base $raw $rpc"
+tests="$base $raw $rpc $unix"
 
 skipped="BASE-CHARSET BASE-DEFER_OPEN BASE-DELAYWRITE BASE-OPENATTR BASE-TCONDEV"
 skipped="$skipped RAW-ACLS RAW-COMPOSITE RAW-CONTEXT RAW-EAS"

Modified: branches/SAMBA_3_0/source/smbd/trans2.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/trans2.c	2007-03-23 19:24:21 UTC (rev 21949)
+++ branches/SAMBA_3_0/source/smbd/trans2.c	2007-03-23 19:31:11 UTC (rev 21950)
@@ -1601,13 +1601,17 @@
 				DEBUG(10,("get_lanman2_dir_entry: SMB_FIND_FILE_UNIX\n"));
 				p = store_file_unix_basic(conn, p,
 							NULL, &sbuf);
+				len = srvstr_push(outbuf, p, fname, -1, STR_TERMINATE);
 			} else {
 				DEBUG(10,("get_lanman2_dir_entry: SMB_FIND_FILE_UNIX_INFO2\n"));
 				p = store_file_unix_basic_info2(conn, p,
 							NULL, &sbuf);
+				nameptr = p;
+				p += 4;
+				len = srvstr_push(outbuf, p, fname, -1, 0);
+				SIVAL(nameptr, 0, len);
 			}
 
-			len = srvstr_push(outbuf, p, fname, -1, STR_TERMINATE);
 			p += len;
 			SIVAL(p,0,0); /* Ensure any padding is null. */
 



More information about the samba-cvs mailing list