summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/smbgroupedit.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source3/utils/smbgroupedit.c b/source3/utils/smbgroupedit.c
index cfa0dd8af9..04d46f4559 100644
--- a/source3/utils/smbgroupedit.c
+++ b/source3/utils/smbgroupedit.c
@@ -22,6 +22,7 @@
#include "includes.h"
extern pstring global_myname;
+extern pstring global_myworkgroup;
extern DOM_SID global_sam_sid;
/*
@@ -287,6 +288,18 @@ int main (int argc, char **argv)
dyn_CONFIGFILE);
exit(1);
}
+
+ if (!*global_myname) {
+ char *p;
+ pstrcpy( global_myname, myhostname() );
+ p = strchr_m(global_myname, '.' );
+ if (p)
+ *p = 0;
+ }
+
+ strupper(global_myname);
+
+ fstrcpy(global_myworkgroup, lp_workgroup());
if(!initialize_password_db(True)) {
fprintf(stderr, "Can't setup password database vectors.\n");
@@ -294,7 +307,7 @@ int main (int argc, char **argv)
}
if(pdb_generate_sam_sid()==False) {
- printf("Can not read machine SID\n");
+ fprintf(stderr, "Can not read machine SID\n");
return 0;
}