[SCM] Samba Shared Repository - branch v4-0-test updated

Karolin Seeger kseeger at samba.org
Sat Sep 22 20:39:03 MDT 2012


The branch, v4-0-test has been updated
       via  9d6068c docs: Fix generating idmap manpages.
       via  d2cd124 s3: make ldapsam-related functions a smbldaphelper subsystem
       via  47a2df0 Sigh :-(. Removing optimization prematurely is the root of all evil :-(.
       via  d8eb7c2 s3:vfs_gpfs: fix build
       via  f4765c6 s3: fix the aix acl module
       via  ff37f64 s3: fix the tru64 acl module
       via  baeaa32 s3: fix the hpux acl module
       via  579879a s3: Fix the vfs_solarisacl module to compile.
      from  949c37c script/autobuild.py: add --log-base option

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 9d6068c03fc014caf5c6856281b5701fcd4d18cf
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Sep 13 17:52:13 2012 +0200

    docs: Fix generating idmap manpages.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    
    Fix bug #9159 - idmap manpages are not built.
    
    Autobuild-User(v4-0-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-0-test): Sun Sep 23 04:38:19 CEST 2012 on sn-devel-104

commit d2cd124dc3293ab3a6a103301eabcbf786b27f1a
Author: Alexander Bokovoy <ab at samba.org>
Date:   Thu Sep 13 15:40:31 2012 +0300

    s3: make ldapsam-related functions a smbldaphelper subsystem
    
    Since these functions are used in pdb_ldap and idmap_ldap, and
    pdb_ldap might be statically linked to libpdb (default), it is
    better to keep them as separate subsystem to avoid polluting libpdb
    namespace.
    
    This is first step in refactoring libpdb. Right now I cannot move
    these functions into proper libsmbldaphelper as it uses more of
    libpdb-included functions and linking pdb_ldap against libsmbldaphelper
    library would have created a loop if pdb_ldap is included into libpdb.
    
    Fix bug #9157 - libpdb/pdb_ldap/idmap_ldap build dependencies cleanup.

commit 47a2df0d966df771491510c58203d78bbfa5a152
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Sep 13 10:13:21 2012 -0700

    Sigh :-(. Removing optimization prematurely is the root of all evil :-(.
    
    Sorry for the mistake, but the LastDir singleton cache in vfs_ChDir()
    actually plays an important role. When we're processing a stream of
    SMB1/SMB2/SMB3 requests we don't want to add a chdir()/getcwd()
    system call pair on every request if they're all on the same connection
    and dealing with the same base path.
    
    I did some testing with a program that times 1,000,000 chdir()
    requests vs. 1,000,000 strcmp requests and it's a penalty of 10x
    doing the system calls.
    
    Just because it's old code, doesn't mean it's bad :-(.
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Sep 13 21:31:42 CEST 2012 on sn-devel-104
    
    Fix bug #9161 - We should re-add the vfs_Chdir() cache I removed.

commit d8eb7c25db962af3fdb8b528635c1d81220a1bcf
Author: Christian Ambach <ambi at samba.org>
Date:   Sat Sep 15 22:57:51 2012 +0200

    s3:vfs_gpfs: fix build
    
    after recent VFS changes
    (cherry picked from commit 7a6182962966e5edb42728c8d0a4d471a69c83d7)
    
    The last 5 patches address bug #162 - Illumos/Solaris Build is Broken using
    --with-acl.

commit f4765c6275124cc92eacf5e44065670d6b678918
Author: Björn Jacke <bj at sernet.de>
Date:   Fri Sep 14 09:35:53 2012 +0200

    s3: fix the aix acl module
    
    This was not adopted to the recent VFS acl structure changes.
    (cherry picked from commit 35632eec8e3b0dcfecffde814a790cc4f444dd97)

commit ff37f64d86375d0535ab1cbfeb84d8942963864d
Author: Björn Jacke <bj at sernet.de>
Date:   Fri Sep 14 09:40:07 2012 +0200

    s3: fix the tru64 acl module
    
    This was not adopted to the recent VFS acl structure changes.
    (cherry picked from commit 9222f0f9280485c2751ecfdb96421da25e6e5344)

commit baeaa32015b9bb661513ce496b80cf8bf21bf715
Author: Björn Jacke <bj at sernet.de>
Date:   Fri Sep 14 10:01:33 2012 +0200

    s3: fix the hpux acl module
    
    This was not adopted to the recent VFS acl structure changes.
    
    Autobuild-User(master): Björn Jacke <bj at sernet.de>
    Autobuild-Date(master): Fri Sep 14 12:23:23 CEST 2012 on sn-devel-104
    (cherry picked from commit 1aa281ecb0f45c97d78161fd1308be8655295f1f)

commit 579879ab448c0a74e4c8d933893be812d246d89f
Author: Ira Cooper <ira at samba.org>
Date:   Fri Sep 14 01:32:45 2012 +0000

    s3: Fix the vfs_solarisacl module to compile.
    
    This got broken with the recent VFS acl structure changes.

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

Summary of changes:
 docs-xml/wscript_build            |    8 ++++++++
 source3/modules/vfs_aixacl_util.c |   18 +++++++++---------
 source3/modules/vfs_gpfs.c        |   10 +++++-----
 source3/modules/vfs_hpuxacl.c     |   10 +++++-----
 source3/modules/vfs_solarisacl.c  |   10 +++++-----
 source3/modules/vfs_tru64acl.c    |   10 +++++-----
 source3/passdb/wscript_build      |    4 ++--
 source3/smbd/globals.c            |    1 +
 source3/smbd/globals.h            |    1 +
 source3/smbd/vfs.c                |   13 +++++++++++++
 source3/winbindd/wscript_build    |    2 +-
 source3/wscript_build             |    5 ++++-
 12 files changed, 59 insertions(+), 33 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build
index 14fa152..011854b 100644
--- a/docs-xml/wscript_build
+++ b/docs-xml/wscript_build
@@ -6,6 +6,14 @@ manpages='''
          manpages/libsmbclient.7
          manpages/lmhosts.5
          manpages/log2pcap.1
+         manpages/idmap_ad.8
+         manpages/idmap_autorid.8
+         manpages/idmap_hash.8
+         manpages/idmap_ldap.8
+         manpages/idmap_nss.8
+         manpages/idmap_rid.8
+         manpages/idmap_tdb.8
+         manpages/idmap_tdb2.8
          manpages/net.8
          manpages/nmbd.8
          manpages/nmblookup.1
diff --git a/source3/modules/vfs_aixacl_util.c b/source3/modules/vfs_aixacl_util.c
index fb13866..82e8bd1 100644
--- a/source3/modules/vfs_aixacl_util.c
+++ b/source3/modules/vfs_aixacl_util.c
@@ -27,7 +27,7 @@ SMB_ACL_T aixacl_to_smbacl(struct acl *file_acl)
 	struct acl_entry *acl_entry;
 	struct ace_id *idp;
 	
-	struct smb_acl_t *result = sys_acl_init(0);
+	struct smb_acl_t *result = sys_acl_init();
 	struct smb_acl_entry *ace;
 	int i;
 	
@@ -78,15 +78,15 @@ SMB_ACL_T aixacl_to_smbacl(struct acl *file_acl)
 							
 			switch(ace->a_type) {
 			case ACEID_USER: {
-			ace->uid = idp->id_data[0];
-			DEBUG(10,("case ACEID_USER ace->uid is %d\n",ace->uid));
+			ace->info.user.uid = idp->id_data[0];
+			DEBUG(10,("case ACEID_USER ace->info.user.uid is %d\n",ace->info.user.uid));
 			ace->a_type = SMB_ACL_USER;
 			break;
 			}
 		
 			case ACEID_GROUP: {
-			ace->gid = idp->id_data[0];
-			DEBUG(10,("case ACEID_GROUP ace->gid is %d\n",ace->gid));
+			ace->info.group.gid = idp->id_data[0];
+			DEBUG(10,("case ACEID_GROUP ace->info.group.gid is %d\n",ace->info.group.gid));
 			ace->a_type = SMB_ACL_GROUP;
 			break;
 			}
@@ -149,9 +149,9 @@ SMB_ACL_T aixacl_to_smbacl(struct acl *file_acl)
 			
 		ace = &result->acl[result->count];
 		
-		ace->uid = 0;
-		ace->gid = 0;
-		DEBUG(10,("ace->uid = %d\n",ace->uid));
+		ace->info.user.uid = 0;
+		ace->info.group.gid = 0;
+		DEBUG(10,("ace->info.user.uid = %d\n",ace->info.user.uid));
 		
 		switch(i) {
 		case 2:
@@ -287,7 +287,7 @@ struct acl *aixacl_smb_to_aixacl(SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
 		ace_id->id_type = (smb_entry->a_type==SMB_ACL_GROUP) ? ACEID_GROUP : ACEID_USER;
 		DEBUG(10,("The id type is %d\n",ace_id->id_type));
 		ace_id->id_len = sizeof(struct ace_id); /* contains 1 id_data */
-		ace_id->id_data[0] = (smb_entry->a_type==SMB_ACL_GROUP) ? smb_entry->gid : smb_entry->uid;
+		ace_id->id_data[0] = (smb_entry->a_type==SMB_ACL_GROUP) ? smb_entry->info.group.gid : smb_entry->info.user.uid;
 	}
 
 	return file_acl;
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index a39187e..8959fe6 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -554,7 +554,7 @@ static SMB_ACL_T gpfs2smb_acl(const struct gpfs_acl *pacl)
 	SMB_ACL_T result;
 	gpfs_aclCount_t i;
 
-	result = sys_acl_init(pacl->acl_nace);
+	result = sys_acl_init();
 	if (result == NULL) {
 		errno = ENOMEM;
 		return NULL;
@@ -573,14 +573,14 @@ static SMB_ACL_T gpfs2smb_acl(const struct gpfs_acl *pacl)
 		switch (g_ace->ace_type) {
 		case GPFS_ACL_USER:
 			ace->a_type = SMB_ACL_USER;
-			ace->uid = (uid_t)g_ace->ace_who;
+			ace->info.user.uid = (uid_t)g_ace->ace_who;
 			break;
 		case GPFS_ACL_USER_OBJ:
 			ace->a_type = SMB_ACL_USER_OBJ;
 			break;
 		case GPFS_ACL_GROUP:
 			ace->a_type = SMB_ACL_GROUP;
-			ace->gid = (gid_t)g_ace->ace_who;
+			ace->info.group.gid = (gid_t)g_ace->ace_who;
 			break;
 		case GPFS_ACL_GROUP_OBJ:
  			ace->a_type = SMB_ACL_GROUP_OBJ;
@@ -738,7 +738,7 @@ static struct gpfs_acl *smb2gpfs_acl(const SMB_ACL_T pacl,
 		switch(ace->a_type) {
 		case SMB_ACL_USER:
 			g_ace->ace_type = GPFS_ACL_USER;
-			g_ace->ace_who = (gpfs_uid_t)ace->uid;
+			g_ace->ace_who = (gpfs_uid_t)ace->info.user.uid;
 			break;
 		case SMB_ACL_USER_OBJ:
 			g_ace->ace_type = GPFS_ACL_USER_OBJ;
@@ -747,7 +747,7 @@ static struct gpfs_acl *smb2gpfs_acl(const SMB_ACL_T pacl,
 			break;
 		case SMB_ACL_GROUP:
 			g_ace->ace_type = GPFS_ACL_GROUP;
-			g_ace->ace_who = (gpfs_uid_t)ace->gid;
+			g_ace->ace_who = (gpfs_uid_t)ace->info.group.gid;
 			break;
 		case SMB_ACL_GROUP_OBJ:
 			g_ace->ace_type = GPFS_ACL_GROUP_OBJ;
diff --git a/source3/modules/vfs_hpuxacl.c b/source3/modules/vfs_hpuxacl.c
index f8661b1..884cc5c 100644
--- a/source3/modules/vfs_hpuxacl.c
+++ b/source3/modules/vfs_hpuxacl.c
@@ -436,13 +436,13 @@ static bool smb_acl_to_hpux_acl(SMB_ACL_T smb_acl,
 		switch(hpux_entry.a_type) {
 		case USER:
 			DEBUG(10, ("got tag type USER with uid %d\n", 
-				   smb_entry->uid));
-			hpux_entry.a_id = (uid_t)smb_entry->uid;
+				   smb_entry->info.user.uid));
+			hpux_entry.a_id = (uid_t)smb_entry->info.user.uid;
 			break;
 		case GROUP:
 			DEBUG(10, ("got tag type GROUP with gid %d\n", 
-				   smb_entry->gid));
-			hpux_entry.a_id = (uid_t)smb_entry->gid;
+				   smb_entry->info.group.gid));
+			hpux_entry.a_id = (uid_t)smb_entry->info.group.gid;
 			break;
 		default:
 			break;
@@ -495,7 +495,7 @@ static SMB_ACL_T hpux_acl_to_smb_acl(HPUX_ACL_T hpux_acl, int count,
 	SMB_ACL_T result;
 	int i;
 
-	if ((result = sys_acl_init(0)) == NULL) {
+	if ((result = sys_acl_init()) == NULL) {
 		DEBUG(10, ("error allocating memory for SMB_ACL\n"));
 		goto fail;
 	}
diff --git a/source3/modules/vfs_solarisacl.c b/source3/modules/vfs_solarisacl.c
index ff9f1a6..10b6f70 100644
--- a/source3/modules/vfs_solarisacl.c
+++ b/source3/modules/vfs_solarisacl.c
@@ -370,13 +370,13 @@ static bool smb_acl_to_solaris_acl(SMB_ACL_T smb_acl,
 		switch(solaris_entry.a_type) {
 		case USER:
 			DEBUG(10, ("got tag type USER with uid %u\n", 
-				   (unsigned int)smb_entry->uid));
-			solaris_entry.a_id = (uid_t)smb_entry->uid;
+				   (unsigned int)smb_entry->info.user.uid));
+			solaris_entry.a_id = (uid_t)smb_entry->info.user.uid;
 			break;
 		case GROUP:
 			DEBUG(10, ("got tag type GROUP with gid %u\n", 
-				   (unsigned int)smb_entry->gid));
-			solaris_entry.a_id = (uid_t)smb_entry->gid;
+				   (unsigned int)smb_entry->info.group.gid));
+			solaris_entry.a_id = (uid_t)smb_entry->info.group.gid;
 			break;
 		default:
 			break;
@@ -429,7 +429,7 @@ static SMB_ACL_T solaris_acl_to_smb_acl(SOLARIS_ACL_T solaris_acl, int count,
 	SMB_ACL_T result;
 	int i;
 
-	if ((result = sys_acl_init(0)) == NULL) {
+	if ((result = sys_acl_init()) == NULL) {
 		DEBUG(10, ("error allocating memory for SMB_ACL\n"));
 		goto fail;
 	}
diff --git a/source3/modules/vfs_tru64acl.c b/source3/modules/vfs_tru64acl.c
index 09f8c39..918f7c6 100644
--- a/source3/modules/vfs_tru64acl.c
+++ b/source3/modules/vfs_tru64acl.c
@@ -160,7 +160,7 @@ static struct smb_acl_t *tru64_acl_to_smb_acl(const struct acl *tru64_acl)
 
 	DEBUG(10, ("Hi! This is tru64_acl_to_smb_acl.\n"));
 	
-	if ((result = sys_acl_init(0)) == NULL) {
+	if ((result = sys_acl_init()) == NULL) {
 		DEBUG(0, ("sys_acl_init() failed in tru64_acl_to_smb_acl\n"));
 		errno = ENOMEM;
 		goto fail;
@@ -299,23 +299,23 @@ static acl_t smb_acl_to_tru64_acl(const SMB_ACL_T smb_acl)
 		switch (smb_entry->a_type) {
 		case SMB_ACL_USER:
 			if (acl_set_qualifier(tru64_entry, 
-						(int *)&smb_entry->uid) != 0) 
+						(int *)&smb_entry->info.user.uid) != 0) 
 			{
 				DEBUG(3, ("acl_set_qualifier failed: %s\n",
 					strerror(errno)));
 				goto fail;
 			}
-			DEBUGADD(10, (" - setting uid to %d\n", smb_entry->uid));
+			DEBUGADD(10, (" - setting uid to %d\n", smb_entry->info.user.uid));
 			break;
 		case SMB_ACL_GROUP:
 			if (acl_set_qualifier(tru64_entry, 
-						(int *)&smb_entry->gid) != 0)
+						(int *)&smb_entry->info.group.gid) != 0)
 			{
 				DEBUG(3, ("acl_set_qualifier failed: %s\n",
 					strerror(errno)));
 				goto fail;
 			}
-			DEBUGADD(10, (" - setting gid to %d\n", smb_entry->gid));
+			DEBUGADD(10, (" - setting gid to %d\n", smb_entry->info.group.gid));
 			break;
 		default:
 			break;
diff --git a/source3/passdb/wscript_build b/source3/passdb/wscript_build
index 1dfdfd0..d26afc2 100644
--- a/source3/passdb/wscript_build
+++ b/source3/passdb/wscript_build
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 PDB_TDBSAM_SRC =    'pdb_tdb.c'
-PDB_LDAP_SRC =      'pdb_ldap.c pdb_nds.c pdb_ipa.c pdb_ldap_util.c'
+PDB_LDAP_SRC =      'pdb_ldap.c pdb_nds.c pdb_ipa.c'
 PDB_SMBPASSWD_SRC = 'pdb_smbpasswd.c'
 PDB_WBC_SAM_SRC =   'pdb_wbc_sam.c'
 
@@ -15,7 +15,7 @@ bld.SAMBA3_MODULE('pdb_tdbsam',
 
 bld.SAMBA3_MODULE('pdb_ldap',
                  subsystem='pdb',
-                 deps='smbldap',
+                 deps='smbldap smbldaphelper',
                  source=PDB_LDAP_SRC,
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('pdb_ldap'),
diff --git a/source3/smbd/globals.c b/source3/smbd/globals.c
index 874f35d..80f6a66 100644
--- a/source3/smbd/globals.c
+++ b/source3/smbd/globals.c
@@ -85,6 +85,7 @@ int conn_ctx_stack_ndx = 0;
 
 struct vfs_init_function_entry *backends = NULL;
 char *sparse_buf = NULL;
+char *LastDir = NULL;
 
 struct smbd_parent_context *am_parent = NULL;
 struct memcache *smbd_memcache_ctx = NULL;
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 1cefe51..566f04d 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -101,6 +101,7 @@ extern int conn_ctx_stack_ndx;
 struct vfs_init_function_entry;
 extern struct vfs_init_function_entry *backends;
 extern char *sparse_buf;
+extern char *LastDir;
 
 struct smbd_parent_context;
 extern struct smbd_parent_context *am_parent;
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 7d19440..fe99ee2 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -801,14 +801,27 @@ int vfs_ChDir(connection_struct *conn, const char *path)
 {
 	int ret;
 
+	if (!LastDir) {
+		LastDir = SMB_STRDUP("");
+	}
+
 	if (strcsequal(path,".")) {
 		return 0;
 	}
 
+	if (*path == '/' && strcsequal(LastDir,path)) {
+		return 0;
+	}
+
 	DEBUG(4,("vfs_ChDir to %s\n",path));
 
 	ret = SMB_VFS_CHDIR(conn,path);
 	if (ret == 0) {
+		/* Global cache. */
+		SAFE_FREE(LastDir);
+		LastDir = SMB_STRDUP(path);
+
+		/* conn cache. */
 		TALLOC_FREE(conn->cwd);
 		conn->cwd = vfs_GetWd(conn, conn);
 		DEBUG(4,("vfs_ChDir got %s\n",conn->cwd));
diff --git a/source3/winbindd/wscript_build b/source3/winbindd/wscript_build
index 9f11aff..af3741b 100644
--- a/source3/winbindd/wscript_build
+++ b/source3/winbindd/wscript_build
@@ -62,7 +62,7 @@ bld.SAMBA3_MODULE('idmap_passdb',
 bld.SAMBA3_MODULE('idmap_ldap',
                  subsystem='idmap',
                  source=IDMAP_LDAP_SRC,
-                 deps='smbldap',
+                 deps='smbldap smbldaphelper',
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('idmap_ldap'),
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('idmap_ldap') and bld.env.HAVE_LDAP)
diff --git a/source3/wscript_build b/source3/wscript_build
index c7395e7..c534ae6 100755
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -215,7 +215,6 @@ PASSDB_SRC = '''${PASSDB_GET_SET_SRC} passdb/passdb.c
                 passdb/account_pol.c ${PRIVILEGES_SRC}
                 lib/util_nscd.c lib/winbind_util.c
                 passdb/pdb_util.c passdb/pdb_interface.c
-                passdb/pdb_ldap_schema.c
                 passdb/pdb_secrets.c
                 passdb/pdb_unixid.c'''
 #FIXME: lib/winbind_util.c probably is not part of PASSDB_SRC
@@ -733,6 +732,10 @@ bld.SAMBA3_LIBRARY('pdb',
                    vnum='0',
                    vars=locals())
 
+bld.SAMBA3_SUBSYSTEM('smbldaphelper',
+                   source='passdb/pdb_ldap_schema.c passdb/pdb_ldap_util.c',
+                   deps='smbldap secrets3 pdb')
+
 bld.SAMBA3_SUBSYSTEM('SERVER_MUTEX',
                      source=SERVER_MUTEX_SRC,
 		     deps='talloc')


-- 
Samba Shared Repository


More information about the samba-cvs mailing list