summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net.c10
-rw-r--r--source3/utils/smbpasswd.c6
2 files changed, 16 insertions, 0 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c
index b9081c3e31..9026900e81 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -418,6 +418,11 @@ static int net_getlocalsid(int argc, const char **argv)
name = global_myname();
}
+ if(!initialize_password_db(False)) {
+ DEBUG(0, ("WARNING: Could not open passdb - local sid may not reflect passdb\n"
+ "backend knowlege (such as the sid stored in LDAP)\n"));
+ }
+
if (!secrets_fetch_domain_sid(name, &sid)) {
DEBUG(0, ("Can't fetch domain SID for name: %s\n", name));
return 1;
@@ -452,6 +457,11 @@ static int net_getdomainsid(int argc, const char **argv)
DOM_SID domain_sid;
fstring sid_str;
+ if(!initialize_password_db(False)) {
+ DEBUG(0, ("WARNING: Could not open passdb - domain sid may not reflect passdb\n"
+ "backend knowlege (such as the sid stored in LDAP)\n"));
+ }
+
if (!secrets_fetch_domain_sid(global_myname(), &domain_sid)) {
d_printf("Could not fetch local SID\n");
return 1;
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index 2f68d02ef6..0476a2e39c 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -349,6 +349,12 @@ static int process_root(int local_flags)
goto done;
}
+ /* Ensure passdb startup(). */
+ if(!initialize_password_db(False)) {
+ DEBUG(0, ("Failed to open passdb!\n"));
+ exit(1);
+ }
+
/* Ensure we have a SAM sid. */
get_global_sam_sid();