diff options
author | Jean-François Micouleau <jfm@samba.org> | 2002-04-16 15:49:24 +0000 |
---|---|---|
committer | Jean-François Micouleau <jfm@samba.org> | 2002-04-16 15:49:24 +0000 |
commit | 7a661ac63c674472cf808d46bf48ea45a99e2041 (patch) | |
tree | c4efc500348e526739c67cb239291a9cd4f5531b | |
parent | 4fd802c444eac0e4ef270d35e6675d7a8f1de57f (diff) | |
download | samba-7a661ac63c674472cf808d46bf48ea45a99e2041.tar.gz samba-7a661ac63c674472cf808d46bf48ea45a99e2041.tar.bz2 samba-7a661ac63c674472cf808d46bf48ea45a99e2041.zip |
we did not initialise global_myname and global_myworkgroup which lead to
duplicate entries in secrets.tdb and false SID generated.
took me *hours* to understand.
J.F.
(This used to be commit bfc3a25b776a5a66e1bd0e2c60c101cea87ef4d5)
-rw-r--r-- | source3/utils/smbgroupedit.c | 15 |
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; } |