From 4a952fb0c0bb9d8ebb733b32f3f16596293b320b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 3 Oct 2007 12:55:45 +0000 Subject: r25481: Fix some typos, don't panic as non-root on net getdomainsid Thanks to Karolin Seeger (This used to be commit 5ae4b2739853e2cd91e839909eb868dbb56be431) --- source3/utils/net.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source3/utils/net.c') diff --git a/source3/utils/net.c b/source3/utils/net.c index 9c327f162d..88283ac145 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -625,7 +625,7 @@ static int net_getlocalsid(int argc, const char **argv) if(!initialize_password_db(False, NULL)) { DEBUG(0, ("WARNING: Could not open passdb - local sid may not reflect passdb\n" - "backend knowlege (such as the sid stored in LDAP)\n")); + "backend knowledge (such as the sid stored in LDAP)\n")); } /* first check to see if we can even access secrets, so we don't @@ -695,7 +695,16 @@ static int net_getdomainsid(int argc, const char **argv) if(!initialize_password_db(False, NULL)) { DEBUG(0, ("WARNING: Could not open passdb - domain sid may not reflect passdb\n" - "backend knowlege (such as the sid stored in LDAP)\n")); + "backend knowledge (such as the sid stored in LDAP)\n")); + } + + /* first check to see if we can even access secrets, so we don't + panic when we can't. */ + + if (!secrets_init()) { + d_fprintf(stderr, "Unable to open secrets.tdb. Can't fetch domain" + "SID for name: %s\n", get_global_sam_name()); + return 1; } /* Generate one, if it doesn't exist */ -- cgit