The Samba-Bugzilla – Bug 7417
Error while changing password with the net utility
Last modified: 2010-05-11 07:48:31 UTC
Hello, there is an error while changing passwords with the net utility, if used like this:
net rpc -U administrator user <username> password <newpassword>
you get a prompt for the administrator's password and everything works.
But when used in this other form:
net rpc -U administrator user <username> password
you get two prompts, one for the new password for <username> and the other for the administrator's password, and the password that is set as new password is the password you provided for authentication proposes (the one for the administrator account).
I have debugged the program and track the bug down to source3/utils/net_rpc.c:rpc_user_password:765,
status = NetUserSetInfo(c->opt_host, argv, 1003, (uint8_t *)&u1003, &parm_err);
before this line the variable u1003.usri1003_password holds the value of the new password but when the call to NetUserSetInfo returns this same variable holds the value of the administrator's password.
When the command is used in the first form the variable u1003.usri1003_password holds the value of the new password even after this line returns.
I think something along the way is rewriting the value of this structure but inside that function, things get a bit too cryptic for my knowledge.
Sorry i could not provide a patch for this, but i can provided testing for it if needed. If anything was missing in this bug report please net me know.
most probably my bug, looking...
Created attachment 5687 [details]
patch for master
Can you please try this patch ?
Confirming that the patch solved the problem. Thanks a lot.
ok, reopening so that we can track shipping the fix.
Created attachment 5688 [details]
patch for 3.4
Created attachment 5689 [details]
patch for 3.5
Karolin, please pick the two patches for release.
(In reply to comment #6)
> Created an attachment (id=5689) [details]
> patch for 3.5
Pushed to v3-5-test.
Will be included in 3.5.3.
(In reply to comment #5)
> Created an attachment (id=5688) [details]
> patch for 3.4
Unfortunately too late for 3.4.8.
Will be included in the next 3.4 release.
(In reply to comment #9)
> (In reply to comment #5)
> > Created an attachment (id=5688) [details] [details]
> > patch for 3.4
> Unfortunately too late for 3.4.8.
> Will be included in the next 3.4 release.
Pushed to v3-4-test.
Closing out bug report.