Created attachment 515623 [details]
Description of actual problem:
When Samba uses ldapsam backend it may be necessary to change "userpassword" and "sambantpassword" fields synchronously. But password changing in DSGW changes only "userpassword" field in Directory Server.
To allow this feature I've changed 2 files in the source code of DSGW:
1. I've added this definition to dsgw.h:
#define DSGW_ATTRTYPE_SAMBANTPASSWORD "sambaNTPassword"
2. I've changed domodify.c. Please look at the attachment.
DSGW with these modifications was tested and worked fine for Red Hat Directory Server 8.1.0-1 and Samba 3.0.33.
If this way of solving the problem is acceptable, it might be better to build this new feature in DSGW with more flex (allow switch it off and on through the configuration file).
The modification of domodify.c is based on the code of mkntpwd tool (the work of Anton Roeckseisen firstname.lastname@example.org) and also contains md4.c source from Samba source code.
We use the following to build our code:
CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic" configure --with-openldap ...
The -Wall causes these warnings (on RHEL6.1):
../dsgw.git/domodify.c: In function ‘getnthash’:
../dsgw.git/domodify.c:810: warning: pointer targets in passing argument 2 of ‘mdfour’ differ in signedness
../dsgw.git/domodify.c:57: note: expected ‘unsigned char *’ but argument is of type ‘char *’
../dsgw.git/domodify.c:812: warning: pointer targets in passing argument 1 of ‘PutBinHash2Hex’ differ in signedness
../dsgw.git/domodify.c:42: note: expected ‘char *’ but argument is of type ‘unsigned char *’
Please fix these warnings and update the patch. Thanks.
Closing this bug due to moving to the trac system.