Bug 755622

Summary: password reset mode of chntpw does nothing
Product: [Fedora] Fedora Reporter: Stephane Adenot <stephane>
Component: chntpwAssignee: Conrad Meyer <cse.cem+redhatbugz>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: cse.cem+redhatbugz
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-19 01:46:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Stephane Adenot 2011-11-21 15:54:05 UTC
Description of problem:

Using chntpw for clearing a Windows password does nothing.

Version-Release number of selected component (if applicable):
chntpw-0.99.6-16.110511

How reproducible:
Always

Steps to Reproduce:
1. chntpw -u <user> <sam file>
2. select menu item 1 (clear user password)
3. type "y" (write sam file)
  
Actual results:
User password not cleared, sam file unchanged 

Expected results:
User password should have been cleared

Additional info:
This is due to a bug introduced by a patch named "chntpw-110511-robustness.patch".
Here is the patch to correct the above patch:

diff -r -U 3 chntpw-110511/ntreg.c chntpw-110511.new/ntreg.c
--- chntpw-110511/ntreg.c	2011-11-21 14:42:45.369173605 +0100
+++ chntpw-110511.new/ntreg.c	2011-11-21 14:43:38.045876946 +0100
@@ -197,7 +197,10 @@
    len = strlen(ibuf);
    
    if (len)
+   {
       ibuf[len-1] = 0;
+      --len;
+   }
    
    return len;
 }

Comment 1 Conrad Meyer 2011-12-19 01:23:29 UTC
Fixed and building in rawhide here:
http://koji.fedoraproject.org/koji/taskinfo?taskID=3591818

Comment 3 Fedora Update System 2011-12-19 09:25:11 UTC
chntpw-0.99.6-17.110511.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/chntpw-0.99.6-17.110511.fc15

Comment 4 Fedora Update System 2011-12-19 09:25:14 UTC
chntpw-0.99.6-17.110511.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/chntpw-0.99.6-17.110511.fc16

Comment 5 Fedora Update System 2011-12-30 00:57:26 UTC
chntpw-0.99.6-17.110511.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2011-12-30 00:59:29 UTC
chntpw-0.99.6-17.110511.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.