]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r21831: Back out r21823 for a while, this is going into a bzr tree first.
authorVolker Lendecke <vlendec@samba.org>
Tue, 13 Mar 2007 20:53:38 +0000 (20:53 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:18:37 +0000 (12:18 -0500)
Volker

source/include/secrets.h
source/libads/util.c
source/libsmb/trusts_util.c
source/passdb/secrets.c
source/utils/net.c
source/utils/net_domain.c
source/utils/net_rpc_join.c

index cd8396ca7a3082c9dbcab93aa15927fb304ceb20..610a14b52be628f0ff08db940ab2f1492a4d49d2 100644 (file)
@@ -26,7 +26,6 @@
 */
 #define SECRETS_MACHINE_ACCT_PASS "SECRETS/$MACHINE.ACC"
 #define SECRETS_MACHINE_PASSWORD "SECRETS/MACHINE_PASSWORD"
-#define SECRETS_MACHINE_ACCOUNTNAME "SECRETS/MACHINE_ACCOUNTNAME"
 #define SECRETS_MACHINE_LAST_CHANGE_TIME "SECRETS/MACHINE_LAST_CHANGE_TIME"
 #define SECRETS_MACHINE_SEC_CHANNEL_TYPE "SECRETS/MACHINE_SEC_CHANNEL_TYPE"
 #define SECRETS_MACHINE_TRUST_ACCOUNT_NAME "SECRETS/SECRETS_MACHINE_TRUST_ACCOUNT_NAME"
index 669ed7d14168090a00b9491f7d5fb655e5320ec0..eb6dccb3afdbae1960910b099b82383e6a3fe4ff 100644 (file)
@@ -42,9 +42,7 @@ ADS_STATUS ads_change_trust_account_password(ADS_STRUCT *ads, char *host_princip
                goto failed;
        }
 
-       if (!secrets_store_machine_password(new_password, global_myname(),
-                                           lp_workgroup(),
-                                           sec_channel_type)) {
+       if (!secrets_store_machine_password(new_password, lp_workgroup(), sec_channel_type)) {
                DEBUG(1,("Failed to save machine password\n"));
                ret = ADS_ERROR_SYSTEM(EACCES);
                goto failed;
index 3460f2c47cb3bf092d0cde27254d98ba61dcacdb..e4061883eb1f96c3064040e8e4412298b11a37ff 100644 (file)
@@ -104,10 +104,7 @@ NTSTATUS trust_pw_change_and_store_it(struct rpc_pipe_client *cli, TALLOC_CTX *m
                 * Return the result of trying to write the new password
                 * back into the trust account file.
                 */
-               if (!secrets_store_machine_password(new_trust_passwd,
-                                                   global_myname(),
-                                                   domain,
-                                                   sec_channel_type)) {
+               if (!secrets_store_machine_password(new_trust_passwd, domain, sec_channel_type)) {
                        nt_status = NT_STATUS_UNSUCCESSFUL;
                }
        }
index 21a55b09a09efce5f9420026986c388ccc6dbd42..15c79745a0e70d399934f41453c37bdf122dd01c 100644 (file)
@@ -553,10 +553,7 @@ BOOL secrets_store_trusted_domain_password(const char* domain, const char* pwd,
 the password is assumed to be a null terminated ascii string
 ************************************************************************/
 
-BOOL secrets_store_machine_password(const char *pass,
-                                   const char *accountname,
-                                   const char *domain,
-                                   uint32 sec_channel)
+BOOL secrets_store_machine_password(const char *pass, const char *domain, uint32 sec_channel)
 {
        char *key = NULL;
        BOOL ret = False;
@@ -584,22 +581,6 @@ BOOL secrets_store_machine_password(const char *pass,
                goto fail;
        }
        
-       if (asprintf(&key, "%s/%s", SECRETS_MACHINE_ACCOUNTNAME,
-                    domain) == -1) {
-               DEBUG(5, ("asprintf failed\n"));
-               goto fail;
-       }
-       strupper_m(key);
-
-       ret = secrets_store(key, accountname, strlen(accountname)+1);
-       SAFE_FREE(key);
-
-       if (!ret) {
-               DEBUG(5, ("secrets_store failed: %s\n",
-                         tdb_errorstr(tdb)));
-               goto fail;
-       }
-       
        if (asprintf(&key, "%s/%s", SECRETS_MACHINE_LAST_CHANGE_TIME,
                     domain) == -1) {
                DEBUG(5, ("asprintf failed\n"));
index acd7bfb797f403f0289b902b0447ef292f2f6a86..5a9b7d31ec5617992caa8163e28b4d3a8325cbb0 100644 (file)
@@ -555,9 +555,7 @@ static int net_changesecretpw(int argc, const char **argv)
 
                trust_pw = get_pass("Enter machine password: ", opt_stdin);
 
-               if (!secrets_store_machine_password(trust_pw, global_myname(),
-                                                   lp_workgroup(),
-                                                   sec_channel_type)) {
+               if (!secrets_store_machine_password(trust_pw, lp_workgroup(), sec_channel_type)) {
                            d_fprintf(stderr, "Unable to write the machine account password in the secrets database");
                            return 1;
                }
index 186cb9e8c00d0056eeb763454e09148f1db585d2..4f7bc8ddecde48223c70f5b539819db75900a25c 100644 (file)
@@ -146,8 +146,7 @@ int netdom_store_machine_account( const char *domain, DOM_SID *sid, const char *
                return -1;
        }
 
-       if (!secrets_store_machine_password(pw, global_myname(), domain,
-                                           SEC_CHAN_WKSTA)) {
+       if (!secrets_store_machine_password(pw, domain, SEC_CHAN_WKSTA)) {
                DEBUG(1,("Failed to save machine password\n"));
                return -1;
        }
index 01973d2635b2231aff2064d985052925ea552136..ba3c61901265deb2d7b83c05856800c8eedf803b 100644 (file)
@@ -400,9 +400,7 @@ int net_rpc_join_newstyle(int argc, const char **argv)
                goto done;
        }
 
-       if (!secrets_store_machine_password(clear_trust_password,
-                                           global_myname(), domain,
-                                           sec_channel_type)) {
+       if (!secrets_store_machine_password(clear_trust_password, domain, sec_channel_type)) {
                DEBUG(0, ("error storing plaintext domain secrets for %s\n", domain));
        }