Bug 7417 - Error while changing password with the net utility
Summary: Error while changing password with the net utility
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.4
Classification: Unclassified
Component: Client Tools (show other bugs)
Version: 3.4.7
Hardware: x86 Linux
: P3 critical
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-07 12:41 UTC by Carlos Ramos
Modified: 2010-05-11 07:48 UTC (History)
1 user (show)

See Also:


Attachments
patch for master (953 bytes, patch)
2010-05-07 19:18 UTC, Guenther Deschner
no flags Details
patch for 3.4 (1.05 KB, patch)
2010-05-10 03:42 UTC, Guenther Deschner
vl: review+
Details
patch for 3.5 (1022 bytes, patch)
2010-05-10 03:44 UTC, Guenther Deschner
vl: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Ramos 2010-05-07 12:41:52 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[0], 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.

Thanks.
Comment 1 Guenther Deschner 2010-05-07 19:02:29 UTC
most probably my bug, looking...
Comment 2 Guenther Deschner 2010-05-07 19:18:40 UTC
Created attachment 5687 [details]
patch for master

Can you please try this patch ?
Comment 3 Carlos Ramos 2010-05-09 22:20:47 UTC
Confirming that the patch solved the problem. Thanks a lot.
Comment 4 Guenther Deschner 2010-05-10 03:41:59 UTC
ok, reopening so that we can track shipping the fix.
Comment 5 Guenther Deschner 2010-05-10 03:42:41 UTC
Created attachment 5688 [details]
patch for 3.4
Comment 6 Guenther Deschner 2010-05-10 03:44:21 UTC
Created attachment 5689 [details]
patch for 3.5
Comment 7 Volker Lendecke 2010-05-10 07:16:25 UTC
Karolin, please pick the two patches for release.

Thanks,

Volker
Comment 8 Karolin Seeger 2010-05-10 08:26:28 UTC
(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.
Comment 9 Karolin Seeger 2010-05-10 08:27:24 UTC
(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.
Comment 10 Karolin Seeger 2010-05-11 07:48:31 UTC
(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.

Thanks!