[SCM] Samba Shared Repository - branch v3-0-test updated - release-3-0-27a-10-g4702514

Michael Adam obnox at samba.org
Fri Nov 30 15:12:45 GMT 2007


The branch, v3-0-test has been updated
       via  47025144922011d9f2d6754a7a540e41dff4d56f (commit)
      from  8b83ddcce126c8a2c36b535c86f4a5b8c25a92f8 (commit)

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


- Log -----------------------------------------------------------------
commit 47025144922011d9f2d6754a7a540e41dff4d56f
Author: Michael Adam <obnox at samba.org>
Date:   Fri Nov 30 16:10:32 2007 +0100

    Prevent net getdomainsid from panicing when called as non-root.
    
    (Unable to open secrets.tdb.)
    
    Michael

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

Summary of changes:
 source/utils/net.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/utils/net.c b/source/utils/net.c
index a030531..99384ad 100644
--- a/source/utils/net.c
+++ b/source/utils/net.c
@@ -677,6 +677,16 @@ static int net_getdomainsid(int argc, const char **argv)
 			  "backend knowlege (such as the sid stored in LDAP)\n"));
 	}
 
+	/* first check to see if we can even access secrets, so we don't
+	   panic when we can't. */
+
+	if (!secrets_init()) {
+		d_fprintf(stderr, "Unable to open secrets.tdb.  "
+				  "Can't fetch domainSID for name: %s\n",
+				  get_global_sam_name());
+		return 1;
+	}
+
 	/* Generate one, if it doesn't exist */
 	get_global_sam_sid();
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list