Bug 726282

Summary: DSGW can't change "userpassword" and "sambantpassword" fields synchronously
Product: [Retired] 389 Reporter: Alexander Popov <alexandr.popov62>
Component: UI - Gateway/PhonebookAssignee: Rich Megginson <rmeggins>
Status: CLOSED WONTFIX QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: unspecified    
Version: 1.1.0CC: nhosoi
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-13 20:12:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
Changed domodify.c none

Description Alexander Popov 2011-07-28 04:32:02 UTC
Created attachment 515623 [details]
Changed domodify.c

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).

Additional info:
The modification of domodify.c is based on the code of mkntpwd tool (the work of Anton Roeckseisen anton) and also contains md4.c source from Samba source code.

Comment 2 Rich Megginson 2011-08-25 15:44:24 UTC
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.

Comment 3 Martin Kosek 2012-01-04 13:22:27 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/37

Comment 5 Noriko Hosoi 2015-11-13 20:12:19 UTC
Closing this bug due to moving to the trac system.

https://fedorahosted.org/389/ticket/37