BUG: https://bugzilla.samba.org/show_bug.cgi?id=12974
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Aug 18 14:01:27 CEST 2017 on sn-devel-144
int main(int argc, char **argv)
{
TALLOC_CTX *frame = talloc_stackframe();
+ struct messaging_context *msg_ctx = NULL;
int local_flags = 0;
int ret;
setup_logging("smbpasswd", DEBUG_STDERR);
- if (server_messaging_context() == NULL) {
- return 1;
+ msg_ctx = server_messaging_context();
+ if (msg_ctx == NULL) {
+ if (geteuid() != 0) {
+ DBG_NOTICE("Unable to initialize messaging context. "
+ "Must be root to do that.\n");
+ } else {
+ fprintf(stderr,
+ "smbpasswd is not able to initialize the "
+ "messaging context!\n");
+ return 1;
+ }
}
/*