From: Christof Schmitt Date: Tue, 24 Apr 2012 21:33:46 +0000 (-0700) Subject: net: Let get*sid return error from passdb init X-Git-Tag: samba-4.0.0alpha20~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=be8180e030ec922ae75b747c2bf4c5551740c404;p=thirdparty%2Fsamba.git net: Let get*sid return error from passdb init When initialize_password_db returns an error this means that the SID stored in the backend cannot be read. Return this error directly instead of creating a random SID through get_global_sam_sid. Autobuild-User: Volker Lendecke Autobuild-Date: Mon Apr 30 13:07:20 CEST 2012 on sn-devel-104 --- diff --git a/source3/utils/net.c b/source3/utils/net.c index 70ed0aa47a7..1ce5ee65823 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -247,8 +247,8 @@ static int net_getlocalsid(struct net_context *c, 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 knowledge (such as the sid stored in LDAP)\n")); + d_fprintf(stderr, _("WARNING: Could not open passdb\n")); + return 1; } /* first check to see if we can even access secrets, so we don't @@ -327,10 +327,8 @@ static int net_getdomainsid(struct net_context *c, 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 knowledge (such as the SID stored in " - "LDAP)\n")); + d_fprintf(stderr, _("WARNING: Could not open passdb\n")); + return 1; } /* first check to see if we can even access secrets, so we don't