Bug 1645886

Summary: chntpw fails to read any files
Product: [Fedora] Fedora Reporter: Jia Yuan Lo <jylo06g>
Component: chntpwAssignee: Conrad Meyer <cse.cem+redhatbugz>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: alan, bloch, cse.cem+redhatbugz, emmanuel.franquemagne, osamarin68, ozeszty+rhbz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: chntpw-1.00-4.140201.fc30 chntpw-1.00-4.140201.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-13 01:06:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch of reading Hive none

Description Jia Yuan Lo 2018-11-04 16:56:46 UTC
Description of problem:
chntpw fails to read anything, be it Windows SAM files or any files

Version-Release number of selected component (if applicable): 1.00.140201

How reproducible: Always

Steps to Reproduce:
1. cd /path/to/SYSTEM
2. chntpw -e SYSTEM
3. fail to read file

Actual results (any files):
chntpw version 1.00 140201, (c) Petter N Hagen
openHive(): read error: : No such file or directory
chntpw: Unable to open/read a hive, exiting..


Expected results (SAM files):
chntpw version 0.99.6 110511 , (c) Petter N Hagen
Hive </path/to/SYSTEM> name (from header): <SYSTEM>
ROOT KEY at offset: 0x001020 * Subkey indexing type is: 686c <lh>
File size 18350080 [1180000] bytes, containing 3917 pages (+ 1 headerpage)
Used for data: 280256/18177568 blocks/bytes, unused: 140/22592 blocks/bytes.

Simple registry editor. ? for help.

> 


Expected results (other files):
chntpw version 0.99.6 110511 , (c) Petter N Hagen
openHive(/home/jylo/.bash_history): File does not seem to be a registry hive!
Simple registry editor. ? for help.
get_abs_path: Not a 'nk' node!

> 


Additional info:
0.99 still works fine for reading win10-1803, but not 1.00...

Note that chntpw can tell the difference between a folder and a file, but can't seem to read ANY file...

Comment 1 Emmanuel Franquemagne 2018-12-17 23:42:47 UTC
Exactly the same issue.

Comment 2 Conrad Meyer 2019-04-19 20:00:42 UTC
*** Bug 1701597 has been marked as a duplicate of this bug. ***

Comment 3 Oleg Samarin 2019-06-22 15:20:28 UTC
Created attachment 1583483 [details]
Patch of reading Hive

Please try this patch. It is working for me

Comment 4 Conrad Meyer 2019-06-22 20:19:58 UTC
Thanks for pointing out the problem Oleg.  I see the mistake now.  I think I would do something slightly different and also check for r == 0, but the patch looks mostly good to me.

Comment 5 Conrad Meyer 2019-06-22 20:24:28 UTC
Rawhide: https://koji.fedoraproject.org/koji/taskinfo?taskID=35735984

Comment 7 Fedora Update System 2019-06-22 21:16:24 UTC
FEDORA-2019-03f92e73ee has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-03f92e73ee

Comment 8 Fedora Update System 2019-06-23 00:55:23 UTC
chntpw-1.00-4.140201.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-03f92e73ee

Comment 9 Fedora Update System 2019-06-23 11:45:38 UTC
chntpw-1.00-4.140201.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-b2e5df19a8

Comment 10 Oleg Samarin 2019-06-27 06:27:14 UTC
Conrad, I couldn't find the sourcecode repository of chntpw. Where is it?

Comment 11 Conrad Meyer 2019-06-27 06:46:12 UTC
Oleg, I don’t know of one.

Comment 12 Conrad Meyer 2019-06-27 06:50:28 UTC
Or do you mean the rpm spec repository? That’s here: https://src.fedoraproject.org/rpms/chntpw/commits/master

Comment 13 Fedora Update System 2019-07-13 01:06:17 UTC
chntpw-1.00-4.140201.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2019-07-13 01:24:03 UTC
chntpw-1.00-4.140201.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.