[SCM] SAMBA-CTDB repository - branch v3-2-ctdb updated - build_3.2.7_ctdb.54-96-gc860c4a

Michael Adam obnox at samba.org
Fri Feb 6 15:55:57 GMT 2009


The branch, v3-2-ctdb has been updated
       via  c860c4a688bb66dbe6916a365d340a94601ea416 (commit)
       via  c86c2219b23fb2e5ce652dae18b0299d76dcb524 (commit)
       via  035fa67801d55f05afbac94592a7700764624ee4 (commit)
       via  fe456e4bf8db272d1d6e99b4c1714894af17190b (commit)
       via  6c9b13a4c2bfa17793d0f575f53d815afe8a8682 (commit)
       via  f00dfc58ea2a6d5794b71136acf5d1532393132b (commit)
       via  de24718cbc55fa4b16a0370d335005f789e924f7 (commit)
       via  27f34cb57c4e4299cb43c14e22c5b15053c898ea (commit)
       via  52e48c12cf2a56d31a2404ab142d6678b430a85a (commit)
       via  16e9f1e2d4a1d391efdf8348fa7f57b2640a6bdb (commit)
       via  268be70cecd5025b0512372cff572095be763af1 (commit)
       via  8ddb30ca90d31624ba86cd731f573aedad43face (commit)
       via  11c966b7bc30b17de1bb360f405f6cb956dd5c83 (commit)
      from  8f9b7c41c8a8632467db52eb7fa3f2f6e46c2f2e (commit)

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


- Log -----------------------------------------------------------------
commit c860c4a688bb66dbe6916a365d340a94601ea416
Merge: 8f9b7c41c8a8632467db52eb7fa3f2f6e46c2f2e c86c2219b23fb2e5ce652dae18b0299d76dcb524
Author: Michael Adam <obnox at samba.org>
Date:   Fri Feb 6 16:51:28 2009 +0100

    Merge commit 'origin/v3-2-test' into v3-2-ctdb

commit c86c2219b23fb2e5ce652dae18b0299d76dcb524
Author: Jeff Layton <jlayton at redhat.com>
Date:   Fri Feb 6 08:32:40 2009 -0500

    mount.cifs: initialize rc to 0 in main
    
    The value of rc in main() isn't initialized in the declaration. This
    wasn't a problem before, but Shirish's fakemount patch can make it so
    that we return the uninitialized variable if the -n flag is used.
    
    Fix this by initializing rc to 0.
    
    Signed-off-by: Jeff Layton <jlayton at redhat.com>

commit 035fa67801d55f05afbac94592a7700764624ee4
Author: Shirish Pargaonkar <shirishpargaonkar at gmail.com>
Date:   Fri Feb 6 08:16:11 2009 -0500

    mount.cifs: add fakemount (-f) and nomtab (-n) flags to mount.cifs
    
    ...so that these options work correctly when passed in by mount(8).

commit fe456e4bf8db272d1d6e99b4c1714894af17190b
Author: Michael Adam <obnox at samba.org>
Date:   Fri Feb 6 10:42:11 2009 +0100

    s3:net conf: remove check for sharename being a usernam in "net conf addshare"
    
    This is useless and can be overriden by "net conf setparm" anyways.
    
    Michael

commit 6c9b13a4c2bfa17793d0f575f53d815afe8a8682
Author: Michael Adam <obnox at samba.org>
Date:   Thu Feb 5 22:19:58 2009 +0100

    docs: fix two typos in the mount.cifs manpage
    
    Michael
    (cherry picked from commit 145fe37766cf1ecffb16a03b58b44d08f7ed7558)
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit f00dfc58ea2a6d5794b71136acf5d1532393132b
Author: Günter Kukkukk <linux at kukkukk.com>
Date:   Thu Feb 5 18:59:03 2009 -0800

    Don't try and delete a default ACL from a file.

commit de24718cbc55fa4b16a0370d335005f789e924f7
Author: Aravind Srinivasan <aravind.srinivasan at isilon.com>
Date:   Thu Feb 5 14:46:59 2009 -0800

    Have nmbd check all available interfaces for WINS before failing
    
    When nmbd is acting as WINS, it picks the first interface's IP as WINS
    server's IP. If the first interface's IP is zero, we will just quit
    (even though we might have other interfaces with valid IPs).
    
    This patch makes nmbd look at all interfaces and pick the first interface
    with a valid IP as the WINS server's IP.

commit 27f34cb57c4e4299cb43c14e22c5b15053c898ea
Author: Shirish Pargaonkar <shirishpargaonkar at gmail.com>
Date:   Thu Feb 5 14:17:48 2009 -0500

    umount.cifs: clean-up entries in /etc/mtab after unmount
    
    This patch removes the remaining entry in /etc/mtab after a filesystem
    is unmounted by canonicalizing the mountpoint supplied on the command
    line.
    
    Please refer to bug 4370 in samba bugzilla.

commit 52e48c12cf2a56d31a2404ab142d6678b430a85a
Author: Günther Deschner <gd at samba.org>
Date:   Wed Feb 4 23:55:54 2009 +0100

    s3-net: remove unused ENUM_HND.
    
    Guenther
    (cherry picked from commit a713060a6e36706cfd5b997aa4cbfabf4e180c84)

commit 16e9f1e2d4a1d391efdf8348fa7f57b2640a6bdb
Author: Miguel Suarez <Miguel.Suarez at stratus.com>
Date:   Tue Feb 3 14:35:19 2009 -0800

    Fix bug #6085 - In vfs_default.c change utime( ) call.

commit 268be70cecd5025b0512372cff572095be763af1
Author: Ted Percival <ted.percival at quest.com>
Date:   Tue Feb 3 14:10:20 2009 -0800

    Probably fixes a crash during name resolution when log level >= 10
    and libc segfaults if printf is passed NULL for a "%s" arg
    (eg. Solaris).

commit 8ddb30ca90d31624ba86cd731f573aedad43face
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Feb 3 14:41:49 2009 +0100

    s3: Fix 'net rpc join' for users with the SeMachineAccountPrivilege.
    
    This used to be commit fda8abac in master.

commit 11c966b7bc30b17de1bb360f405f6cb956dd5c83
Author: Karolin Seeger <kseeger at samba.org>
Date:   Tue Feb 3 14:49:08 2009 +0100

    WHATSNEW: Update changes since 3.2.7.
    
    Karolin

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

Summary of changes:
 WHATSNEW.txt                         |    1 +
 docs-xml/manpages-3/mount.cifs.8.xml |    4 ++--
 source/client/mount.cifs.c           |   14 ++++++++++----
 source/client/umount.cifs.c          |   34 +++++++++++++++++++++++++++++++++-
 source/lib/interface.c               |    7 +++++--
 source/libnet/libnet_join.c          |    7 +++++--
 source/libsmb/namequery.c            |    2 +-
 source/modules/vfs_default.c         |    2 +-
 source/nmbd/nmbd_become_dmb.c        |    3 ++-
 source/nmbd/nmbd_subnetdb.c          |    3 ++-
 source/smbd/posix_acls.c             |   12 ++++++++----
 source/utils/net_conf.c              |    6 ------
 source/utils/net_rpc.c               |    3 ---
 source/utils/net_rpc_join.c          |    7 +++++--
 14 files changed, 75 insertions(+), 30 deletions(-)


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index a492967..47fd5b0 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -104,6 +104,7 @@ o   Volker Lendecke <vl at sernet.de>
     * Fix an ancient uninitialized variable read.
     * Fix a bad memleak in vfs_full_audit.
     * Fix several valgrind errors.
+    * Fix 'net rpc join' for users with the SeMachineAccountPrivilege.
 
 
 o   Herb Lewis <hlewis at chomps.localdomain>
diff --git a/docs-xml/manpages-3/mount.cifs.8.xml b/docs-xml/manpages-3/mount.cifs.8.xml
index 00711e0..c386592 100644
--- a/docs-xml/manpages-3/mount.cifs.8.xml
+++ b/docs-xml/manpages-3/mount.cifs.8.xml
@@ -372,9 +372,9 @@ port 445 is tried and if no response then port 139 is tried.
                 <term>noacl</term>
                 <listitem><para>Do not allow POSIX ACL operations even if server would support them.</para><para>
 		The CIFS client can get and set POSIX ACLs (getfacl, setfacl) to Samba servers
-		version 3.10 and later.  Setting POSIX ACLs requires enabling both XATTR and
+		version 3.0.10 and later.  Setting POSIX ACLs requires enabling both XATTR and
 		then POSIX support in the CIFS configuration options when building the cifs
-		module.  POSIX ACL support can be disabled on a per mount basic by specifying
+		module.  POSIX ACL support can be disabled on a per mount basis by specifying
 		"noacl" on mount.</para>
 		</listitem>
 	</varlistentry>
diff --git a/source/client/mount.cifs.c b/source/client/mount.cifs.c
index 79a84e6..e7397da 100644
--- a/source/client/mount.cifs.c
+++ b/source/client/mount.cifs.c
@@ -85,6 +85,7 @@
 
 const char *thisprogram;
 int verboseflag = 0;
+int fakemnt = 0;
 static int got_password = 0;
 static int got_user = 0;
 static int got_domain = 0;
@@ -1026,7 +1027,7 @@ int main(int argc, char ** argv)
 	char * resolved_path = NULL;
 	char * temp;
 	char * dev_name;
-	int rc;
+	int rc = 0;
 	int rsize = 0;
 	int wsize = 0;
 	int nomtab = 0;
@@ -1099,8 +1100,8 @@ int main(int argc, char ** argv)
 			mount_cifs_usage ();
 			exit(EX_USAGE);
 		case 'n':
-		    ++nomtab;
-		    break;
+			++nomtab;
+			break;
 		case 'b':
 #ifdef MS_BIND
 			flags |= MS_BIND;
@@ -1205,6 +1206,9 @@ int main(int argc, char ** argv)
 			break;
 		case 't':
 			break;
+		case 'f':
+			++fakemnt;
+			break;
 		default:
 			printf("unknown mount option %c\n",c);
 			mount_cifs_usage();
@@ -1400,7 +1404,7 @@ mount_retry:
 		}
 	}
 
-	if (mount(dev_name, mountpoint, "cifs", flags, options)) {
+	if (!fakemnt && mount(dev_name, mountpoint, "cifs", flags, options)) {
 		switch (errno) {
 		case ECONNREFUSED:
 		case EHOSTUNREACH:
@@ -1430,6 +1434,8 @@ mount_retry:
 		goto mount_exit;
 	}
 
+	if (nomtab)
+		goto mount_exit;
 	atexit(unlock_mtab);
 	rc = lock_mtab();
 	if (rc) {
diff --git a/source/client/umount.cifs.c b/source/client/umount.cifs.c
index aff7cea..81925ed 100644
--- a/source/client/umount.cifs.c
+++ b/source/client/umount.cifs.c
@@ -33,6 +33,7 @@
 #include <errno.h>
 #include <string.h>
 #include <mntent.h>
+#include <limits.h>
 #include "mount.h"
 
 #define UNMOUNT_CIFS_VERSION_MAJOR "0"
@@ -231,6 +232,37 @@ static int remove_from_mtab(char * mountpoint)
 	return rc;
 }
 
+/* Make a canonical pathname from PATH.  Returns a freshly malloced string.
+   It is up the *caller* to ensure that the PATH is sensible.  i.e.
+   canonicalize ("/dev/fd0/.") returns "/dev/fd0" even though ``/dev/fd0/.''
+   is not a legal pathname for ``/dev/fd0''  Anything we cannot parse
+   we return unmodified.   */
+static char *
+canonicalize(char *path)
+{
+	char *canonical = malloc (PATH_MAX + 1);
+
+	if (!canonical) {
+		fprintf(stderr, "Error! Not enough memory!\n");
+		return NULL;
+	}
+
+	if (strlen(path) > PATH_MAX) {
+		fprintf(stderr, "Mount point string too long\n");
+		return NULL;
+	}
+
+	if (path == NULL)
+		return NULL;
+
+	if (realpath (path, canonical))
+		return canonical;
+
+	strncpy (canonical, path, PATH_MAX);
+	canonical[PATH_MAX] = '\0';
+	return canonical;
+}
+
 int main(int argc, char ** argv)
 {
 	int c;
@@ -304,7 +336,7 @@ int main(int argc, char ** argv)
 	argv += optind;
 	argc -= optind;
 
-	mountpoint = argv[0];
+	mountpoint = canonicalize(argv[0]);
 
 	if((argc < 1) || (argv[0] == NULL)) {
 		printf("\nMissing name of unmount directory\n");
diff --git a/source/lib/interface.c b/source/lib/interface.c
index 15fed9e..cc8fb37 100644
--- a/source/lib/interface.c
+++ b/source/lib/interface.c
@@ -151,7 +151,8 @@ int iface_count_v4_nl(void)
 }
 
 /****************************************************************************
- Return a pointer to the in_addr of the first IPv4 interface.
+ Return a pointer to the in_addr of the first IPv4 interface that's
+ not 0.0.0.0.
 **************************************************************************/
 
 const struct in_addr *first_ipv4_iface(void)
@@ -159,7 +160,9 @@ const struct in_addr *first_ipv4_iface(void)
 	struct interface *i;
 
 	for (i=local_interfaces;i ;i=i->next) {
-		if (i->ip.ss_family == AF_INET) {
+		if ((i->ip.ss_family == AF_INET) &&
+		    (!is_zero_ip_v4(((struct sockaddr_in *)&i->ip)->sin_addr)))
+		{
 			break;
 		}
 	}
diff --git a/source/libnet/libnet_join.c b/source/libnet/libnet_join.c
index 3f72932..1f4d6a6 100644
--- a/source/libnet/libnet_join.c
+++ b/source/libnet/libnet_join.c
@@ -788,7 +788,8 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
 
 	status = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
 				      pipe_hnd->cli->desthost,
-				      SEC_RIGHTS_MAXIMUM_ALLOWED,
+				      SAMR_ACCESS_ENUM_DOMAINS
+				      | SAMR_ACCESS_OPEN_DOMAIN,
 				      &sam_pol);
 	if (!NT_STATUS_IS_OK(status)) {
 		goto done;
@@ -796,7 +797,9 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
 
 	status = rpccli_samr_OpenDomain(pipe_hnd, mem_ctx,
 					&sam_pol,
-					SEC_RIGHTS_MAXIMUM_ALLOWED,
+					SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1
+					| SAMR_DOMAIN_ACCESS_CREATE_USER
+					| SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT,
 					r->out.domain_sid,
 					&domain_pol);
 	if (!NT_STATUS_IS_OK(status)) {
diff --git a/source/libsmb/namequery.c b/source/libsmb/namequery.c
index 112df1b..dd3cd56 100644
--- a/source/libsmb/namequery.c
+++ b/source/libsmb/namequery.c
@@ -1502,7 +1502,7 @@ NTSTATUS internal_resolve_name(const char *name,
 	*return_count = 0;
 
 	DEBUG(10, ("internal_resolve_name: looking up %s#%x (sitename %s)\n",
-			name, name_type, sitename ? sitename : NULL));
+			name, name_type, sitename ? sitename : "(null)"));
 
 	if (is_ipaddress(name)) {
 		if ((*return_iplist = SMB_MALLOC_P(struct ip_service)) ==
diff --git a/source/modules/vfs_default.c b/source/modules/vfs_default.c
index 617cf7c..d46f48a 100644
--- a/source/modules/vfs_default.c
+++ b/source/modules/vfs_default.c
@@ -670,7 +670,7 @@ static int vfswrap_ntimes(vfs_handle_struct *handle, const char *path, const str
 		struct utimbuf times;
 		times.actime = convert_timespec_to_time_t(ts[0]);
 		times.modtime = convert_timespec_to_time_t(ts[1]);
-		result = utime(path, times);
+		result = utime(path, &times);
 	} else {
 		result = utime(path, NULL);
 	}
diff --git a/source/nmbd/nmbd_become_dmb.c b/source/nmbd/nmbd_become_dmb.c
index a0b2ef1..827d56c 100644
--- a/source/nmbd/nmbd_become_dmb.c
+++ b/source/nmbd/nmbd_become_dmb.c
@@ -128,7 +128,8 @@ in workgroup %s on subnet %s\n",
 
 		work->dmb_name = nmbname;
 
-		/* Pick the first interface IPv4 address as the domain master browser ip. */
+		/* Pick the first interface IPv4 address as the domain master
+		 * browser ip. */
 		nip = first_ipv4_iface();
 		if (!nip) {
 			DEBUG(0,("become_domain_master_stage2: "
diff --git a/source/nmbd/nmbd_subnetdb.c b/source/nmbd/nmbd_subnetdb.c
index 225def5..83515e9 100644
--- a/source/nmbd/nmbd_subnetdb.c
+++ b/source/nmbd/nmbd_subnetdb.c
@@ -287,7 +287,8 @@ bool create_subnets(void)
 	}
 
 	if (lp_we_are_a_wins_server()) {
-		/* Pick the first interface IPv4 address as the WINS server ip. */
+		/* Pick the first interface IPv4 address as the WINS server
+		 * ip. */
 		const struct in_addr *nip = first_ipv4_iface();
 
 		if (!nip) {
diff --git a/source/smbd/posix_acls.c b/source/smbd/posix_acls.c
index 603ea2d..90c2caf 100644
--- a/source/smbd/posix_acls.c
+++ b/source/smbd/posix_acls.c
@@ -4063,10 +4063,14 @@ bool set_unix_posix_default_acl(connection_struct *conn, const char *fname, SMB_
 {
 	SMB_ACL_T def_acl = NULL;
 
-	if (num_def_acls && !S_ISDIR(psbuf->st_mode)) {
-		DEBUG(5,("set_unix_posix_default_acl: Can't set default ACL on non-directory file %s\n", fname ));
-		errno = EISDIR;
-		return False;
+	if (!S_ISDIR(psbuf->st_mode)) {
+		if (num_def_acls) {
+			DEBUG(5,("set_unix_posix_default_acl: Can't set default ACL on non-directory file %s\n", fname ));
+			errno = EISDIR;
+			return False;
+		} else {
+			return True;
+		}
 	}
 
 	if (!num_def_acls) {
diff --git a/source/utils/net_conf.c b/source/utils/net_conf.c
index 08a06ea..6639b85 100644
--- a/source/utils/net_conf.c
+++ b/source/utils/net_conf.c
@@ -549,12 +549,6 @@ static int net_conf_addshare(struct smbconf_ctx *conf_ctx,
 		goto done;
 	}
 
-	if (getpwnam(sharename)) {
-		d_fprintf(stderr, "ERROR: share name %s is already a valid "
-			  "system user name.\n", sharename);
-		goto done;
-	}
-
 	if (strequal(sharename, GLOBAL_NAME)) {
 		d_fprintf(stderr,
 			  "ERROR: 'global' is not a valid share name.\n");
diff --git a/source/utils/net_rpc.c b/source/utils/net_rpc.c
index d4d11de..0476394 100644
--- a/source/utils/net_rpc.c
+++ b/source/utils/net_rpc.c
@@ -4606,7 +4606,6 @@ static NTSTATUS rpc_share_allowedusers_internals(const DOM_SID *domain_sid,
 {
 	int ret;
 	bool r;
-	ENUM_HND hnd;
 	uint32 i;
 	FILE *f;
 
@@ -4644,8 +4643,6 @@ static NTSTATUS rpc_share_allowedusers_internals(const DOM_SID *domain_sid,
 	for (i=0; i<num_tokens; i++)
 		collect_alias_memberships(&tokens[i].token);
 
-	init_enum_hnd(&hnd, 0);
-
 	share_list.num_shares = 0;
 	share_list.shares = NULL;
 
diff --git a/source/utils/net_rpc_join.c b/source/utils/net_rpc_join.c
index b9d7d59..0e8f47b 100644
--- a/source/utils/net_rpc_join.c
+++ b/source/utils/net_rpc_join.c
@@ -239,14 +239,17 @@ int net_rpc_join_newstyle(int argc, const char **argv)
 
 	CHECK_RPC_ERR(rpccli_samr_Connect2(pipe_hnd, mem_ctx,
 					   pipe_hnd->cli->desthost,
-					   SEC_RIGHTS_MAXIMUM_ALLOWED,
+					   SAMR_ACCESS_ENUM_DOMAINS
+					   | SAMR_ACCESS_OPEN_DOMAIN,
 					   &sam_pol),
 		      "could not connect to SAM database");
 
 
 	CHECK_RPC_ERR(rpccli_samr_OpenDomain(pipe_hnd, mem_ctx,
 					     &sam_pol,
-					     SEC_RIGHTS_MAXIMUM_ALLOWED,
+					     SAMR_DOMAIN_ACCESS_LOOKUP_INFO_1
+					     | SAMR_DOMAIN_ACCESS_CREATE_USER
+					     | SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT,
 					     domain_sid,
 					     &domain_pol),
 		      "could not open domain");


-- 
SAMBA-CTDB repository


More information about the samba-cvs mailing list