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

Karolin Seeger kseeger at samba.org
Thu Apr 11 03:36:03 MDT 2013


The branch, v4-0-test has been updated
       via  4bebda4 [PATCH] getpass: Don't fail if stdin is not a tty
       via  077865d BUG 9699: Fix adding case sensitive spn.
       via  686104b vfs_fake_perms: Fix bug 9775, segfault for "artificial" conn_structs
       via  67214f6 vfs_fake_perms: Slightly streamline code
       via  3089e8c vfs_fake_perms: Slightly streamline code
       via  25e7ea2 s3:modules: fix the build of vfs_notify_fam (bug #9545)
      from  5d5f301 VERSION: Bump version number up to 4.0.6

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


- Log -----------------------------------------------------------------
commit 4bebda4da425a38046b14afaaa76921bb49de75e
Author: Alexander Bokovoy <ab at samba.org>
Date:   Thu Apr 11 09:45:12 2013 +0200

    [PATCH] getpass: Don't fail if stdin is not a tty
    
    We don't need to manipulate the tty state (such as turning off
    echo) when prompting for passwords if we're not reading from a tty.
    
    Backport based on a patch provided by Stef Walter <stefw at gnome.org>.
    
    Fix bug #9767 - "net ads join" fails when called via stdin.
    
    Autobuild-User(v4-0-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-0-test): Thu Apr 11 11:35:07 CEST 2013 on sn-devel-104

commit 077865de2d788f5e4eabe2f610be23791dfce117
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Apr 3 15:46:00 2013 +0200

    BUG 9699: Fix adding case sensitive spn.
    
    We should be able to define the case of the spn cause it is important
    for some services like nfs. 'net ads keytab add "nfs"' should not
    result in an uppercase spn.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Apr  3 23:57:32 CEST 2013 on sn-devel-104

commit 686104b3ec9b64e0d85b40633b1b8d24b16442cb
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Apr 9 21:18:34 2013 +0200

    vfs_fake_perms: Fix bug 9775, segfault for "artificial" conn_structs
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    
    The last 3 patches address bug #9775, segfault for "artificial" conn_structs.

commit 67214f6551c28a66fde76a9bac5fd79d4d4c0699
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Apr 9 21:07:23 2013 +0200

    vfs_fake_perms: Slightly streamline code
    
    Don't initialize a variable directly set
    
    Signed-off-by: Volker Lendecke <vl at samba.org>

commit 3089e8c760435f8f296a2a6c9644d39d35f95ac6
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Apr 9 21:07:23 2013 +0200

    vfs_fake_perms: Slightly streamline code
    
    Do an early error return
    
    Signed-off-by: Volker Lendecke <vl at samba.org>

commit 25e7ea2a19b8d0943255922a0ef291e42eafcabf
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Mar 22 09:30:05 2013 +0100

    s3:modules: fix the build of vfs_notify_fam (bug #9545)
    
    This adds the --with-fam option and configure checks.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    (cherry picked from commit 0d75c902254c6e27964c631459ef8e9b379b77fc)

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

Summary of changes:
 lib/replace/getpass.c            |    7 ++--
 source3/libads/ldap.c            |   14 +-------
 source3/modules/vfs_fake_perms.c |   66 +++++++++++++++++++++++++++----------
 source3/modules/wscript_build    |    4 ++
 source3/wscript                  |   30 +++++++++++++++++
 5 files changed, 88 insertions(+), 33 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/replace/getpass.c b/lib/replace/getpass.c
index f95109f..3627222 100644
--- a/lib/replace/getpass.c
+++ b/lib/replace/getpass.c
@@ -138,7 +138,7 @@ static void gotintr_sig(int signum)
 char *rep_getpass(const char *prompt)
 {
 	FILE *in, *out;
-	int echo_off;
+	int echo_off, is_a_tty;
 	static char buf[256];
 	static size_t bufsize = sizeof(buf);
 	size_t nread;
@@ -160,8 +160,9 @@ char *rep_getpass(const char *prompt)
 	setvbuf(in, NULL, _IONBF, 0);
 
 	/* Turn echoing off if it is on now.  */
+	is_a_tty = isatty(fileno(in)) > 0;
 
-	if (tcgetattr (fileno (in), &t) == 0) {
+	if (is_a_tty && (tcgetattr (fileno (in), &t) == 0)) {
 		if (ECHO_IS_ON(t)) {
 			TURN_ECHO_OFF(t);
 			echo_off = tcsetattr (fileno (in), TCSAFLUSH, &t) == 0;
@@ -196,7 +197,7 @@ char *rep_getpass(const char *prompt)
 		if (gotintr && in_fd == -1) {
 			in = fopen ("/dev/tty", "w+");
 		}
-		if (in != NULL)
+		if ((in != NULL) && is_a_tty)
 			tcsetattr (fileno (in), TCSANOW, &t);
 	}
 
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index ca5962c..2a4a83b 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -1949,12 +1949,7 @@ ADS_STATUS ads_add_service_principal_name(ADS_STRUCT *ads, const char *machine_n
 		ads_msgfree(ads, res);
 		return ADS_ERROR(LDAP_NO_MEMORY);
 	}
-	if (!strupper_m(psp1)) {
-		ret = ADS_ERROR(LDAP_NO_MEMORY);
-		goto out;
-	}
-
-	if (!strlower_m(&psp1[strlen(spn)])) {
+	if (!strlower_m(&psp1[strlen(spn) + 1])) {
 		ret = ADS_ERROR(LDAP_NO_MEMORY);
 		goto out;
 	}
@@ -1970,12 +1965,7 @@ ADS_STATUS ads_add_service_principal_name(ADS_STRUCT *ads, const char *machine_n
 		ret = ADS_ERROR(LDAP_NO_MEMORY);
 		goto out;
 	}
-	if (!strupper_m(psp2)) {
-		ret = ADS_ERROR(LDAP_NO_MEMORY);
-		goto out;
-	}
-
-	if (!strlower_m(&psp2[strlen(spn)])) {
+	if (!strlower_m(&psp2[strlen(spn) + 1])) {
 		ret = ADS_ERROR(LDAP_NO_MEMORY);
 		goto out;
 	}
diff --git a/source3/modules/vfs_fake_perms.c b/source3/modules/vfs_fake_perms.c
index 4cda7ea..8eb6e3c 100644
--- a/source3/modules/vfs_fake_perms.c
+++ b/source3/modules/vfs_fake_perms.c
@@ -32,17 +32,32 @@
 static int fake_perms_stat(vfs_handle_struct *handle,
 			   struct smb_filename *smb_fname)
 {
-	int ret = -1;
+	int ret;
 
 	ret = SMB_VFS_NEXT_STAT(handle, smb_fname);
-	if (ret == 0) {
-		if (S_ISDIR(smb_fname->st.st_ex_mode)) {
-			smb_fname->st.st_ex_mode = S_IFDIR | S_IRWXU;
-		} else {
-			smb_fname->st.st_ex_mode = S_IRWXU;
-		}
-		smb_fname->st.st_ex_uid = handle->conn->session_info->unix_token->uid;
-		smb_fname->st.st_ex_gid = handle->conn->session_info->unix_token->gid;
+	if (ret != 0) {
+		return ret;
+	}
+
+	if (S_ISDIR(smb_fname->st.st_ex_mode)) {
+		smb_fname->st.st_ex_mode = S_IFDIR | S_IRWXU;
+	} else {
+		smb_fname->st.st_ex_mode = S_IRWXU;
+	}
+
+	if (handle->conn->session_info != NULL) {
+		struct security_unix_token *utok;
+
+		utok = handle->conn->session_info->unix_token;
+		smb_fname->st.st_ex_uid = utok->uid;
+		smb_fname->st.st_ex_gid = utok->gid;
+	} else {
+		/*
+		 * We have an artificial connection for dfs for example. It
+		 * sucks, but the current uid/gid is the best we have.
+		 */
+		smb_fname->st.st_ex_uid = geteuid();
+		smb_fname->st.st_ex_gid = getegid();
 	}
 
 	return ret;
@@ -50,18 +65,33 @@ static int fake_perms_stat(vfs_handle_struct *handle,
 
 static int fake_perms_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
 {
-	int ret = -1;
+	int ret;
 
 	ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
-	if (ret == 0) {
-		if (S_ISDIR(sbuf->st_ex_mode)) {
-			sbuf->st_ex_mode = S_IFDIR | S_IRWXU;
-		} else {
-			sbuf->st_ex_mode = S_IRWXU;
-		}
-		sbuf->st_ex_uid = handle->conn->session_info->unix_token->uid;
-		sbuf->st_ex_gid = handle->conn->session_info->unix_token->gid;
+	if (ret != 0) {
+		return ret;
 	}
+
+	if (S_ISDIR(sbuf->st_ex_mode)) {
+		sbuf->st_ex_mode = S_IFDIR | S_IRWXU;
+	} else {
+		sbuf->st_ex_mode = S_IRWXU;
+	}
+	if (handle->conn->session_info != NULL) {
+		struct security_unix_token *utok;
+
+		utok = handle->conn->session_info->unix_token;
+		sbuf->st_ex_uid = utok->uid;
+		sbuf->st_ex_gid = utok->gid;
+	} else {
+		/*
+		 * We have an artificial connection for dfs for example. It
+		 * sucks, but the current uid/gid is the best we have.
+		 */
+		sbuf->st_ex_uid = geteuid();
+		sbuf->st_ex_gid = getegid();
+	}
+
 	return ret;
 }
 
diff --git a/source3/modules/wscript_build b/source3/modules/wscript_build
index 2e431b6..16ed276 100644
--- a/source3/modules/wscript_build
+++ b/source3/modules/wscript_build
@@ -318,9 +318,13 @@ bld.SAMBA3_MODULE('vfs_gpfs',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('vfs_gpfs'),
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_gpfs'))
 
+vfs_notify_fam_deps='samba-util '
+if bld.CONFIG_SET('SAMBA_FAM_LIBS'):
+   vfs_notify_fam_deps += bld.CONFIG_GET('SAMBA_FAM_LIBS')
 bld.SAMBA3_MODULE('vfs_notify_fam',
                  subsystem='vfs',
                  source=VFS_NOTIFY_FAM_SRC,
+                 deps=vfs_notify_fam_deps,
                  init_function='',
                  internal_module=bld.SAMBA3_IS_STATIC_MODULE('vfs_notify_fam'),
                  enabled=bld.SAMBA3_IS_ENABLED_MODULE('vfs_notify_fam'))
diff --git a/source3/wscript b/source3/wscript
index 194d712..7f83fef 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -42,6 +42,7 @@ def set_options(opt):
     opt.SAMBA3_ADD_OPTION('automount')
     opt.SAMBA3_ADD_OPTION('aio-support')
     opt.SAMBA3_ADD_OPTION('dmapi', default=False, help="build with DMAPI support")
+    opt.SAMBA3_ADD_OPTION('fam', default=None) # None means autodetection
     opt.SAMBA3_ADD_OPTION('profiling-data', default=False)
 
     opt.SAMBA3_ADD_OPTION('cluster-support', default=None)
@@ -163,6 +164,32 @@ main() {
 }''', 'HAVE_KERNEL_SHARE_MODES', addmain=False, execute=True,
         msg="Checking for kernel share modes")
 
+    # check for fam libs
+    samba_fam_libs=None
+    check_for_fam=False
+    if Options.options.with_fam is None:
+        check_for_fam=True
+    elif Options.options.with_fam == True:
+        check_for_fam=True
+
+    if check_for_fam and conf.CHECK_HEADERS('fam.h'):
+        if conf.CHECK_FUNCS_IN('FAMOpen2', 'fam'):
+            samba_fam_libs='fam'
+        elif conf.CHECK_FUNCS_IN('FAMOpen2', 'fam C'):
+            samba_fam_libs='fam C'
+        conf.CHECK_TYPE('enum FAMCodes', headers='fam.h',
+            define='HAVE_FAM_H_FAMCODES_TYPEDEF',
+            msg='Checking whether enum FAMCodes is available')
+        conf.CHECK_FUNCS_IN('FAMNoExists', 'fam')
+
+    if samba_fam_libs is not None:
+        conf.DEFINE('SAMBA_FAM_LIBS', samba_fam_libs)
+    else:
+        if Options.options.with_fam == True:
+            conf.fatal('FAM support requested, but no suitable FAM library found')
+        elif check_for_fam:
+            Logs.warn('no suitable FAM library found')
+
     # check for DMAPI libs
     Logs.info("Checking for DMAPI library existence")
     conf.env['dmapi_lib'] = ''
@@ -1742,6 +1769,9 @@ main() {
     if conf.CONFIG_SET('HAVE_GPFS'):
 	default_shared_modules.extend(TO_LIST('vfs_gpfs'))
 
+    if conf.CONFIG_SET('SAMBA_FAM_LIBS'):
+        default_shared_modules.extend(TO_LIST('vfs_notify_fam'))
+
     explicit_shared_modules = TO_LIST(Options.options.shared_modules, delimiter=',')
     explicit_static_modules = TO_LIST(Options.options.static_modules, delimiter=',')
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list