The branch, master has been updated
       via  08cee6c s3:utils: Allow to run smbpasswd as user
      from  cd813f7 s3:gse_krb5: make use of precalculated krb5 keys in 
fill_mem_keytab_from_secrets()

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


- Log -----------------------------------------------------------------
commit 08cee6cfd2b8580f85f45bb4e0a06e14910e6b65
Author: Andreas Schneider <[email protected]>
Date:   Fri Aug 18 09:41:36 2017 +0200

    s3:utils: Allow to run smbpasswd as user
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12974
    
    Signed-off-by: Andreas Schneider <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>
    
    Autobuild-User(master): Andreas Schneider <[email protected]>
    Autobuild-Date(master): Fri Aug 18 14:01:27 CEST 2017 on sn-devel-144

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

Summary of changes:
 source3/utils/smbpasswd.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index aa6b857..ae98626 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -586,6 +586,7 @@ static int process_nonroot(int local_flags)
 int main(int argc, char **argv)
 {      
        TALLOC_CTX *frame = talloc_stackframe();
+       struct messaging_context *msg_ctx = NULL;
        int local_flags = 0;
        int ret;
 
@@ -603,8 +604,17 @@ int main(int argc, char **argv)
 
        setup_logging("smbpasswd", DEBUG_STDERR);
 
-       if (server_messaging_context() == NULL) {
-               return 1;
+       msg_ctx = server_messaging_context();
+       if (msg_ctx == NULL) {
+               if (geteuid() != 0) {
+                       DBG_NOTICE("Unable to initialize messaging context. "
+                                  "Must be root to do that.\n");
+               } else {
+                       fprintf(stderr,
+                               "smbpasswd is not able to initialize the "
+                               "messaging context!\n");
+                       return 1;
+               }
        }
 
        /*


-- 
Samba Shared Repository

Reply via email to