summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-02-25 23:12:29 +0000
committerAndrew Bartlett <abartlet@samba.org>2004-02-25 23:12:29 +0000
commit9e2a098a0abed616d2db4fba2847083b7e118f3f (patch)
tree0d7ce193f5bdf9ca73c39fe5c4d8bcf9d7b3b50f /source3
parent56bd63b1cde5e1bde8f88b0c6a06f1131f1dac13 (diff)
downloadsamba-9e2a098a0abed616d2db4fba2847083b7e118f3f.tar.gz
samba-9e2a098a0abed616d2db4fba2847083b7e118f3f.tar.bz2
samba-9e2a098a0abed616d2db4fba2847083b7e118f3f.zip
Fix bug in previous global_sam_sid() commit. I broke the 'read from
MACHINE.SID' file functionality. Also, before we print out the results of 'net getlocalsid' and 'net getdomainsid', ensure we have tried to read that file, or have generated one. Andrew Bartlett (This used to be commit 191b43159e7358541be9a3deac8c447885145442)
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/machine_sid.c1
-rw-r--r--source3/utils/net.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/source3/passdb/machine_sid.c b/source3/passdb/machine_sid.c
index f52e7116b0..47b9e2d487 100644
--- a/source3/passdb/machine_sid.c
+++ b/source3/passdb/machine_sid.c
@@ -163,7 +163,6 @@ static DOM_SID *pdb_generate_sam_sid(void)
/* Stored the old sid from MACHINE.SID successfully.*/
SAFE_FREE(fname);
- SAFE_FREE(sam_sid);
return sam_sid;
}
diff --git a/source3/utils/net.c b/source3/utils/net.c
index 9026900e81..01f56b8a0c 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -423,6 +423,9 @@ static int net_getlocalsid(int argc, const char **argv)
"backend knowlege (such as the sid stored in LDAP)\n"));
}
+ /* Generate one, if it doesn't exist */
+ get_global_sam_sid();
+
if (!secrets_fetch_domain_sid(name, &sid)) {
DEBUG(0, ("Can't fetch domain SID for name: %s\n", name));
return 1;
@@ -462,6 +465,9 @@ static int net_getdomainsid(int argc, const char **argv)
"backend knowlege (such as the sid stored in LDAP)\n"));
}
+ /* Generate one, if it doesn't exist */
+ get_global_sam_sid();
+
if (!secrets_fetch_domain_sid(global_myname(), &domain_sid)) {
d_printf("Could not fetch local SID\n");
return 1;