[SCM] Samba Shared Repository - branch v3-2-stable updated - release-3-2-3-87-gbc66e91

Karolin Seeger kseeger at samba.org
Mon Sep 15 09:26:16 GMT 2008


The branch, v3-2-stable has been updated
       via  bc66e91b9eb44f897b5a422d7daf5db1e19a0442 (commit)
       via  62f79a5f38a0b44534c7dd4335431160cc719b3d (commit)
       via  326bd60b594ad796604c24b39067495174653d15 (commit)
       via  cad8e9f04466241ba2d88df75c31779b77873bbb (commit)
       via  ca377e8bd68025bb89cc25ea64a55aa0a4b4c360 (commit)
       via  2896d35972c0e00c388085511aaf2d398aca7e2b (commit)
       via  db91aa5b384fe8f527b547556182b5346382e370 (commit)
       via  023f8d6b91db702ddb33f6af0f43e026729f8742 (commit)
      from  419990cc70df6d4f0ae61e15b19eef79be0e7fde (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-stable


- Log -----------------------------------------------------------------
commit bc66e91b9eb44f897b5a422d7daf5db1e19a0442
Author: Karolin Seeger <kseeger at samba.org>
Date:   Mon Sep 15 11:08:06 2008 +0200

    WHATSNEW: Update changes since 3.2.3.
    
    Karolin
    (cherry picked from commit 7f60557c4ebc8de45b0c1bceda2be8e50d88e3ef)

commit 62f79a5f38a0b44534c7dd4335431160cc719b3d
Author: Jeff Layton <jlayton at redhat.com>
Date:   Sun Sep 14 08:37:45 2008 -0400

    mount.cifs: make local versions of strlcat and strlcpy static
    
    ...to silence -Wmissing-prototypes
    
    Signed-off-by: Jeff Layton <jlayton at redhat.com>
    (cherry picked from commit b08f07f84e448e56116b84ba5fa59b211e584822)

commit 326bd60b594ad796604c24b39067495174653d15
Author: Jeff Layton <jlayton at redhat.com>
Date:   Sun Sep 14 08:37:45 2008 -0400

    cifs.upcall: make most functions static and silence compiler warnings
    
    ...to silence -Wmissing-prototypes and some uninit'ed variable
    warnings. Thanks to GD for the extra-paranoid compiler flags.
    
    Signed-off-by: Jeff Layton <jlayton at redhat.com>
    (cherry picked from commit bc5274eb66ebe40aea3ab917a20f2f353172ca93)

commit cad8e9f04466241ba2d88df75c31779b77873bbb
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Sep 12 15:04:11 2008 -0700

    Modify a comment to make things clearer.
    Jeremy.
    (cherry picked from commit 46a5c08b101f1c218ecd6397614dde1d13a9077a)

commit ca377e8bd68025bb89cc25ea64a55aa0a4b4c360
Author: Jeff Layton <jlayton at redhat.com>
Date:   Fri Sep 12 13:37:13 2008 -0400

    cifs.upcall: move default install location to EPREFIX/sbin
    
    cifs.upcall links to libraries that live under /usr, so installing it
    in /sbin doesn't seem appropriate. Move it to EPREFIX/sbin instead
    (i.e. /usr/sbin).
    
    Signed-off-by: Jeff Layton <jlayton at redhat.com>
    (cherry picked from commit fe280993dea71b87b6042d6aded389b10bcd0b56)

commit 2896d35972c0e00c388085511aaf2d398aca7e2b
Author: Jeff Layton <jlayton at redhat.com>
Date:   Fri Sep 12 13:37:13 2008 -0400

    cifs.upcall: enable building by default on linux
    
    When building on linux, default to building cifs.upcall. Throw a
    warning if ADS support is disabled or keyutils isn't installed.
    
    Signed-off-by: Jeff Layton <jlayton at redhat.com>
    (cherry picked from commit 7f1193d3c83b0c19f17c8f70542491222c9644da)

commit db91aa5b384fe8f527b547556182b5346382e370
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Sep 11 17:31:36 2008 -0700

    Use the given name, not the absolute pathname, when printing out ACL info.
    Make this match the non-ACL case.
    Jeremy.
    (cherry picked from commit 1ca6239b9f67caafed50db5f284df00c5988ba03)

commit 023f8d6b91db702ddb33f6af0f43e026729f8742
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Sep 11 16:18:54 2008 -0700

    Fix bug #5751 cannot show ACLs on DFS reported by SATOH Fumiyasu <fumiyas at osstech.co.jp>.
    Fix for smbclient and libsmbclient.
    Jeremy.
    (cherry picked from commit 71d00ef2888834ebed2a387a111a95bac1d227ad)

-----------------------------------------------------------------------

Summary of changes:
 WHATSNEW.txt                 |    7 ++-
 source/Makefile.in           |    8 ++--
 source/client/cifs.upcall.c  |   18 +++++---
 source/client/client.c       |    4 +-
 source/client/mount.cifs.c   |    4 +-
 source/configure.in          |   23 +++++++++--
 source/libsmb/libsmb_xattr.c |   89 ++++++++++++++++++++++++++----------------
 source/smbd/fileio.c         |    4 +-
 8 files changed, 101 insertions(+), 56 deletions(-)


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 24a4f1c..eddf9bb 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,6 +1,6 @@
                    ==============================
                    Release Notes for Samba 3.2.4
-
+			September 18, 2008
                    ==============================
 
 This is a bug fix release of the Samba 3.2 series.
@@ -35,6 +35,7 @@ o   Jeremy Allison <jra at samba.org>
       is used.
     * BUG 5729: Explicitly allow "-valid".
     * BUG 5745: Fix Kerberos authentication with (lib)smbclient.
+    * BUG 5751: Fix showing of ACLs on DFS in (lib)smbclient.
     * Fix the wcache_invalidate_samlogon calls.
     * Add st_birthtime and friends for accurate create times on *BSD and MacOSX.
     * Clarify usage of "force create mode".
@@ -65,7 +66,9 @@ o   Ephi Dror <Ephi.Dror at datadomain.com>
 
 o   Jeff Layton <jlayton at redhat.com>
     * Fix handling of MSKRB5 OID in cifs.upcall.
-    * Fix build warning in cifs.upcall.
+    * Fix build warnings in cifs.upcall.
+    * Change default install location of cifs.upcall to EPREFIX/sbin.
+    * Enable building of cifs.upcall by default on Linux.
 
 
 o   Volker Lendecke <vl at sernet.de>
diff --git a/source/Makefile.in b/source/Makefile.in
index 2a8bec0..12c62e1 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -175,9 +175,9 @@ PATH_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" \
 
 # Note that all executable programs now provide for an optional executable suffix.
 
-SBIN_PROGS = bin/smbd at EXEEXT@ bin/nmbd at EXEEXT@ @SWAT_SBIN_TARGETS@ @EXTRA_SBIN_PROGS@
+SBIN_PROGS = bin/smbd at EXEEXT@ bin/nmbd at EXEEXT@ @SWAT_SBIN_TARGETS@ @EXTRA_SBIN_PROGS@ @CIFSUPCALL_PROGS@
 
-ROOT_SBIN_PROGS = @CIFSMOUNT_PROGS@ @CIFSUPCALL_PROGS@
+ROOT_SBIN_PROGS = @CIFSMOUNT_PROGS@
 
 BIN_PROGS1 = bin/smbclient at EXEEXT@ bin/net at EXEEXT@ bin/smbspool at EXEEXT@ \
 	bin/testparm at EXEEXT@ bin/smbstatus at EXEEXT@ bin/smbget at EXEEXT@
@@ -2439,8 +2439,8 @@ installcifsmount:: @CIFSMOUNT_PROGS@
 	@$(SHELL) script/installbin.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(prefix) $(ROOTSBINDIR) @CIFSMOUNT_PROGS@
 
 installcifsupcall:: @CIFSUPCALL_PROGS@
-	@$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(ROOTSBINDIR)
-	@$(SHELL) script/installbin.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(prefix) $(ROOTSBINDIR) @CIFSUPCALL_PROGS@
+	@$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(SBINDIR)
+	@$(SHELL) script/installbin.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(prefix) $(SBINDIR) @CIFSUPCALL_PROGS@
 
 # Some symlinks are required for the 'probing' of modules.
 # This mechanism should go at some point..
diff --git a/source/client/cifs.upcall.c b/source/client/cifs.upcall.c
index 7cb5166..4110de3 100644
--- a/source/client/cifs.upcall.c
+++ b/source/client/cifs.upcall.c
@@ -32,6 +32,7 @@ create dns_resolver * * /usr/local/sbin/cifs.upcall %k
 const char *CIFSSPNEGO_VERSION = "1.2";
 static const char *prog = "cifs.upcall";
 typedef enum _secType {
+	NONE = 0,
 	KRB5,
 	MS_KRB5
 } secType_t;
@@ -56,7 +57,8 @@ typedef enum _secType {
  *
  * ret: 0 - success, others - failure
 */
-int handle_krb5_mech(const char *oid, const char *principal,
+static int
+handle_krb5_mech(const char *oid, const char *principal,
 		     DATA_BLOB * secblob, DATA_BLOB * sess_key)
 {
 	int retval;
@@ -88,7 +90,8 @@ int handle_krb5_mech(const char *oid, const char *principal,
 #define DKD_HAVE_UID		32
 #define DKD_MUSTHAVE_SET (DKD_HAVE_HOSTNAME|DKD_HAVE_VERSION|DKD_HAVE_SEC)
 
-int decode_key_description(const char *desc, int *ver, secType_t * sec,
+static int
+decode_key_description(const char *desc, int *ver, secType_t * sec,
 			   char **hostname, uid_t * uid)
 {
 	int retval = 0;
@@ -151,7 +154,8 @@ int decode_key_description(const char *desc, int *ver, secType_t * sec,
 	return retval;
 }
 
-int cifs_resolver(const key_serial_t key, const char *key_descr)
+static int
+cifs_resolver(const key_serial_t key, const char *key_descr)
 {
 	int c;
 	struct addrinfo *addr;
@@ -203,7 +207,7 @@ int cifs_resolver(const key_serial_t key, const char *key_descr)
 	return 0;
 }
 
-void
+static void
 usage(void)
 {
 	syslog(LOG_WARNING, "Usage: %s [-c] [-v] key_serial", prog);
@@ -215,12 +219,12 @@ int main(const int argc, char *const argv[])
 	struct cifs_spnego_msg *keydata = NULL;
 	DATA_BLOB secblob = data_blob_null;
 	DATA_BLOB sess_key = data_blob_null;
-	secType_t sectype;
+	secType_t sectype = NONE;
 	key_serial_t key = 0;
 	size_t datalen;
 	long rc = 1;
-	uid_t uid;
-	int kernel_upcall_version;
+	uid_t uid = 0;
+	int kernel_upcall_version = 0;
 	int c, use_cifs_service_prefix = 0;
 	char *buf, *hostname = NULL;
 	const char *oid;
diff --git a/source/client/client.c b/source/client/client.c
index 438306e..9446c27 100644
--- a/source/client/client.c
+++ b/source/client/client.c
@@ -521,14 +521,14 @@ static void display_finfo(file_info *finfo, const char *dir)
 		/* create absolute filename for cli_nt_create() FIXME */
 		afname = talloc_asprintf(ctx,
 					"%s%s%s",
-					client_get_cwd(),
+					dir,
 					CLI_DIRSEP_STR,
 					finfo->name);
 		if (!afname) {
 			return;
 		}
 		/* print file meta date header */
-		d_printf( "FILENAME:%s\n", afname);
+		d_printf( "FILENAME:%s\n", finfo->name);
 		d_printf( "MODE:%s\n", attrib_string(finfo->mode));
 		d_printf( "SIZE:%.0f\n", (double)finfo->size);
 		d_printf( "MTIME:%s", time_to_asc(t));
diff --git a/source/client/mount.cifs.c b/source/client/mount.cifs.c
index af50cd9..8fb652b 100644
--- a/source/client/mount.cifs.c
+++ b/source/client/mount.cifs.c
@@ -94,7 +94,7 @@ char * prefixpath = NULL;
 
 /* like strncpy but does not 0 fill the buffer and always null
  *    terminates. bufsize is the size of the destination buffer */
-size_t strlcpy(char *d, const char *s, size_t bufsize)
+static size_t strlcpy(char *d, const char *s, size_t bufsize)
 {
 	size_t len = strlen(s);
 	size_t ret = len;
@@ -108,7 +108,7 @@ size_t strlcpy(char *d, const char *s, size_t bufsize)
 /* like strncat but does not 0 fill the buffer and always null
  *    terminates. bufsize is the length of the buffer, which should
  *       be one more than the maximum resulting string length */
-size_t strlcat(char *d, const char *s, size_t bufsize)
+static size_t strlcat(char *d, const char *s, size_t bufsize)
 {
 	size_t len1 = strlen(d);
 	size_t len2 = strlen(s);
diff --git a/source/configure.in b/source/configure.in
index a7d1f94..548dea4 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -4113,7 +4113,7 @@ INSTALL_CIFSUPCALL=""
 UNINSTALL_CIFSUPCALL=""
 AC_MSG_CHECKING(whether to build cifs.upcall)
 AC_ARG_WITH(cifsupcall,
-[AS_HELP_STRING([--with-cifsupcall], [Include cifs.upcall (Linux only) support (default=no)])],
+[AS_HELP_STRING([--with-cifsupcall], [Include cifs.upcall (Linux only) support (default=yes)])],
 [ case "$withval" in
   no)
 	AC_MSG_RESULT(no)
@@ -4139,9 +4139,24 @@ AC_ARG_WITH(cifsupcall,
 	esac
     ;;
   esac ],
-[
-  AC_MSG_RESULT(no)
-  ]
+[ case "$host_os" in
+  *linux*)
+	if test x"$use_ads" != x"yes"; then
+		AC_MSG_WARN(ADS support should be enabled for building cifs.upcall)
+	elif test x"$HAVE_KEYUTILS_H" != "x1"; then
+		AC_MSG_WARN(keyutils package is required for cifs.upcall)
+	else
+		AC_MSG_RESULT(yes)
+		AC_DEFINE(WITH_CIFSUPCALL,1,[whether to build cifs.upcall])
+		CIFSUPCALL_PROGS="bin/cifs.upcall"
+		INSTALL_CIFSUPCALL="installcifsupcall"
+		UNINSTALL_CIFSUPCALL="uninstallcifsupcall"
+	fi
+	;;
+  *)
+	AC_MSG_RESULT(no)
+	;;
+  esac ]
 )
 
 
diff --git a/source/libsmb/libsmb_xattr.c b/source/libsmb/libsmb_xattr.c
index e17146e..7ae872d 100644
--- a/source/libsmb/libsmb_xattr.c
+++ b/source/libsmb/libsmb_xattr.c
@@ -746,7 +746,7 @@ cacl_get(SMBCCTX *context,
 	SMB_OFF_T size = 0;
 	uint16 mode = 0;
 	SMB_INO_T ino = 0;
-        struct cli_state *cli = srv->cli;
+	struct cli_state *cli = srv->cli;
         struct {
                 const char * create_time_attr;
                 const char * access_time_attr;
@@ -883,30 +883,41 @@ cacl_get(SMBCCTX *context,
          * attributes have been requested...
          */
         if (ipc_cli && (all || some_nt || all_nt_acls)) {
+		char *targetpath = NULL;
+	        struct cli_state *targetcli = NULL;
+
                 /* Point to the portion after "system.nt_sec_desc." */
                 name += 19;     /* if (all) this will be invalid but unused */
-                
+
+		if (!cli_resolve_path(ctx, "", cli, filename,
+				&targetcli, &targetpath)) {
+			DEBUG(5, ("cacl_get Could not resolve %s\n",
+				filename));
+                        errno = ENOENT;
+                        return -1;
+		}
+
                 /* ... then obtain any NT attributes which were requested */
-                fnum = cli_nt_create(cli, filename, CREATE_ACCESS_READ);
-                
+                fnum = cli_nt_create(targetcli, targetpath, CREATE_ACCESS_READ);
+
                 if (fnum == -1) {
-                        DEBUG(5, ("cacl_get failed to open %s: %s\n",
-                                  filename, cli_errstr(cli)));
-                        errno = 0;
-                        return -1;
-                }
-                
-                sd = cli_query_secdesc(cli, fnum, ctx);
-                
+			DEBUG(5, ("cacl_get failed to open %s: %s\n",
+				targetpath, cli_errstr(targetcli)));
+			errno = 0;
+			return -1;
+		}
+
+		sd = cli_query_secdesc(targetcli, fnum, ctx);
+
                 if (!sd) {
                         DEBUG(5,
                               ("cacl_get Failed to query old descriptor\n"));
                         errno = 0;
                         return -1;
                 }
-                
-                cli_close(cli, fnum);
-                
+
+                cli_close(targetcli, fnum);
+
                 if (! exclude_nt_revision) {
                         if (all || all_nt) {
                                 if (determine_size) {
@@ -1503,7 +1514,9 @@ cacl_set(TALLOC_CTX *ctx,
 	int ret = 0;
         char *p;
         bool numeric = True;
-        
+	char *targetpath = NULL;
+	struct cli_state *targetcli = NULL;
+
         /* the_acl will be null for REMOVE_ALL operations */
         if (the_acl) {
                 numeric = ((p = strchr(the_acl, ':')) != NULL &&
@@ -1532,39 +1545,46 @@ cacl_set(TALLOC_CTX *ctx,
 		errno = EINVAL;
 		return -1;
 	}
-        
+
+	if (!cli_resolve_path(ctx, "", cli, filename,
+				&targetcli, &targetpath)) {
+		DEBUG(5,("cacl_set: Could not resolve %s\n", filename));
+		errno = ENOENT;
+		return -1;
+	}
+
 	/* The desired access below is the only one I could find that works
 	   with NT4, W2KP and Samba */
-        
-	fnum = cli_nt_create(cli, filename, CREATE_ACCESS_READ);
-        
+
+	fnum = cli_nt_create(targetcli, targetpath, CREATE_ACCESS_READ);
+
 	if (fnum == -1) {
                 DEBUG(5, ("cacl_set failed to open %s: %s\n",
-                          filename, cli_errstr(cli)));
+                          targetpath, cli_errstr(targetcli)));
                 errno = 0;
 		return -1;
 	}
-        
-	old = cli_query_secdesc(cli, fnum, ctx);
-        
+
+	old = cli_query_secdesc(targetcli, fnum, ctx);
+
 	if (!old) {
                 DEBUG(5, ("cacl_set Failed to query old descriptor\n"));
                 errno = 0;
 		return -1;
 	}
-        
-	cli_close(cli, fnum);
-        
+
+	cli_close(targetcli, fnum);
+
 	switch (mode) {
 	case SMBC_XATTR_MODE_REMOVE_ALL:
                 old->dacl->num_aces = 0;
                 dacl = old->dacl;
                 break;
-                
+
         case SMBC_XATTR_MODE_REMOVE:
 		for (i=0;sd->dacl && i<sd->dacl->num_aces;i++) {
 			bool found = False;
-                        
+
 			for (j=0;old->dacl && j<old->dacl->num_aces;j++) {
                                 if (sec_ace_equal(&sd->dacl->aces[i],
                                                   &old->dacl->aces[j])) {
@@ -1642,25 +1662,26 @@ cacl_set(TALLOC_CTX *ctx,
 	sd = make_sec_desc(ctx, old->revision, SEC_DESC_SELF_RELATIVE,
 			   owner_sid, group_sid, NULL, dacl, &sd_size);
         
-	fnum = cli_nt_create(cli, filename,
+	fnum = cli_nt_create(targetcli, targetpath,
                              WRITE_DAC_ACCESS | WRITE_OWNER_ACCESS);
         
 	if (fnum == -1) {
 		DEBUG(5, ("cacl_set failed to open %s: %s\n",
-                          filename, cli_errstr(cli)));
+                          targetpath, cli_errstr(targetcli)));
                 errno = 0;
 		return -1;
 	}
         
-	if (!cli_set_secdesc(cli, fnum, sd)) {
-		DEBUG(5, ("ERROR: secdesc set failed: %s\n", cli_errstr(cli)));
+	if (!cli_set_secdesc(targetcli, fnum, sd)) {
+		DEBUG(5, ("ERROR: secdesc set failed: %s\n",
+			cli_errstr(targetcli)));
 		ret = -1;
 	}
         
 	/* Clean up */
         
 failed:
-	cli_close(cli, fnum);
+	cli_close(targetcli, fnum);
         
         if (err != 0) {
                 errno = err;
diff --git a/source/smbd/fileio.c b/source/smbd/fileio.c
index 0958418..60aeeef 100644
--- a/source/smbd/fileio.c
+++ b/source/smbd/fileio.c
@@ -204,7 +204,9 @@ void trigger_write_time_update(struct files_struct *fsp)
 
 	if (fsp->update_write_time_triggered) {
 		/*
-		 * No point - an event is already scheduled.
+		 * We only update the write time
+		 * on the first write. After that
+		 * no other writes affect this.
 		 */
 		return;
 	}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list