Removed save directory argument to become_root() calls. Probably most of
authorTim Potter <tpot@samba.org>
Fri, 23 Jun 2000 05:53:18 +0000 (05:53 +0000)
committerTim Potter <tpot@samba.org>
Fri, 23 Jun 2000 05:53:18 +0000 (05:53 +0000)
this stuff doesn't need to be done as root anyway.
(This used to be commit c3cad0ff6482784f95fd54ba51ee5be2354bb95d)

source3/rpc_server/srv_lookup.c
source3/rpc_server/srv_netlog.c
source3/rpc_server/srv_pipe.c
source3/rpc_server/srv_pipe_hnd.c
source3/rpc_server/srv_samr.c
source3/rpc_server/srv_util.c

index 274c68f18da56d4c731c2365a50da4f3f3469a5f..e81f3051f3dcccbb1ab8eb676a36582adf4d7736 100644 (file)
@@ -113,9 +113,9 @@ int make_dom_gids(DOMAIN_GRP *mem, int num_members, DOM_GID **ppgids)
                uint8  attr  = mem[count].attr;
                char   *name = mem[count].name;
 
                uint8  attr  = mem[count].attr;
                char   *name = mem[count].name;
 
-               become_root(True);
+               become_root();
                status = lookup_grp_rid(name, &rid, &type);
                status = lookup_grp_rid(name, &rid, &type);
-               unbecome_root(True);
+               unbecome_root();
 
                if (status == 0x0)
                {
 
                if (status == 0x0)
                {
@@ -344,9 +344,9 @@ uint32 lookup_user_name(uint32 rid, char *user_name, uint8 *type)
        DEBUG(5,("lookup_user_name: rid: %d", rid));
 
        /* find the user account */
        DEBUG(5,("lookup_user_name: rid: %d", rid));
 
        /* find the user account */
-       become_root(True);
+       become_root();
        disp_info = getsamdisprid(rid);
        disp_info = getsamdisprid(rid);
-       unbecome_root(True);
+       unbecome_root();
 
        if (disp_info != NULL)
        {
 
        if (disp_info != NULL)
        {
@@ -537,9 +537,9 @@ uint32 lookup_added_user_rids(char *user_name,
        (*grp_rid) = 0;
 
        /* find the user account */
        (*grp_rid) = 0;
 
        /* find the user account */
-       become_root(True);
+       become_root();
        sam_pass = getsam21pwnam(user_name);
        sam_pass = getsam21pwnam(user_name);
-       unbecome_root(True);
+       unbecome_root();
 
        if (sam_pass != NULL)
        {
 
        if (sam_pass != NULL)
        {
@@ -561,9 +561,9 @@ uint32 lookup_added_user_rid(char *user_name, uint32 *rid, uint8 *type)
        (*type) = SID_NAME_USER;
 
        /* find the user account */
        (*type) = SID_NAME_USER;
 
        /* find the user account */
-       become_root(True);
+       become_root();
        sam_pass = getsam21pwnam(user_name);
        sam_pass = getsam21pwnam(user_name);
-       unbecome_root(True);
+       unbecome_root();
 
        if (sam_pass != NULL)
        {
 
        if (sam_pass != NULL)
        {
index 80e9894b5909e06ffe9084e33b397487a7403b3c..7fe89f90b63575b612c053eb53489cda5e77d789 100644 (file)
@@ -284,9 +284,9 @@ static BOOL get_md4pw(char *md4pw, char *mach_name, char *mach_acct)
        }
 #endif /* 0 */
 
        }
 #endif /* 0 */
 
-       become_root(True);
+       become_root();
        smb_pass = getsmbpwnam(mach_acct);
        smb_pass = getsmbpwnam(mach_acct);
-       unbecome_root(True);
+       unbecome_root();
 
        if ((smb_pass) != NULL && !(smb_pass->acct_ctrl & ACB_DISABLED) &&
         (smb_pass->smb_nt_passwd != NULL))
 
        if ((smb_pass) != NULL && !(smb_pass->acct_ctrl & ACB_DISABLED) &&
         (smb_pass->smb_nt_passwd != NULL))
@@ -453,9 +453,9 @@ static BOOL api_net_srv_pwset(pipes_struct *p)
 
                DEBUG(3,("Server Password Set Wksta:[%s]\n", mach_acct));
 
 
                DEBUG(3,("Server Password Set Wksta:[%s]\n", mach_acct));
 
-               become_root(True);
+               become_root();
                smb_pass = getsmbpwnam(mach_acct);
                smb_pass = getsmbpwnam(mach_acct);
-               unbecome_root(True);
+               unbecome_root();
 
                if (smb_pass != NULL) {
                        unsigned char pwd[16];
 
                if (smb_pass != NULL) {
                        unsigned char pwd[16];
@@ -473,9 +473,9 @@ static BOOL api_net_srv_pwset(pipes_struct *p)
                        smb_pass->smb_nt_passwd = pwd;
                        smb_pass->acct_ctrl     = ACB_WSTRUST;
 
                        smb_pass->smb_nt_passwd = pwd;
                        smb_pass->acct_ctrl     = ACB_WSTRUST;
 
-                       become_root(True);
+                       become_root();
                        ret = mod_smbpwd_entry(smb_pass,False);
                        ret = mod_smbpwd_entry(smb_pass,False);
-                       unbecome_root(True);
+                       unbecome_root();
 
                        if (ret) {
                                /* hooray! */
 
                        if (ret) {
                                /* hooray! */
@@ -718,9 +718,9 @@ static BOOL api_net_sam_logon(pipes_struct *p)
          */
         pw=Get_Pwnam(nt_username, True);
         
          */
         pw=Get_Pwnam(nt_username, True);
         
-        become_root(True);
+        become_root();
         smb_pass = getsmbpwnam(nt_username);
         smb_pass = getsmbpwnam(nt_username);
-        unbecome_root(True);
+        unbecome_root();
         
         if (smb_pass == NULL)
             status = 0xC0000000 | NT_STATUS_NO_SUCH_USER;
         
         if (smb_pass == NULL)
             status = 0xC0000000 | NT_STATUS_NO_SUCH_USER;
index 46cb521018751834452f557c3ff50745e9ac85b2..a5d69efd7e8450366d9b37bc46c79f83b09503ff 100644 (file)
@@ -360,24 +360,24 @@ static BOOL api_pipe_ntlmssp_verify(pipes_struct *p, RPC_AUTH_NTLMSSP_RESP *ntlm
 
        if(!guest_user) {
 
 
        if(!guest_user) {
 
-               become_root(True);
+               become_root();
 
                if(!(p->ntlmssp_auth_validated = pass_check_smb(unix_user_name, domain,
                                      (uchar*)p->challenge, lm_owf, nt_owf, NULL))) {
                        DEBUG(1,("api_pipe_ntlmssp_verify: User %s\\%s from machine %s \
 failed authentication on named pipe %s.\n", domain, unix_user_name, wks, p->name ));
 
                if(!(p->ntlmssp_auth_validated = pass_check_smb(unix_user_name, domain,
                                      (uchar*)p->challenge, lm_owf, nt_owf, NULL))) {
                        DEBUG(1,("api_pipe_ntlmssp_verify: User %s\\%s from machine %s \
 failed authentication on named pipe %s.\n", domain, unix_user_name, wks, p->name ));
-                       unbecome_root(True);
+                       unbecome_root();
                        return False;
                }
 
                if(!(smb_pass = getsmbpwnam(unix_user_name))) {
                        DEBUG(1,("api_pipe_ntlmssp_verify: Cannot find user %s in smb passwd database.\n",
                                unix_user_name));
                        return False;
                }
 
                if(!(smb_pass = getsmbpwnam(unix_user_name))) {
                        DEBUG(1,("api_pipe_ntlmssp_verify: Cannot find user %s in smb passwd database.\n",
                                unix_user_name));
-                       unbecome_root(True);
+                       unbecome_root();
                        return False;
                }
 
                        return False;
                }
 
-               unbecome_root(True);
+               unbecome_root();
 
                if (smb_pass == NULL) {
                        DEBUG(1,("api_pipe_ntlmssp_verify: Couldn't find user '%s' in smb_passwd file.\n", 
 
                if (smb_pass == NULL) {
                        DEBUG(1,("api_pipe_ntlmssp_verify: Couldn't find user '%s' in smb_passwd file.\n", 
index e01ecf82a272201d91937767d3c1856e7807f969..b11c76b75deeab5177ae10f5ab1be394ef9596dc 100644 (file)
@@ -144,9 +144,9 @@ static void attempt_remote_rpc_connect(pipes_struct *p)
        make_creds_nt_sec(&usr.nts);
        */
 
        make_creds_nt_sec(&usr.nts);
        */
 
-       become_root(False); /* to connect to pipe */
+       become_root(); /* to connect to pipe */
        p->m = msrpc_use_add(p->name, sys_getpid(), &usr, False);
        p->m = msrpc_use_add(p->name, sys_getpid(), &usr, False);
-       unbecome_root(False);
+       unbecome_root();
 
        if (p->m == NULL)
                DEBUG(10,("attempt_remote_rpc_connect: msrpc redirect failed - using local implementation.\n"));
 
        if (p->m == NULL)
                DEBUG(10,("attempt_remote_rpc_connect: msrpc redirect failed - using local implementation.\n"));
index c1d0444b3692c52e9611b62fc4310d9a641e8097..50fe613e49d131b754ccff54ff53022490fcb090 100644 (file)
@@ -611,9 +611,9 @@ static BOOL samr_reply_enum_dom_users(SAMR_Q_ENUM_DOM_USERS *q_u,
 
        DEBUG(5,("samr_reply_enum_dom_users: %d\n", __LINE__));
 
 
        DEBUG(5,("samr_reply_enum_dom_users: %d\n", __LINE__));
 
-       become_root(True);
+       become_root();
        get_sampwd_entries(pass, 0, &total_entries, &num_entries, MAX_SAM_ENTRIES, q_u->acb_mask);
        get_sampwd_entries(pass, 0, &total_entries, &num_entries, MAX_SAM_ENTRIES, q_u->acb_mask);
-       unbecome_root(True);
+       unbecome_root();
 
        init_samr_r_enum_dom_users(&r_e, total_entries,
                                   q_u->unknown_0, num_entries,
 
        init_samr_r_enum_dom_users(&r_e, total_entries,
                                   q_u->unknown_0, num_entries,
@@ -852,9 +852,9 @@ static BOOL samr_reply_query_dispinfo(SAMR_Q_QUERY_DISPINFO *q_u, prs_struct *rd
 
          DEBUG(10,("samr_reply_query_dispinfo: Setting q_u->max_entries to %u\n",q_u->max_entries));
 
 
          DEBUG(10,("samr_reply_query_dispinfo: Setting q_u->max_entries to %u\n",q_u->max_entries));
 
-               become_root(True);
+               become_root();
                got_pwds = get_passwd_entries(pass, q_u->start_idx, &total_entries, &num_entries, q_u->max_entries, 0);
                got_pwds = get_passwd_entries(pass, q_u->start_idx, &total_entries, &num_entries, q_u->max_entries, 0);
-               unbecome_root(True);
+               unbecome_root();
 
                /* more left - set resume handle */
                if(total_entries > num_entries)
 
                /* more left - set resume handle */
                if(total_entries > num_entries)
@@ -1028,9 +1028,9 @@ static BOOL samr_reply_lookup_ids(SAMR_Q_LOOKUP_IDS *q_u,
                                            q_u->uni_user_name[i].uni_str_len));
 
                /* find the user account */
                                            q_u->uni_user_name[i].uni_str_len));
 
                /* find the user account */
-               become_root(True);
+               become_root();
                sam_pass = get_smb21pwd_entry(user_name, 0);
                sam_pass = get_smb21pwd_entry(user_name, 0);
-               unbecome_root(True);
+               unbecome_root();
 
                if (sam_pass == NULL)
                {
 
                if (sam_pass == NULL)
                {
@@ -1374,9 +1374,9 @@ static BOOL samr_reply_open_user(SAMR_Q_OPEN_USER *q_u, prs_struct *rdata, int s
                r_u.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
        }
 
                r_u.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_NOT_FOUND;
        }
 
-       become_root(True);
+       become_root();
        sam_pass = getsam21pwrid(q_u->user_rid);
        sam_pass = getsam21pwrid(q_u->user_rid);
-       unbecome_root(True);
+       unbecome_root();
 
        /* check that the RID exists in our domain. */
        if (r_u.status == 0x0 && sam_pass == NULL)
 
        /* check that the RID exists in our domain. */
        if (r_u.status == 0x0 && sam_pass == NULL)
@@ -1441,9 +1441,9 @@ static BOOL get_user_info_10(SAM_USER_INFO_10 *id10, uint32 user_rid)
                return False;
        }
 
                return False;
        }
 
-       become_root(True);
+       become_root();
        smb_pass = getsmbpwrid(user_rid);
        smb_pass = getsmbpwrid(user_rid);
-       unbecome_root(True);
+       unbecome_root();
 
        if (smb_pass == NULL)
        {
 
        if (smb_pass == NULL)
        {
@@ -1474,9 +1474,9 @@ static BOOL get_user_info_21(SAM_USER_INFO_21 *id21, uint32 user_rid)
                return False;
        }
 
                return False;
        }
 
-       become_root(True);
+       become_root();
        sam_pass = getsam21pwrid(user_rid);
        sam_pass = getsam21pwrid(user_rid);
-       unbecome_root(True);
+       unbecome_root();
 
        if (sam_pass == NULL)
        {
 
        if (sam_pass == NULL)
        {
@@ -1669,9 +1669,9 @@ static BOOL samr_reply_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u,
 
        if (status == 0x0)
        {
 
        if (status == 0x0)
        {
-               become_root(True);
+               become_root();
                sam_pass = getsam21pwrid(rid);
                sam_pass = getsam21pwrid(rid);
-               unbecome_root(True);
+               unbecome_root();
 
                if (sam_pass == NULL)
                {
 
                if (sam_pass == NULL)
                {
@@ -1859,9 +1859,9 @@ static BOOL api_samr_unknown_32(pipes_struct *p)
        fstrcpy(mach_acct, dos_unistrn2(q_u.uni_mach_acct.buffer,
                                    q_u.uni_mach_acct.uni_str_len));
 
        fstrcpy(mach_acct, dos_unistrn2(q_u.uni_mach_acct.buffer,
                                    q_u.uni_mach_acct.uni_str_len));
 
-       become_root(True);
+       become_root();
        sam_pass = getsam21pwnam(mach_acct);
        sam_pass = getsam21pwnam(mach_acct);
-       unbecome_root(True);
+       unbecome_root();
 
        if (sam_pass != NULL)
        {
 
        if (sam_pass != NULL)
        {
index 8264741db0d0d018ed6c01da1bb2b431ff2dada2..a1f2a7c085662ee40ae2fa3795492a0d2c3c7e30 100644 (file)
@@ -270,9 +270,9 @@ uint32 lookup_user_name(uint32 rid, char *user_name, uint32 *type)
        }
 
        /* ok, it's a user.  find the user account */
        }
 
        /* ok, it's a user.  find the user account */
-       become_root(True);
+       become_root();
        disp_info = getsamdisprid(rid);
        disp_info = getsamdisprid(rid);
-       unbecome_root(True);
+       unbecome_root();
 
        if (disp_info != NULL)
        {
 
        if (disp_info != NULL)
        {
@@ -332,9 +332,9 @@ uint32 lookup_user_rid(char *user_name, uint32 *rid)
        (*rid) = 0;
 
        /* find the user account */
        (*rid) = 0;
 
        /* find the user account */
-       become_root(True);
+       become_root();
        sam_pass = getsam21pwnam(user_name);
        sam_pass = getsam21pwnam(user_name);
-       unbecome_root(True);
+       unbecome_root();
 
        if (sam_pass != NULL)
        {
 
        if (sam_pass != NULL)
        {