[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Sat Feb 13 00:19:30 MST 2010


The branch, master has been updated
       via  9252df5... Use sec_initial_uid() in the places where being root doesn't matter, and 0 in the places where it does.
      from  d46d771... Simplify the logic in make_connection_snum(), and make it match Windows behavior.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 9252df53d95d6ebe43314ffd87a9dda940b1ae10
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Feb 12 23:18:53 2010 -0800

    Use sec_initial_uid() in the places where being root doesn't matter,
    and 0 in the places where it does.
    
    Jeremy

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

Summary of changes:
 source3/lib/afs_settoken.c     |    2 +-
 source3/lib/debug.c            |    2 +-
 source3/lib/fault.c            |    2 +-
 source3/printing/printing_db.c |    2 +-
 source3/smbd/service.c         |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/afs_settoken.c b/source3/lib/afs_settoken.c
index 6421c0a..80eed13 100644
--- a/source3/lib/afs_settoken.c
+++ b/source3/lib/afs_settoken.c
@@ -236,7 +236,7 @@ bool afs_settoken_str(const char *token_string)
 	if (!afs_decode_token(token_string, &cell, &ticket, &ct))
 		return False;
 
-	if (geteuid() != 0)
+	if (geteuid() != sec_initial_uid())
 		ct.ViceId = getuid();
 
 	result = afs_settoken(cell, &ct, ticket);
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index 80b8310..83211dd 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -738,7 +738,7 @@ void check_log_size( void )
 	 *  loop check do a new check as root.
 	 */
 
-	if( geteuid() != 0 )
+	if( geteuid() != sec_initial_uid() )
 		return;
 
 	if(log_overflow || !need_to_check_log_size() )
diff --git a/source3/lib/fault.c b/source3/lib/fault.c
index bf61bb2..50fa2b8 100644
--- a/source3/lib/fault.c
+++ b/source3/lib/fault.c
@@ -304,7 +304,7 @@ void dump_core_setup(const char *progname)
 	/* If we're running as non root we might not be able to dump the core
 	 * file to the corepath.  There must not be an unbecome_root() before
 	 * we call abort(). */
-	if (geteuid() != 0) {
+	if (geteuid() != sec_initial_uid()) {
 		become_root();
 	}
 
diff --git a/source3/printing/printing_db.c b/source3/printing/printing_db.c
index 746e768..762b418 100644
--- a/source3/printing/printing_db.c
+++ b/source3/printing/printing_db.c
@@ -98,7 +98,7 @@ struct tdb_print_db *get_print_db_byname(const char *printername)
 		return NULL;
 	}
 
-	if (geteuid() != 0) {
+	if (geteuid() != sec_initial_uid()) {
 		become_root();
 		done_become_root = True;
 	}
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index b3e833e..f908819 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -1083,7 +1083,7 @@ connection_struct *make_connection_snum(struct smbd_server_connection *sconn,
   err_root_exit:
 	TALLOC_FREE(smb_fname_cpath);
 	/* We must exit this function as root. */
-	if (geteuid() != sec_initial_uid()) {
+	if (geteuid() != 0) {
 		change_to_root_user();
 	}
 	if (on_err_call_dis_hook) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list