Bug 8087 - libwinbind wbcChangeUserPasswordEx in RESPONSE mode does not work
Summary: libwinbind wbcChangeUserPasswordEx in RESPONSE mode does not work
Alias: None
Product: Samba 3.5
Classification: Unclassified
Component: Winbind (show other bugs)
Version: 3.5.8
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
Depends on:
Reported: 2011-04-14 17:03 UTC by p.mayers
Modified: 2011-08-29 11:16 UTC (History)
1 user (show)

See Also:

Patch for 3.5 (2.68 KB, patch)
2011-04-15 06:42 UTC, Volker Lendecke
gd: review+

Note You need to log in before you can comment on or make changes to this bug.
Description p.mayers 2011-04-14 17:03:34 UTC
I'm trying to write a small C helper function to process MS-CHAP password change requests in FreeRADIUS.

The "quickest" (ha!) way of doing this seemed to be to hijack the libwbclient stuff.

When calling wbcChangeUserPasswordEx with WBC_CHANGE_PASSWORD_LEVEL_RESPONSE, it does the following, several times (lines 867-897 of nsswitch/libwbclient/wbc_pam.c):

 if (...data) {
   memcpy(dest->data, src->data, data->data_len);
   dest->data_len = src->data_len;

...this is obviously wrong - the memcpy needs to happen after the "len" assignment, else dest->data_len == 0 and it never copies any data.

There are other bugs in this code, which can segfault the winbind child; I'll open these separately.
Comment 1 Volker Lendecke 2011-04-15 06:42:09 UTC
Created attachment 6408 [details]
Patch for 3.5

This was already fixed in master with 03115efae89c8c4f51. The attached patch is the same with a different commit message.
Comment 2 Guenther Deschner 2011-05-23 13:31:55 UTC
Comment on attachment 6408 [details]
Patch for 3.5

looks good
Comment 3 Guenther Deschner 2011-05-23 13:32:20 UTC
Karolin, please add to 3.5
Comment 4 Karolin Seeger 2011-05-23 18:13:43 UTC
Pushed to v3-5-test.
Closing out bug report.