From f7ea1fbcfea390fc34b6058a2a82238a294dc4f5 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Mon, 13 Oct 2008 01:53:28 +0000 Subject: [PATCH 01/65] Initialize branch F-10 for chntpw --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..dc32377 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +F-10 From f508414863906865fc91a934f9ad898fa9306ec6 Mon Sep 17 00:00:00 2001 From: konradm Date: Mon, 13 Oct 2008 03:00:24 +0000 Subject: [PATCH 02/65] Import. --- .cvsignore | 1 + chntpw-README.Dist | 4 ++ chntpw-chntpw.8 | 96 ++++++++++++++++++++++++++++++++++++++++++++++ chntpw.spec | 76 ++++++++++++++++++++++++++++++++++++ import.log | 1 + sources | 1 + 6 files changed, 179 insertions(+) create mode 100644 chntpw-README.Dist create mode 100644 chntpw-chntpw.8 create mode 100644 chntpw.spec create mode 100644 import.log diff --git a/.cvsignore b/.cvsignore index e69de29..94616b3 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +chntpw-source-080526.zip diff --git a/chntpw-README.Dist b/chntpw-README.Dist new file mode 100644 index 0000000..f1dee08 --- /dev/null +++ b/chntpw-README.Dist @@ -0,0 +1,4 @@ +cpnt is depricated now (I think) because of ntfs-3g. Furthermore +reged is probably less useful than regedit.exe under WINE, but +as both of these might be useful for someone trying to run some +old script it's probably worthwhile to include them both. diff --git a/chntpw-chntpw.8 b/chntpw-chntpw.8 new file mode 100644 index 0000000..8b0ec85 --- /dev/null +++ b/chntpw-chntpw.8 @@ -0,0 +1,96 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH CHNTPW 8 "30th May 2002" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +chntpw \- utility to overwrite Windows NT/2000 SAM passwords +.SH SYNOPSIS +.B chntpw +.RI [ options ] +.RI < samfile > +.RI [ systemfile ] +.RI [ securityfile ] +.RI [ otherreghive ] +.RI [...] +.br +.SH DESCRIPTION +This manual page documents briefly the +.B chntpw +command. +This manual page was written for the Debian distribution +because the original program does not have a manual page. +.PP +.B chntpw +is a utility to view some information and change user passwords +in a Windows NT/2000 SAM userdatabase file. It is not necessary to +know the old passwords to reset them. In addition it contains a +simple registry editor (same size data writes) +and hex-editor with which the information contained in a registry +file can be browsed and modified. +.SH OPTIONS +.TP +.B \-h +Show summary of options. +.TP +.B \-u username +Username to change. Default is Administrator +.TP +.B \-l +List all users in the SAM database. +.TP +.B \-i +Interactive: list all users (as per \-l) and then ask for the +user to change. +.TP +.B \-e +Registry editor with limited capabilities. +.TP +.B \-d +Use buffer debugger. +.TP +.B \-t +Show hexdumps of structs/segments (deprecated debug function). +.SH EXAMPLES +.TP +.B chntpw sam system +Opens registry hives +.B sam +and +.B system +and change administrator account. This will work even if the name +has been changed or it has been localized (since different language +versions of NT use different administrator names). +.TP +.B chntpw -u jabbathehutt mysam +Prompts for password for +.B jabbathehutt +and changes it in the +.B mysam +registry file, if found (otherwise do nothing) +.SH SEE ALSO +If you are looking for an automated procedure for password +recovery, you might look at the bootdisks provided by the +upstream author at +.BR http://home.eunet.no/~pnordahl/ntpasswd/ +.br +There is more information on how this program works available at +.IR /usr/share/doc/chntpw . +This information includes in-depth information on how the +registry works, what are syskeys and some other issues. +.SH AUTHOR +This manual page was written by +Javier Fernandez-Sanguino , +for the Debian GNU/Linux system (but may be used by others). diff --git a/chntpw.spec b/chntpw.spec new file mode 100644 index 0000000..6e229dc --- /dev/null +++ b/chntpw.spec @@ -0,0 +1,76 @@ +Name: chntpw +# Version is taken from HISTORY.txt +Version: 0.99.6 +Release: 4%{?dist} +Summary: Change passwords in Windows SAM files +Group: Applications/Engineering +License: GPLv2 +URL: http://home.eunet.no/~pnordahl/ntpasswd/ +Source0: http://home.eunet.no/~pnordahl/ntpasswd/chntpw-source-080526.zip +Source2: chntpw-README.Dist +# The man page is borrowed from Debian +Source3: chntpw-chntpw.8 +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: dos2unix +BuildRequires: openssl-devel + + +%description +This is a utility to (re)set the password of any user that has a valid +(local) account on your Windows NT/2k/XP/Vista etc system. You do not +need to know the old password to set a new one. It works offline, that +is, you have to shutdown your computer and boot off a floppydisk or CD +or another system. Will detect and offer to unlock locked or disabled +out user accounts! There is also a registry editor and other registry +utilities that works under linux/unix, and can be used for other things +than password editing. + + +%prep +%setup -q -n %{name}-080526 +cp -p %{SOURCE2} README.Dist +dos2unix WinReg.txt + + +%build +make CC="%__cc" CFLAGS="$RPM_OPT_FLAGS" LIBS="-lcrypto" chntpw cpnt reged + + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{_bindir} +cp chntpw $RPM_BUILD_ROOT%{_bindir} +cp cpnt $RPM_BUILD_ROOT%{_bindir} +cp reged $RPM_BUILD_ROOT%{_bindir} +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8/ +cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_mandir}/man8/%{name}.8 + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc GPL.txt LGPL.txt README.txt regedit.txt WinReg.txt HISTORY.txt +%doc README.Dist +%{_bindir}/chntpw +%{_bindir}/cpnt +%{_bindir}/reged +%{_mandir}/man8/%{name}.8* + + +%changelog +* Sat Oct 11 2008 Conrad Meyer - 0.99.6-4 +- Fix EOL encodings in WinReg.txt. + +* Sat Oct 11 2008 Conrad Meyer - 0.99.6-3 +- More miscellaneous small changes. + +* Fri Oct 10 2008 Conrad Meyer - 0.99.6-2 +- Revert to original Makefile. +- Miscellaneous small changes. + +* Wed Oct 1 2008 Conrad Meyer - 0.99.6-1 +- Initial package. diff --git a/import.log b/import.log new file mode 100644 index 0000000..aff7d5f --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +chntpw-0_99_6-4_fc9:HEAD:chntpw-0.99.6-4.fc9.src.rpm:1223863802 diff --git a/sources b/sources index e69de29..954d9c8 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +09addfe7ae469677da39ed66d83858d3 chntpw-source-080526.zip From 3ed22faf5c3ebdb00e90cb73da96863aceefe159 Mon Sep 17 00:00:00 2001 From: konradm Date: Mon, 13 Oct 2008 04:35:51 +0000 Subject: [PATCH 03/65] Add final suggestions as per review --- chntpw.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chntpw.spec b/chntpw.spec index 6e229dc..34a3349 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -12,7 +12,6 @@ Source2: chntpw-README.Dist Source3: chntpw-chntpw.8 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: dos2unix BuildRequires: openssl-devel @@ -30,7 +29,9 @@ than password editing. %prep %setup -q -n %{name}-080526 cp -p %{SOURCE2} README.Dist -dos2unix WinReg.txt +sed -e 's/\r$//' WinReg.txt > WinReg.txt.eol +touch -c -r WinReg.txt WinReg.txt.eol +mv WinReg.txt.eol WinReg.txt %build From be6f4ffbd25ee35c5e7487c17d3cee879ed254de Mon Sep 17 00:00:00 2001 From: konradm Date: Mon, 13 Oct 2008 04:56:33 +0000 Subject: [PATCH 04/65] Fuck this I want force-tag back --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 34a3349..37062ed 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -63,6 +63,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sun Oct 11 2008 Conrad Meyer - 0.99.6-5 +- Bump because force-tag was removed. Please add it back. + * Sat Oct 11 2008 Conrad Meyer - 0.99.6-4 - Fix EOL encodings in WinReg.txt. From 7e253ca63a321fade283d4e343227c773901e316 Mon Sep 17 00:00:00 2001 From: konradm Date: Mon, 13 Oct 2008 05:12:39 +0000 Subject: [PATCH 05/65] Copy rawhide to release branch --- .cvsignore | 1 + chntpw-README.Dist | 4 ++ chntpw-chntpw.8 | 96 ++++++++++++++++++++++++++++++++++++++++++++++ chntpw.spec | 80 ++++++++++++++++++++++++++++++++++++++ sources | 1 + 5 files changed, 182 insertions(+) create mode 100644 chntpw-README.Dist create mode 100644 chntpw-chntpw.8 create mode 100644 chntpw.spec diff --git a/.cvsignore b/.cvsignore index e69de29..94616b3 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +chntpw-source-080526.zip diff --git a/chntpw-README.Dist b/chntpw-README.Dist new file mode 100644 index 0000000..f1dee08 --- /dev/null +++ b/chntpw-README.Dist @@ -0,0 +1,4 @@ +cpnt is depricated now (I think) because of ntfs-3g. Furthermore +reged is probably less useful than regedit.exe under WINE, but +as both of these might be useful for someone trying to run some +old script it's probably worthwhile to include them both. diff --git a/chntpw-chntpw.8 b/chntpw-chntpw.8 new file mode 100644 index 0000000..8b0ec85 --- /dev/null +++ b/chntpw-chntpw.8 @@ -0,0 +1,96 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH CHNTPW 8 "30th May 2002" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +chntpw \- utility to overwrite Windows NT/2000 SAM passwords +.SH SYNOPSIS +.B chntpw +.RI [ options ] +.RI < samfile > +.RI [ systemfile ] +.RI [ securityfile ] +.RI [ otherreghive ] +.RI [...] +.br +.SH DESCRIPTION +This manual page documents briefly the +.B chntpw +command. +This manual page was written for the Debian distribution +because the original program does not have a manual page. +.PP +.B chntpw +is a utility to view some information and change user passwords +in a Windows NT/2000 SAM userdatabase file. It is not necessary to +know the old passwords to reset them. In addition it contains a +simple registry editor (same size data writes) +and hex-editor with which the information contained in a registry +file can be browsed and modified. +.SH OPTIONS +.TP +.B \-h +Show summary of options. +.TP +.B \-u username +Username to change. Default is Administrator +.TP +.B \-l +List all users in the SAM database. +.TP +.B \-i +Interactive: list all users (as per \-l) and then ask for the +user to change. +.TP +.B \-e +Registry editor with limited capabilities. +.TP +.B \-d +Use buffer debugger. +.TP +.B \-t +Show hexdumps of structs/segments (deprecated debug function). +.SH EXAMPLES +.TP +.B chntpw sam system +Opens registry hives +.B sam +and +.B system +and change administrator account. This will work even if the name +has been changed or it has been localized (since different language +versions of NT use different administrator names). +.TP +.B chntpw -u jabbathehutt mysam +Prompts for password for +.B jabbathehutt +and changes it in the +.B mysam +registry file, if found (otherwise do nothing) +.SH SEE ALSO +If you are looking for an automated procedure for password +recovery, you might look at the bootdisks provided by the +upstream author at +.BR http://home.eunet.no/~pnordahl/ntpasswd/ +.br +There is more information on how this program works available at +.IR /usr/share/doc/chntpw . +This information includes in-depth information on how the +registry works, what are syskeys and some other issues. +.SH AUTHOR +This manual page was written by +Javier Fernandez-Sanguino , +for the Debian GNU/Linux system (but may be used by others). diff --git a/chntpw.spec b/chntpw.spec new file mode 100644 index 0000000..37062ed --- /dev/null +++ b/chntpw.spec @@ -0,0 +1,80 @@ +Name: chntpw +# Version is taken from HISTORY.txt +Version: 0.99.6 +Release: 5%{?dist} +Summary: Change passwords in Windows SAM files +Group: Applications/Engineering +License: GPLv2 +URL: http://home.eunet.no/~pnordahl/ntpasswd/ +Source0: http://home.eunet.no/~pnordahl/ntpasswd/chntpw-source-080526.zip +Source2: chntpw-README.Dist +# The man page is borrowed from Debian +Source3: chntpw-chntpw.8 +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: openssl-devel + + +%description +This is a utility to (re)set the password of any user that has a valid +(local) account on your Windows NT/2k/XP/Vista etc system. You do not +need to know the old password to set a new one. It works offline, that +is, you have to shutdown your computer and boot off a floppydisk or CD +or another system. Will detect and offer to unlock locked or disabled +out user accounts! There is also a registry editor and other registry +utilities that works under linux/unix, and can be used for other things +than password editing. + + +%prep +%setup -q -n %{name}-080526 +cp -p %{SOURCE2} README.Dist +sed -e 's/\r$//' WinReg.txt > WinReg.txt.eol +touch -c -r WinReg.txt WinReg.txt.eol +mv WinReg.txt.eol WinReg.txt + + +%build +make CC="%__cc" CFLAGS="$RPM_OPT_FLAGS" LIBS="-lcrypto" chntpw cpnt reged + + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{_bindir} +cp chntpw $RPM_BUILD_ROOT%{_bindir} +cp cpnt $RPM_BUILD_ROOT%{_bindir} +cp reged $RPM_BUILD_ROOT%{_bindir} +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8/ +cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_mandir}/man8/%{name}.8 + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr(-,root,root,-) +%doc GPL.txt LGPL.txt README.txt regedit.txt WinReg.txt HISTORY.txt +%doc README.Dist +%{_bindir}/chntpw +%{_bindir}/cpnt +%{_bindir}/reged +%{_mandir}/man8/%{name}.8* + + +%changelog +* Sun Oct 11 2008 Conrad Meyer - 0.99.6-5 +- Bump because force-tag was removed. Please add it back. + +* Sat Oct 11 2008 Conrad Meyer - 0.99.6-4 +- Fix EOL encodings in WinReg.txt. + +* Sat Oct 11 2008 Conrad Meyer - 0.99.6-3 +- More miscellaneous small changes. + +* Fri Oct 10 2008 Conrad Meyer - 0.99.6-2 +- Revert to original Makefile. +- Miscellaneous small changes. + +* Wed Oct 1 2008 Conrad Meyer - 0.99.6-1 +- Initial package. diff --git a/sources b/sources index e69de29..954d9c8 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +09addfe7ae469677da39ed66d83858d3 chntpw-source-080526.zip From 877f00048084859995353fb032a1a0e8b6b68847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Mr=C3=A1z?= Date: Thu, 15 Jan 2009 14:18:53 +0000 Subject: [PATCH 06/65] - rebuild with new openssl --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 37062ed..ed0a61b 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -63,6 +63,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Jan 15 2009 Tomas Mraz - 0.99.6-6 +- rebuild with new openssl + * Sun Oct 11 2008 Conrad Meyer - 0.99.6-5 - Bump because force-tag was removed. Please add it back. From ad2abecf35797f35cb2ea95da783df7860783e5d Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Tue, 24 Feb 2009 07:30:11 +0000 Subject: [PATCH 07/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index ed0a61b..a32d29a 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -63,6 +63,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Feb 23 2009 Fedora Release Engineering - 0.99.6-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + * Thu Jan 15 2009 Tomas Mraz - 0.99.6-6 - rebuild with new openssl From 6e892e79f5d573d4334cb7a47f1c505e4e01e920 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 9 Jun 2009 11:31:11 +0000 Subject: [PATCH 08/65] Fix three crashing bugs in 'reged -x' command. --- chntpw-080526-get_abs_path.patch | 29 ++++++++++++++++++++ chntpw-080526-keyname-overflow.patch | 22 +++++++++++++++ chntpw-080526-no-value.patch | 41 ++++++++++++++++++++++++++++ chntpw.spec | 14 +++++++++- 4 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 chntpw-080526-get_abs_path.patch create mode 100644 chntpw-080526-keyname-overflow.patch create mode 100644 chntpw-080526-no-value.patch diff --git a/chntpw-080526-get_abs_path.patch b/chntpw-080526-get_abs_path.patch new file mode 100644 index 0000000..4a754cd --- /dev/null +++ b/chntpw-080526-get_abs_path.patch @@ -0,0 +1,29 @@ +diff -ur chntpw-080526/ntreg.c chntpw-080526.get_abs_path/ntreg.c +--- chntpw-080526/ntreg.c 2009-06-08 14:32:00.000000000 +0100 ++++ chntpw-080526.get_abs_path/ntreg.c 2009-06-08 14:30:08.000000000 +0100 +@@ -1193,7 +1193,7 @@ + { + /* int newnkofs; */ + struct nk_key *key; +- char tmp[ABSPATHLEN+1]; ++ char tmp[ABSPATHLEN]; + + maxlen = (maxlen < ABSPATHLEN ? maxlen : ABSPATHLEN); + +@@ -1209,6 +1209,7 @@ + } + + strncpy(tmp,path,ABSPATHLEN-1); ++ tmp[ABSPATHLEN-1] = '\0'; + + if ( (strlen(path) + key->len_name) >= maxlen-6) { + snprintf(path,maxlen,"(...)%s",tmp); +@@ -1216,7 +1217,7 @@ + } + *path = '\\'; + memcpy(path+1,key->keyname,key->len_name); +- strncpy(path+key->len_name+1,tmp,maxlen); ++ strcpy(path+key->len_name+1,tmp); + return(get_abs_path(hdesc, key->ofs_parent+0x1004, path, maxlen)); /* go back one more */ + } + diff --git a/chntpw-080526-keyname-overflow.patch b/chntpw-080526-keyname-overflow.patch new file mode 100644 index 0000000..345a4cf --- /dev/null +++ b/chntpw-080526-keyname-overflow.patch @@ -0,0 +1,22 @@ +diff -ur chntpw-080526/ntreg.c chntpw-080526.keyname/ntreg.c +--- chntpw-080526/ntreg.c 2008-05-26 20:59:44.000000000 +0100 ++++ chntpw-080526.keyname/ntreg.c 2009-06-08 12:00:00.000000000 +0100 +@@ -2607,7 +2607,6 @@ + int count = 0; + int countri = 0; + int len, byte; +- char keyname[128]; + char path[1024]; + char *value; + struct nk_key *key; +@@ -2626,10 +2625,6 @@ + + // get the key + key = (struct nk_key *)(hdesc->buffer + nkofs); +- strncpy(keyname, key->keyname, key->len_name); +- keyname[key->len_name] = '\0'; +- printf("Exporting key '%s' with %d subkeys and %d values...\n", +- keyname, key->no_subkeys, key->no_values); + + *path = 0; + get_abs_path(hdesc, nkofs, path, 1024); diff --git a/chntpw-080526-no-value.patch b/chntpw-080526-no-value.patch new file mode 100644 index 0000000..5bb2048 --- /dev/null +++ b/chntpw-080526-no-value.patch @@ -0,0 +1,41 @@ +diff -ur chntpw-080526/ntreg.c chntpw-080526.novalue/ntreg.c +--- chntpw-080526/ntreg.c 2009-06-08 14:44:09.000000000 +0100 ++++ chntpw-080526.novalue/ntreg.c 2009-06-08 14:43:48.000000000 +0100 +@@ -2667,21 +2667,23 @@ + value = (char *)get_val_data(hdesc, nkofs, vex.name, vex.type, TPF_VK_EXACT); + len = get_val_len(hdesc, nkofs, vex.name, TPF_VK_EXACT); + +- if (vex.type == REG_BINARY) { +- fprintf(file, "\"%s\"=hex:", vex.name); +- } else { +- fprintf(file, "\"%s\"=hex(%x):", vex.name, vex.type); +- } +- byte = 0; +- while (byte < len) { /* go byte by byte.. probably slow.. */ +- fprintf(file, "%02x,", (unsigned char)value[byte]); +- byte++; +- if (!(byte % 20)) fprintf(file, "\\\r\n "); +- } +- fprintf(file, "%02x\r\n", (unsigned char)value[byte]); +- } ++ if (value && len >= 0) { ++ if (vex.type == REG_BINARY) { ++ fprintf(file, "\"%s\"=hex:", vex.name); ++ } else { ++ fprintf(file, "\"%s\"=hex(%x):", vex.name, vex.type); ++ } ++ byte = 0; ++ while (byte < len) { /* go byte by byte.. probably slow.. */ ++ fprintf(file, "%02x,", (unsigned char)value[byte]); ++ byte++; ++ if (!(byte % 20)) fprintf(file, "\\\r\n "); ++ } ++ fprintf(file, "%02x\r\n", (unsigned char)value[byte]); + +- FREE(vex.name); ++ FREE(vex.name); ++ } ++ } + } + } + diff --git a/chntpw.spec b/chntpw.spec index a32d29a..75fb54b 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -14,6 +14,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel +# Patches sent upstream on 2009-06-08. +Patch0: chntpw-080526-keyname-overflow.patch +Patch1: chntpw-080526-get_abs_path.patch +Patch2: chntpw-080526-no-value.patch + %description This is a utility to (re)set the password of any user that has a valid @@ -33,6 +38,10 @@ sed -e 's/\r$//' WinReg.txt > WinReg.txt.eol touch -c -r WinReg.txt WinReg.txt.eol mv WinReg.txt.eol WinReg.txt +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + %build make CC="%__cc" CFLAGS="$RPM_OPT_FLAGS" LIBS="-lcrypto" chntpw cpnt reged @@ -63,6 +72,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Jun 8 2009 Richard W.M. Jones - 0.99.6-8 +- Fix three crashing bugs in 'reged -x' command. + * Mon Feb 23 2009 Fedora Release Engineering - 0.99.6-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild From 0875622403d7018d05be1d538af2c9cbf64b4b72 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 9 Jun 2009 11:31:20 +0000 Subject: [PATCH 09/65] Fix three crashing bugs in 'reged -x' command. --- chntpw-080526-get_abs_path.patch | 29 ++++++++++++++++++++ chntpw-080526-keyname-overflow.patch | 22 +++++++++++++++ chntpw-080526-no-value.patch | 41 ++++++++++++++++++++++++++++ chntpw.spec | 14 +++++++++- 4 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 chntpw-080526-get_abs_path.patch create mode 100644 chntpw-080526-keyname-overflow.patch create mode 100644 chntpw-080526-no-value.patch diff --git a/chntpw-080526-get_abs_path.patch b/chntpw-080526-get_abs_path.patch new file mode 100644 index 0000000..4a754cd --- /dev/null +++ b/chntpw-080526-get_abs_path.patch @@ -0,0 +1,29 @@ +diff -ur chntpw-080526/ntreg.c chntpw-080526.get_abs_path/ntreg.c +--- chntpw-080526/ntreg.c 2009-06-08 14:32:00.000000000 +0100 ++++ chntpw-080526.get_abs_path/ntreg.c 2009-06-08 14:30:08.000000000 +0100 +@@ -1193,7 +1193,7 @@ + { + /* int newnkofs; */ + struct nk_key *key; +- char tmp[ABSPATHLEN+1]; ++ char tmp[ABSPATHLEN]; + + maxlen = (maxlen < ABSPATHLEN ? maxlen : ABSPATHLEN); + +@@ -1209,6 +1209,7 @@ + } + + strncpy(tmp,path,ABSPATHLEN-1); ++ tmp[ABSPATHLEN-1] = '\0'; + + if ( (strlen(path) + key->len_name) >= maxlen-6) { + snprintf(path,maxlen,"(...)%s",tmp); +@@ -1216,7 +1217,7 @@ + } + *path = '\\'; + memcpy(path+1,key->keyname,key->len_name); +- strncpy(path+key->len_name+1,tmp,maxlen); ++ strcpy(path+key->len_name+1,tmp); + return(get_abs_path(hdesc, key->ofs_parent+0x1004, path, maxlen)); /* go back one more */ + } + diff --git a/chntpw-080526-keyname-overflow.patch b/chntpw-080526-keyname-overflow.patch new file mode 100644 index 0000000..345a4cf --- /dev/null +++ b/chntpw-080526-keyname-overflow.patch @@ -0,0 +1,22 @@ +diff -ur chntpw-080526/ntreg.c chntpw-080526.keyname/ntreg.c +--- chntpw-080526/ntreg.c 2008-05-26 20:59:44.000000000 +0100 ++++ chntpw-080526.keyname/ntreg.c 2009-06-08 12:00:00.000000000 +0100 +@@ -2607,7 +2607,6 @@ + int count = 0; + int countri = 0; + int len, byte; +- char keyname[128]; + char path[1024]; + char *value; + struct nk_key *key; +@@ -2626,10 +2625,6 @@ + + // get the key + key = (struct nk_key *)(hdesc->buffer + nkofs); +- strncpy(keyname, key->keyname, key->len_name); +- keyname[key->len_name] = '\0'; +- printf("Exporting key '%s' with %d subkeys and %d values...\n", +- keyname, key->no_subkeys, key->no_values); + + *path = 0; + get_abs_path(hdesc, nkofs, path, 1024); diff --git a/chntpw-080526-no-value.patch b/chntpw-080526-no-value.patch new file mode 100644 index 0000000..5bb2048 --- /dev/null +++ b/chntpw-080526-no-value.patch @@ -0,0 +1,41 @@ +diff -ur chntpw-080526/ntreg.c chntpw-080526.novalue/ntreg.c +--- chntpw-080526/ntreg.c 2009-06-08 14:44:09.000000000 +0100 ++++ chntpw-080526.novalue/ntreg.c 2009-06-08 14:43:48.000000000 +0100 +@@ -2667,21 +2667,23 @@ + value = (char *)get_val_data(hdesc, nkofs, vex.name, vex.type, TPF_VK_EXACT); + len = get_val_len(hdesc, nkofs, vex.name, TPF_VK_EXACT); + +- if (vex.type == REG_BINARY) { +- fprintf(file, "\"%s\"=hex:", vex.name); +- } else { +- fprintf(file, "\"%s\"=hex(%x):", vex.name, vex.type); +- } +- byte = 0; +- while (byte < len) { /* go byte by byte.. probably slow.. */ +- fprintf(file, "%02x,", (unsigned char)value[byte]); +- byte++; +- if (!(byte % 20)) fprintf(file, "\\\r\n "); +- } +- fprintf(file, "%02x\r\n", (unsigned char)value[byte]); +- } ++ if (value && len >= 0) { ++ if (vex.type == REG_BINARY) { ++ fprintf(file, "\"%s\"=hex:", vex.name); ++ } else { ++ fprintf(file, "\"%s\"=hex(%x):", vex.name, vex.type); ++ } ++ byte = 0; ++ while (byte < len) { /* go byte by byte.. probably slow.. */ ++ fprintf(file, "%02x,", (unsigned char)value[byte]); ++ byte++; ++ if (!(byte % 20)) fprintf(file, "\\\r\n "); ++ } ++ fprintf(file, "%02x\r\n", (unsigned char)value[byte]); + +- FREE(vex.name); ++ FREE(vex.name); ++ } ++ } + } + } + diff --git a/chntpw.spec b/chntpw.spec index 37062ed..b2b5383 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 5%{?dist} +Release: 5%{?dist}.1 Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -14,6 +14,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel +# Patches sent upstream on 2009-06-08. +Patch0: chntpw-080526-keyname-overflow.patch +Patch1: chntpw-080526-get_abs_path.patch +Patch2: chntpw-080526-no-value.patch + %description This is a utility to (re)set the password of any user that has a valid @@ -33,6 +38,10 @@ sed -e 's/\r$//' WinReg.txt > WinReg.txt.eol touch -c -r WinReg.txt WinReg.txt.eol mv WinReg.txt.eol WinReg.txt +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + %build make CC="%__cc" CFLAGS="$RPM_OPT_FLAGS" LIBS="-lcrypto" chntpw cpnt reged @@ -63,6 +72,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Jun 8 2009 Richard W.M. Jones - 0.99.6-5.fc10.1 +- Fix three crashing bugs in 'reged -x' command. + * Sun Oct 11 2008 Conrad Meyer - 0.99.6-5 - Bump because force-tag was removed. Please add it back. From 0190a40e5777801335971d1758830b93e9789422 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 9 Jun 2009 11:55:04 +0000 Subject: [PATCH 10/65] - Compile against libgcrypt instead of OpenSSL (RHBZ#504595). - Compile as a 64 bit native binary on 64 bit platforms. --- chntpw-080526-port-to-gcrypt-debian.patch | 201 ++++++++++++++++++++++ chntpw.spec | 14 +- 2 files changed, 212 insertions(+), 3 deletions(-) create mode 100644 chntpw-080526-port-to-gcrypt-debian.patch diff --git a/chntpw-080526-port-to-gcrypt-debian.patch b/chntpw-080526-port-to-gcrypt-debian.patch new file mode 100644 index 0000000..217341d --- /dev/null +++ b/chntpw-080526-port-to-gcrypt-debian.patch @@ -0,0 +1,201 @@ +Original patch from Debian: +http://patch-tracking.debian.net/patch/series/view/chntpw/0.99.5-0+nmu1/01_port_to_gcrypt.patch + +Written by Paul Wise. + +Ported to Fedora build by Richard W.M. Jones. + +Also compiles the program as 64 bit. I see no reason why the '-m32' +flag was supplied. Building on 64 bit produces a working program +as far as I can tell. + +diff -ur chntpw-080526.orig/chntpw.c chntpw-080526.gcrypt/chntpw.c +--- chntpw-080526.orig/chntpw.c 2008-05-26 20:59:44.000000000 +0100 ++++ chntpw-080526.gcrypt/chntpw.c 2009-06-09 12:39:58.037690367 +0100 +@@ -61,12 +61,19 @@ + #include + #include + ++#if defined(USEOPENSSL) + #include + #include +-#define uchar u_char + #define MD4Init MD4_Init + #define MD4Update MD4_Update + #define MD4Final MD4_Final ++#elif defined(USELIBGCRYPT) ++ #include ++#else ++ #error No DES encryption and MD4 hashing library found ++#endif ++ ++#define uchar u_char + + #include "ntreg.h" + #include "sam.h" +@@ -138,7 +145,9 @@ + for (i=0;i<8;i++) { + key[i] = (key[i]<<1); + } ++#if defined(USEOPENSSL) + DES_set_odd_parity((des_cblock *)key); ++#endif + } + + /* +@@ -183,6 +192,7 @@ + + void E1(uchar *k, uchar *d, uchar *out) + { ++#if defined(USEOPENSSL) + des_key_schedule ks; + des_cblock deskey; + +@@ -193,6 +203,15 @@ + des_set_key((des_cblock *)deskey,ks); + #endif /* __FreeBsd__ */ + des_ecb_encrypt((des_cblock *)d,(des_cblock *)out, ks, DES_ENCRYPT); ++#elif defined(USELIBGCRYPT) ++ gcry_cipher_hd_t ks; ++ uchar deskey[8]; ++ str_to_key(k,deskey); ++ gcry_cipher_open(&ks, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0); ++ gcry_cipher_setkey(ks, deskey, 8); ++ gcry_cipher_encrypt(ks, out, 8, d, 8); ++ gcry_cipher_close(ks); ++#endif + } + + +@@ -500,10 +519,18 @@ + int dontchange = 0; + struct user_V *v; + ++#ifdef USEOPENSSL + des_key_schedule ks1, ks2; + des_cblock deskey1, deskey2; + + MD4_CTX context; ++#elif defined(USELIBGCRYPT) ++ gcry_cipher_hd_t ks1, ks2; ++ uchar deskey1[8], deskey2[8]; ++ ++ unsigned char *p; ++ gcry_md_hd_t context; ++#endif + unsigned char digest[16]; + unsigned short acb; + +@@ -617,6 +644,7 @@ + hexprnt("Crypted LM pw: ",(unsigned char *)(vp+lmpw_offs),16); + } + ++#if defined(USEOPENSSL) + /* Get the two decrpt keys. */ + sid_to_key1(rid,(unsigned char *)deskey1); + des_set_key((des_cblock *)deskey1,ks1); +@@ -634,6 +662,25 @@ + (des_cblock *)lanman, ks1, DES_DECRYPT); + des_ecb_encrypt((des_cblock *)(vp+lmpw_offs + 8), + (des_cblock *)&lanman[8], ks2, DES_DECRYPT); ++#elif defined(USELIBGCRYPT) ++ /* Start the keys */ ++ gcry_cipher_open(&ks1, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0); ++ gcry_cipher_open(&ks2, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0); ++ ++ /* Get the two decrpt keys. */ ++ sid_to_key1(rid,deskey1); ++ gcry_cipher_setkey(ks1, deskey1, 8); ++ sid_to_key2(rid,deskey2); ++ gcry_cipher_setkey(ks2, deskey2, 8); ++ ++ /* Decrypt the NT md4 password hash as two 8 byte blocks. */ ++ gcry_cipher_decrypt(ks1, md4, 8, vp+ntpw_offs, 8); ++ gcry_cipher_decrypt(ks2, &md4[8], 8, vp+ntpw_offs+8, 8); ++ ++ /* Decrypt the lanman password hash as two 8 byte blocks. */ ++ gcry_cipher_decrypt(ks1, lanman, 8, vp+lmpw_offs, 8); ++ gcry_cipher_decrypt(ks2, &lanman[8], 8, vp+lmpw_offs+8, 8); ++#endif + + if (gverbose) { + hexprnt("MD4 hash : ",(unsigned char *)md4,16); +@@ -689,9 +736,17 @@ + + /* printf("Ucase Lanman: %s\n",newlanpw); */ + ++#if defined(USEOPENSSL) + MD4Init (&context); + MD4Update (&context, newunipw, pl<<1); + MD4Final (digest, &context); ++#elif defined(USELIBGCRYPT) ++ gcry_md_open(&context, GCRY_MD_MD4, 0); ++ gcry_md_write(context, newunipw, pl<<1); ++ p = gcry_md_read(context, GCRY_MD_MD4); ++ if(p) memcpy(digest, p, gcry_md_get_algo_dlen(GCRY_MD_MD4)); ++ gcry_md_close(context); ++#endif + + if (gverbose) hexprnt("\nNEW MD4 hash : ",digest,16); + +@@ -700,6 +755,7 @@ + + if (gverbose) hexprnt("NEW LANMAN hash : ",(unsigned char *)lanman,16); + ++#if defined(USEOPENSSL) + /* Encrypt the NT md4 password hash as two 8 byte blocks. */ + des_ecb_encrypt((des_cblock *)digest, + (des_cblock *)despw, ks1, DES_ENCRYPT); +@@ -710,6 +766,18 @@ + (des_cblock *)newlandes, ks1, DES_ENCRYPT); + des_ecb_encrypt((des_cblock *)(lanman+8), + (des_cblock *)&newlandes[8], ks2, DES_ENCRYPT); ++#elif defined(USELIBGCRYPT) ++ /* Encrypt the NT md4 password hash as two 8 byte blocks. */ ++ gcry_cipher_encrypt(ks1, despw, 8, digest, 8); ++ gcry_cipher_encrypt(ks2, &despw[8], 8, digest+8, 8); ++ ++ gcry_cipher_encrypt(ks1, newlandes, 8, lanman, 8); ++ gcry_cipher_encrypt(ks2, &newlandes[8], 8, lanman+8, 8); ++ ++ /* Close keys, not needed after this */ ++ gcry_cipher_close(ks1); ++ gcry_cipher_close(ks2); ++#endif + + if (gverbose) { + hexprnt("NEW DES crypt : ",(unsigned char *)despw,16); +diff -ur chntpw-080526.orig/Makefile chntpw-080526.gcrypt/Makefile +--- chntpw-080526.orig/Makefile 2008-05-26 20:59:44.000000000 +0100 ++++ chntpw-080526.gcrypt/Makefile 2009-06-09 12:45:07.798728999 +0100 +@@ -1,28 +1,11 @@ + # + # Makefile for the Offline NT Password Editor + # +-# +-# Change here to point to the needed OpenSSL libraries & .h files +-# See INSTALL for more info. +-# +- +-#SSLPATH=/usr/local/ssl +-OSSLPATH=/usr +-OSSLINC=$(OSSLPATH)/include + + CC=gcc ++CFLAGS=-DUSELIBGCRYPT -g -I. $(shell libgcrypt-config --cflags) -Wall $(EXTRA_CFLAGS) + +-# Force 32 bit +-CFLAGS= -DUSEOPENSSL -g -I. -I$(OSSLINC) -Wall -m32 +-OSSLLIB=$(OSSLPATH)/lib +- +-# 64 bit if default for compiler setup +-#CFLAGS= -DUSEOPENSSL -g -I. -I$(OSSLINC) -Wall +-#OSSLLIB=$(OSSLPATH)/lib64 +- +- +-# This is to link with whatever we have, SSL crypto lib we put in static +-LIBS=-L$(OSSLLIB) $(OSSLLIB)/libcrypto.a ++LIBS=$(shell libgcrypt-config --libs) + + all: chntpw chntpw.static cpnt reged reged.static + diff --git a/chntpw.spec b/chntpw.spec index b2b5383..f941def 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 5%{?dist}.1 +Release: 5%{?dist}.2 Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -12,13 +12,16 @@ Source2: chntpw-README.Dist Source3: chntpw-chntpw.8 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: openssl-devel +BuildRequires: libgcrypt-devel # Patches sent upstream on 2009-06-08. Patch0: chntpw-080526-keyname-overflow.patch Patch1: chntpw-080526-get_abs_path.patch Patch2: chntpw-080526-no-value.patch +# Patch from Debian (RHBZ#504595). +Patch3: chntpw-080526-port-to-gcrypt-debian.patch + %description This is a utility to (re)set the password of any user that has a valid @@ -41,10 +44,11 @@ mv WinReg.txt.eol WinReg.txt %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build -make CC="%__cc" CFLAGS="$RPM_OPT_FLAGS" LIBS="-lcrypto" chntpw cpnt reged +make CC="%__cc" EXTRA_CFLAGS="$RPM_OPT_FLAGS" chntpw cpnt reged %install @@ -72,6 +76,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Jun 8 2009 Richard W.M. Jones - 0.99.6-5.fc10.2 +- Compile against libgcrypt instead of OpenSSL (RHBZ#504595). +- Compile as a 64 bit native binary on 64 bit platforms. + * Mon Jun 8 2009 Richard W.M. Jones - 0.99.6-5.fc10.1 - Fix three crashing bugs in 'reged -x' command. From affa7b37421529d3b94a2c26bde05caacca6f975 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 9 Jun 2009 11:55:18 +0000 Subject: [PATCH 11/65] - Compile against libgcrypt instead of OpenSSL (RHBZ#504595). - Compile as a 64 bit native binary on 64 bit platforms. --- chntpw-080526-port-to-gcrypt-debian.patch | 201 ++++++++++++++++++++++ chntpw.spec | 14 +- 2 files changed, 212 insertions(+), 3 deletions(-) create mode 100644 chntpw-080526-port-to-gcrypt-debian.patch diff --git a/chntpw-080526-port-to-gcrypt-debian.patch b/chntpw-080526-port-to-gcrypt-debian.patch new file mode 100644 index 0000000..217341d --- /dev/null +++ b/chntpw-080526-port-to-gcrypt-debian.patch @@ -0,0 +1,201 @@ +Original patch from Debian: +http://patch-tracking.debian.net/patch/series/view/chntpw/0.99.5-0+nmu1/01_port_to_gcrypt.patch + +Written by Paul Wise. + +Ported to Fedora build by Richard W.M. Jones. + +Also compiles the program as 64 bit. I see no reason why the '-m32' +flag was supplied. Building on 64 bit produces a working program +as far as I can tell. + +diff -ur chntpw-080526.orig/chntpw.c chntpw-080526.gcrypt/chntpw.c +--- chntpw-080526.orig/chntpw.c 2008-05-26 20:59:44.000000000 +0100 ++++ chntpw-080526.gcrypt/chntpw.c 2009-06-09 12:39:58.037690367 +0100 +@@ -61,12 +61,19 @@ + #include + #include + ++#if defined(USEOPENSSL) + #include + #include +-#define uchar u_char + #define MD4Init MD4_Init + #define MD4Update MD4_Update + #define MD4Final MD4_Final ++#elif defined(USELIBGCRYPT) ++ #include ++#else ++ #error No DES encryption and MD4 hashing library found ++#endif ++ ++#define uchar u_char + + #include "ntreg.h" + #include "sam.h" +@@ -138,7 +145,9 @@ + for (i=0;i<8;i++) { + key[i] = (key[i]<<1); + } ++#if defined(USEOPENSSL) + DES_set_odd_parity((des_cblock *)key); ++#endif + } + + /* +@@ -183,6 +192,7 @@ + + void E1(uchar *k, uchar *d, uchar *out) + { ++#if defined(USEOPENSSL) + des_key_schedule ks; + des_cblock deskey; + +@@ -193,6 +203,15 @@ + des_set_key((des_cblock *)deskey,ks); + #endif /* __FreeBsd__ */ + des_ecb_encrypt((des_cblock *)d,(des_cblock *)out, ks, DES_ENCRYPT); ++#elif defined(USELIBGCRYPT) ++ gcry_cipher_hd_t ks; ++ uchar deskey[8]; ++ str_to_key(k,deskey); ++ gcry_cipher_open(&ks, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0); ++ gcry_cipher_setkey(ks, deskey, 8); ++ gcry_cipher_encrypt(ks, out, 8, d, 8); ++ gcry_cipher_close(ks); ++#endif + } + + +@@ -500,10 +519,18 @@ + int dontchange = 0; + struct user_V *v; + ++#ifdef USEOPENSSL + des_key_schedule ks1, ks2; + des_cblock deskey1, deskey2; + + MD4_CTX context; ++#elif defined(USELIBGCRYPT) ++ gcry_cipher_hd_t ks1, ks2; ++ uchar deskey1[8], deskey2[8]; ++ ++ unsigned char *p; ++ gcry_md_hd_t context; ++#endif + unsigned char digest[16]; + unsigned short acb; + +@@ -617,6 +644,7 @@ + hexprnt("Crypted LM pw: ",(unsigned char *)(vp+lmpw_offs),16); + } + ++#if defined(USEOPENSSL) + /* Get the two decrpt keys. */ + sid_to_key1(rid,(unsigned char *)deskey1); + des_set_key((des_cblock *)deskey1,ks1); +@@ -634,6 +662,25 @@ + (des_cblock *)lanman, ks1, DES_DECRYPT); + des_ecb_encrypt((des_cblock *)(vp+lmpw_offs + 8), + (des_cblock *)&lanman[8], ks2, DES_DECRYPT); ++#elif defined(USELIBGCRYPT) ++ /* Start the keys */ ++ gcry_cipher_open(&ks1, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0); ++ gcry_cipher_open(&ks2, GCRY_CIPHER_DES, GCRY_CIPHER_MODE_ECB, 0); ++ ++ /* Get the two decrpt keys. */ ++ sid_to_key1(rid,deskey1); ++ gcry_cipher_setkey(ks1, deskey1, 8); ++ sid_to_key2(rid,deskey2); ++ gcry_cipher_setkey(ks2, deskey2, 8); ++ ++ /* Decrypt the NT md4 password hash as two 8 byte blocks. */ ++ gcry_cipher_decrypt(ks1, md4, 8, vp+ntpw_offs, 8); ++ gcry_cipher_decrypt(ks2, &md4[8], 8, vp+ntpw_offs+8, 8); ++ ++ /* Decrypt the lanman password hash as two 8 byte blocks. */ ++ gcry_cipher_decrypt(ks1, lanman, 8, vp+lmpw_offs, 8); ++ gcry_cipher_decrypt(ks2, &lanman[8], 8, vp+lmpw_offs+8, 8); ++#endif + + if (gverbose) { + hexprnt("MD4 hash : ",(unsigned char *)md4,16); +@@ -689,9 +736,17 @@ + + /* printf("Ucase Lanman: %s\n",newlanpw); */ + ++#if defined(USEOPENSSL) + MD4Init (&context); + MD4Update (&context, newunipw, pl<<1); + MD4Final (digest, &context); ++#elif defined(USELIBGCRYPT) ++ gcry_md_open(&context, GCRY_MD_MD4, 0); ++ gcry_md_write(context, newunipw, pl<<1); ++ p = gcry_md_read(context, GCRY_MD_MD4); ++ if(p) memcpy(digest, p, gcry_md_get_algo_dlen(GCRY_MD_MD4)); ++ gcry_md_close(context); ++#endif + + if (gverbose) hexprnt("\nNEW MD4 hash : ",digest,16); + +@@ -700,6 +755,7 @@ + + if (gverbose) hexprnt("NEW LANMAN hash : ",(unsigned char *)lanman,16); + ++#if defined(USEOPENSSL) + /* Encrypt the NT md4 password hash as two 8 byte blocks. */ + des_ecb_encrypt((des_cblock *)digest, + (des_cblock *)despw, ks1, DES_ENCRYPT); +@@ -710,6 +766,18 @@ + (des_cblock *)newlandes, ks1, DES_ENCRYPT); + des_ecb_encrypt((des_cblock *)(lanman+8), + (des_cblock *)&newlandes[8], ks2, DES_ENCRYPT); ++#elif defined(USELIBGCRYPT) ++ /* Encrypt the NT md4 password hash as two 8 byte blocks. */ ++ gcry_cipher_encrypt(ks1, despw, 8, digest, 8); ++ gcry_cipher_encrypt(ks2, &despw[8], 8, digest+8, 8); ++ ++ gcry_cipher_encrypt(ks1, newlandes, 8, lanman, 8); ++ gcry_cipher_encrypt(ks2, &newlandes[8], 8, lanman+8, 8); ++ ++ /* Close keys, not needed after this */ ++ gcry_cipher_close(ks1); ++ gcry_cipher_close(ks2); ++#endif + + if (gverbose) { + hexprnt("NEW DES crypt : ",(unsigned char *)despw,16); +diff -ur chntpw-080526.orig/Makefile chntpw-080526.gcrypt/Makefile +--- chntpw-080526.orig/Makefile 2008-05-26 20:59:44.000000000 +0100 ++++ chntpw-080526.gcrypt/Makefile 2009-06-09 12:45:07.798728999 +0100 +@@ -1,28 +1,11 @@ + # + # Makefile for the Offline NT Password Editor + # +-# +-# Change here to point to the needed OpenSSL libraries & .h files +-# See INSTALL for more info. +-# +- +-#SSLPATH=/usr/local/ssl +-OSSLPATH=/usr +-OSSLINC=$(OSSLPATH)/include + + CC=gcc ++CFLAGS=-DUSELIBGCRYPT -g -I. $(shell libgcrypt-config --cflags) -Wall $(EXTRA_CFLAGS) + +-# Force 32 bit +-CFLAGS= -DUSEOPENSSL -g -I. -I$(OSSLINC) -Wall -m32 +-OSSLLIB=$(OSSLPATH)/lib +- +-# 64 bit if default for compiler setup +-#CFLAGS= -DUSEOPENSSL -g -I. -I$(OSSLINC) -Wall +-#OSSLLIB=$(OSSLPATH)/lib64 +- +- +-# This is to link with whatever we have, SSL crypto lib we put in static +-LIBS=-L$(OSSLLIB) $(OSSLLIB)/libcrypto.a ++LIBS=$(shell libgcrypt-config --libs) + + all: chntpw chntpw.static cpnt reged reged.static + diff --git a/chntpw.spec b/chntpw.spec index 75fb54b..3e0b5b1 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -12,13 +12,16 @@ Source2: chntpw-README.Dist Source3: chntpw-chntpw.8 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: openssl-devel +BuildRequires: libgcrypt-devel # Patches sent upstream on 2009-06-08. Patch0: chntpw-080526-keyname-overflow.patch Patch1: chntpw-080526-get_abs_path.patch Patch2: chntpw-080526-no-value.patch +# Patch from Debian (RHBZ#504595). +Patch3: chntpw-080526-port-to-gcrypt-debian.patch + %description This is a utility to (re)set the password of any user that has a valid @@ -41,10 +44,11 @@ mv WinReg.txt.eol WinReg.txt %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build -make CC="%__cc" CFLAGS="$RPM_OPT_FLAGS" LIBS="-lcrypto" chntpw cpnt reged +make CC="%__cc" EXTRA_CFLAGS="$RPM_OPT_FLAGS" chntpw cpnt reged %install @@ -72,6 +76,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Jun 8 2009 Richard W.M. Jones - 0.99.6-9 +- Compile against libgcrypt instead of OpenSSL (RHBZ#504595). +- Compile as a 64 bit native binary on 64 bit platforms. + * Mon Jun 8 2009 Richard W.M. Jones - 0.99.6-8 - Fix three crashing bugs in 'reged -x' command. From bf3b22a0afe5c5a6f1975664ca2f248914f9407c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 20 Jul 2009 16:07:18 +0000 Subject: [PATCH 12/65] - Three patches from Jim Meyering aiming to improve the general robustness of the code. --- chntpw-080526-robustness.patch | 182 +++++++++++++++++++++++++++++++++ chntpw.spec | 10 +- 2 files changed, 191 insertions(+), 1 deletion(-) create mode 100644 chntpw-080526-robustness.patch diff --git a/chntpw-080526-robustness.patch b/chntpw-080526-robustness.patch new file mode 100644 index 0000000..531bf52 --- /dev/null +++ b/chntpw-080526-robustness.patch @@ -0,0 +1,182 @@ +From jim@meyering.net Mon Jul 20 16:46:56 2009 +Return-Path: jim@meyering.net +X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on amd.home.annexia.org +X-Spam-Level: +X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00, + UNPARSEABLE_RELAY autolearn=ham version=3.2.5 +Received: from mail.corp.redhat.com [10.5.5.51] + by amd.home.annexia.org with IMAP (fetchmail-6.3.8) + for (single-drop); Mon, 20 Jul 2009 16:46:56 +0100 (BST) +Received: from zmta02.collab.prod.int.phx2.redhat.com (LHLO + zmta02.collab.prod.int.phx2.redhat.com) (10.5.5.32) by + mail06.corp.redhat.com with LMTP; Mon, 20 Jul 2009 11:31:43 -0400 (EDT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by zmta02.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 27CD09E195 + for ; Mon, 20 Jul 2009 11:31:43 -0400 (EDT) +Received: from zmta02.collab.prod.int.phx2.redhat.com ([127.0.0.1]) + by localhost (zmta02.collab.prod.int.phx2.redhat.com [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id TTbuqA5poqWA for ; + Mon, 20 Jul 2009 11:31:43 -0400 (EDT) +Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) + by zmta02.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 087319E193 + for ; Mon, 20 Jul 2009 11:31:43 -0400 (EDT) +Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) + by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6KFVfBF002494 + for ; Mon, 20 Jul 2009 11:31:42 -0400 +Received: from mx.meyering.net (sebastian-int.corp.redhat.com [172.16.52.221]) + by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6KFVeiP013799 + for ; Mon, 20 Jul 2009 11:31:41 -0400 +Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) + id D157838154; Mon, 20 Jul 2009 17:31:40 +0200 (CEST) +From: Jim Meyering +To: "Richard W. M. Jones" +Subject: chntpw patches +Date: Mon, 20 Jul 2009 17:31:40 +0200 +Message-ID: <87my6z8j6r.fsf@meyering.net> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 +Status: RO +Content-Length: 4197 +Lines: 140 + +Hi Rich, + +The first two were spotted via inspection. +The 3rd one was to address this: + + $ : > j && valgrind ./reged -e j + ~/w/co/chntpw: + ==16084== Memcheck, a memory error detector. + ==16084== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al. + ==16084== Using LibVEX rev 1884, a library for dynamic binary translation. + ==16084== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP. + ==16084== Using valgrind-3.4.1, a dynamic binary instrumentation framework. + ==16084== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al. + ==16084== For more details, rerun with: -v + ==16084== + reged version 0.1 080526, (c) Petter N Hagen + ==16084== Invalid read of size 4 + ==16084== at 0x407D09: openHive (ntreg.c:2856) + ==16084== by 0x4011E3: main (reged.c:103) + ==16084== Address 0x4c230d8 is 0 bytes after a block of size 0 alloc'd + ==16084== at 0x4A05414: calloc (vg_replace_malloc.c:397) + ==16084== by 0x407C5C: openHive (ntreg.c:2840) + ==16084== by 0x4011E3: main (reged.c:103) + openHive(j): File does not seem to be a registry hive! + Simple registry editor. ? for help. + ==16084== + ==16084== Invalid read of size 2 + ==16084== at 0x403C4D: get_abs_path (ntreg.c:1204) + ==16084== by 0x408D57: regedit_interactive (edlib.c:379) + ==16084== by 0x401277: main (reged.c:111) + ==16084== Address 0x4c230dc is 4 bytes after a block of size 0 alloc'd + ==16084== at 0x4A05414: calloc (vg_replace_malloc.c:397) + ==16084== by 0x407C5C: openHive (ntreg.c:2840) + ==16084== by 0x4011E3: main (reged.c:103) + get_abs_path: Not a 'nk' node! + + > + + + +>From 5c287bb158db10af96b1f1f67d4df49a47323b94 Mon Sep 17 00:00:00 2001 +From: Jim Meyering +Date: Mon, 20 Jul 2009 09:57:13 -0400 +Subject: [PATCH 1/3] improved robustness + +* ntreg.c (fmyinput): Don't clobber ibuf[-1] upon NUL input. +--- + ntreg.c | 8 +++++--- + 1 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/ntreg.c b/ntreg.c +index e27a5b9..1b84410 100644 +--- a/ntreg.c ++++ b/ntreg.c +@@ -82,14 +82,16 @@ char *str_dup( const char *str ) + + int fmyinput(char *prmpt, char *ibuf, int maxlen) + { +- ++ int len; + printf("%s",prmpt); + + fgets(ibuf,maxlen+1,stdin); ++ len = strlen(ibuf); + +- ibuf[strlen(ibuf)-1] = 0; ++ if (len) ++ ibuf[len-1] = 0; + +- return(strlen(ibuf)); ++ return len; + } + + /* Print len number of hexbytes */ +-- +1.6.2.5 + + +>From b9bfb44aa1bff1f9b7badf65425f8190352966a0 Mon Sep 17 00:00:00 2001 +From: Jim Meyering +Date: Mon, 20 Jul 2009 10:04:23 -0400 +Subject: [PATCH 2/3] robustness: avoid low-memory segfault + +* ntreg.c (convert_string): Don't segfault upon low memory. +--- + ntreg.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +diff --git a/ntreg.c b/ntreg.c +index 1b84410..08f9124 100644 +--- a/ntreg.c ++++ b/ntreg.c +@@ -2585,7 +2585,10 @@ char * convert_string(void *string, int len) + int i, k; + int reallen = len / 2; + char *cstring = (char *)malloc(reallen); +- ++ if (cstring == NULL) { ++ printf("FATAL! convert_string: malloc() failed! Out of memory?\n"); ++ abort(); ++ } + for(i = 0, k = 0; i < len; i += 2, k++) + { + cstring[k] = ((char *)string)[i]; +-- +1.6.2.5 + + +>From 81ae3189a8dffcdb3db7229cbe992ed12b8d1327 Mon Sep 17 00:00:00 2001 +From: Jim Meyering +Date: Mon, 20 Jul 2009 11:04:38 -0400 +Subject: [PATCH 3/3] robustness: avoid malfunction for too-small hive file + +* ntreg.c (openHive): Don't read uninitialized when file is too small. +--- + ntreg.c | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +diff --git a/ntreg.c b/ntreg.c +index 08f9124..be6b680 100644 +--- a/ntreg.c ++++ b/ntreg.c +@@ -2847,6 +2847,14 @@ struct hive *openHive(char *filename, int mode) + return(NULL); + } + ++ if (r < sizeof (*hdesc)) { ++ fprintf(stderr, ++ "file is too small; got %d bytes while expecting %d or more\n", ++ r, sizeof (*hdesc)); ++ closeHive(hdesc); ++ return(NULL); ++ } ++ + /* Now run through file, tallying all pages */ + /* NOTE/KLUDGE: Assume first page starts at offset 0x1000 */ + +-- +1.6.2.5 + diff --git a/chntpw.spec b/chntpw.spec index 3e0b5b1..dd348bc 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -22,6 +22,9 @@ Patch2: chntpw-080526-no-value.patch # Patch from Debian (RHBZ#504595). Patch3: chntpw-080526-port-to-gcrypt-debian.patch +# Patches from Jim Meyering to improve robustness of the code. +Patch4: chntpw-080526-robustness.patch + %description This is a utility to (re)set the password of any user that has a valid @@ -45,6 +48,7 @@ mv WinReg.txt.eol WinReg.txt %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %build @@ -76,6 +80,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Jul 20 2009 Richard W.M. Jones - 0.99.6-10 +- Three patches from Jim Meyering aiming to improve the general + robustness of the code. + * Mon Jun 8 2009 Richard W.M. Jones - 0.99.6-9 - Compile against libgcrypt instead of OpenSSL (RHBZ#504595). - Compile as a 64 bit native binary on 64 bit platforms. From 9cb37592c00dcc15a7f35e0c1be3085de48f12bc Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 22 Jul 2009 09:45:17 +0000 Subject: [PATCH 13/65] Two more patches. --- ...orrect-test-for-failing-open-syscall.patch | 75 ++++++++++++++++++ ...w-080526-detect-failure-to-write-key.patch | 77 +++++++++++++++++++ chntpw.spec | 9 ++- 3 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 chntpw-080526-correct-test-for-failing-open-syscall.patch create mode 100644 chntpw-080526-detect-failure-to-write-key.patch diff --git a/chntpw-080526-correct-test-for-failing-open-syscall.patch b/chntpw-080526-correct-test-for-failing-open-syscall.patch new file mode 100644 index 0000000..3c68146 --- /dev/null +++ b/chntpw-080526-correct-test-for-failing-open-syscall.patch @@ -0,0 +1,75 @@ +From jim@meyering.net Mon Jul 20 20:05:55 2009 +Return-Path: jim@meyering.net +X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on amd.home.annexia.org +X-Spam-Level: +X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00, + UNPARSEABLE_RELAY autolearn=ham version=3.2.5 +Received: from mail.corp.redhat.com [10.5.5.51] + by amd.home.annexia.org with IMAP (fetchmail-6.3.8) + for (single-drop); Mon, 20 Jul 2009 20:05:55 +0100 (BST) +Received: from zmta03.collab.prod.int.phx2.redhat.com (LHLO + zmta03.collab.prod.int.phx2.redhat.com) (10.5.5.33) by + mail06.corp.redhat.com with LMTP; Mon, 20 Jul 2009 15:05:47 -0400 (EDT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by zmta03.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 2C1134E4EB + for ; Mon, 20 Jul 2009 15:05:47 -0400 (EDT) +Received: from zmta03.collab.prod.int.phx2.redhat.com ([127.0.0.1]) + by localhost (zmta03.collab.prod.int.phx2.redhat.com [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id a7N9dvNRkYQB for ; + Mon, 20 Jul 2009 15:05:47 -0400 (EDT) +Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) + by zmta03.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 034384E4D6 + for ; Mon, 20 Jul 2009 15:05:46 -0400 (EDT) +Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) + by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6KJ5kIt032703 + for ; Mon, 20 Jul 2009 15:05:46 -0400 +Received: from mx.meyering.net (sebastian-int.corp.redhat.com [172.16.52.221]) + by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6KJ5jf3021050 + for ; Mon, 20 Jul 2009 15:05:45 -0400 +Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) + id D674638154; Mon, 20 Jul 2009 21:05:44 +0200 (CEST) +From: Jim Meyering +To: "Richard W. M. Jones" +Subject: chntpw [PATCH] correct test for failing "open" syscall +Date: Mon, 20 Jul 2009 21:05:44 +0200 +Message-ID: <878wij899z.fsf@meyering.net> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 +Status: RO +Content-Length: 1103 +Lines: 33 + +This one is weird. +It must be code that is never exercised, +since the existing code is totally bogus. +The condition, !open(...), will almost always be true. +(sole exception is when starting a program with stdin +initially closed) + +>From bc4cddb06cf13c189fbdc93e6962cad072779097 Mon Sep 17 00:00:00 2001 +From: Jim Meyering +Date: Mon, 20 Jul 2009 14:59:19 -0400 +Subject: [PATCH] correct test for failing "open" syscall + +* ntreg.c (writeHive): Test open() < 0, not !open(). +--- + ntreg.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/ntreg.c b/ntreg.c +index be6b680..21cd3e3 100644 +--- a/ntreg.c ++++ b/ntreg.c +@@ -2765,7 +2765,7 @@ int writeHive(struct hive *hdesc) + if ( !(hdesc->state & HMODE_DIRTY)) return(0); + + if ( !(hdesc->state & HMODE_OPEN)) { /* File has been closed */ +- if (!(hdesc->filedesc = open(hdesc->filename,O_RDWR))) { ++ if ((hdesc->filedesc = open(hdesc->filename,O_RDWR)) < 0) { + fprintf(stderr,"writeHive: open(%s) failed: %s, FILE NOT WRITTEN!\n",hdesc->filename,strerror(errno)); + return(1); + } +-- +1.6.2.5 + diff --git a/chntpw-080526-detect-failure-to-write-key.patch b/chntpw-080526-detect-failure-to-write-key.patch new file mode 100644 index 0000000..ea17219 --- /dev/null +++ b/chntpw-080526-detect-failure-to-write-key.patch @@ -0,0 +1,77 @@ +From jim@meyering.net Mon Jul 20 20:12:31 2009 +Return-Path: jim@meyering.net +X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on amd.home.annexia.org +X-Spam-Level: +X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00, + UNPARSEABLE_RELAY autolearn=ham version=3.2.5 +Received: from mail.corp.redhat.com [10.5.5.51] + by amd.home.annexia.org with IMAP (fetchmail-6.3.8) + for (single-drop); Mon, 20 Jul 2009 20:12:31 +0100 (BST) +Received: from zmta03.collab.prod.int.phx2.redhat.com (LHLO + zmta03.collab.prod.int.phx2.redhat.com) (10.5.5.33) by + mail06.corp.redhat.com with LMTP; Mon, 20 Jul 2009 15:12:17 -0400 (EDT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by zmta03.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 3C1A04E4EC + for ; Mon, 20 Jul 2009 15:12:17 -0400 (EDT) +Received: from zmta03.collab.prod.int.phx2.redhat.com ([127.0.0.1]) + by localhost (zmta03.collab.prod.int.phx2.redhat.com [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id a+PpYwgPRjqW for ; + Mon, 20 Jul 2009 15:12:17 -0400 (EDT) +Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) + by zmta03.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 130A44E4D6 + for ; Mon, 20 Jul 2009 15:12:17 -0400 (EDT) +Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) + by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6KJCGMZ001977 + for ; Mon, 20 Jul 2009 15:12:16 -0400 +Received: from mx.meyering.net (sebastian-int.corp.redhat.com [172.16.52.221]) + by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6KJCF82022169 + for ; Mon, 20 Jul 2009 15:12:15 -0400 +Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) + id 36C5D38154; Mon, 20 Jul 2009 21:12:15 +0200 (CEST) +From: Jim Meyering +To: "Richard W. M. Jones" +Subject: chntpw [PATCH] detect/diagnose failure to write key +Date: Mon, 20 Jul 2009 21:12:15 +0200 +Message-ID: <873a8r88z4.fsf@meyering.net> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 +Status: RO +Content-Length: 938 +Lines: 34 + +Hi Rich, here's another. + +>From 057c832cf924cabf887e59d1c1f2127cd4619572 Mon Sep 17 00:00:00 2001 +From: Jim Meyering +Date: Mon, 20 Jul 2009 15:09:26 -0400 +Subject: [PATCH] detect/diagnose failure to write key + +* ntreg.c (export_key): Detect stream write failure. +--- + ntreg.c | 9 ++++++++- + 1 files changed, 8 insertions(+), 1 deletions(-) + +diff --git a/ntreg.c b/ntreg.c +index 21cd3e3..cdb6503 100644 +--- a/ntreg.c ++++ b/ntreg.c +@@ -2735,7 +2735,14 @@ void export_key(struct hive *hdesc, int nkofs, char *name, char *filename, char + fprintf(file, "Windows Registry Editor Version 5.00\r\n\r\n"); + export_subkey(hdesc, nkofs, name, prefix, file); + +- fclose(file); ++ if (ferror (file)) { ++ printf("failed to write file '%s'\n", filename); ++ fclose (file); ++ return; ++ } ++ if (fclose(file)) ++ printf("failed to write file '%s': %s\n", filename, ++ strerror(errno)); + } + + +-- +1.6.2.5 + diff --git a/chntpw.spec b/chntpw.spec index dd348bc..5dd762e 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -24,6 +24,8 @@ Patch3: chntpw-080526-port-to-gcrypt-debian.patch # Patches from Jim Meyering to improve robustness of the code. Patch4: chntpw-080526-robustness.patch +Patch5: chntpw-080526-correct-test-for-failing-open-syscall.patch +Patch6: chntpw-080526-detect-failure-to-write-key.patch %description @@ -49,6 +51,8 @@ mv WinReg.txt.eol WinReg.txt %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 +%patch6 -p1 %build @@ -80,6 +84,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Jul 22 2009 Richard W.M. Jones - 0.99.6-11 +- Two more patches from Jim Meyering to improve general code quality. + * Mon Jul 20 2009 Richard W.M. Jones - 0.99.6-10 - Three patches from Jim Meyering aiming to improve the general robustness of the code. From 113031981ec5cfaf49c47542e183b732aaf8da5d Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 22 Jul 2009 14:29:23 +0000 Subject: [PATCH 14/65] Another patch from Jim Meyering. --- chntpw-080526-reged-no-deref-null.patch | 70 +++++++++++++++++++++++++ chntpw.spec | 8 +-- 2 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 chntpw-080526-reged-no-deref-null.patch diff --git a/chntpw-080526-reged-no-deref-null.patch b/chntpw-080526-reged-no-deref-null.patch new file mode 100644 index 0000000..9bd681e --- /dev/null +++ b/chntpw-080526-reged-no-deref-null.patch @@ -0,0 +1,70 @@ +From jim@meyering.net Wed Jul 22 13:41:58 2009 +Return-Path: jim@meyering.net +X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on amd.home.annexia.org +X-Spam-Level: +X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00, + UNPARSEABLE_RELAY autolearn=ham version=3.2.5 +Received: from mail.corp.redhat.com [10.5.5.51] + by amd.home.annexia.org with IMAP (fetchmail-6.3.8) + for (single-drop); Wed, 22 Jul 2009 13:41:58 +0100 (BST) +Received: from zmta01.collab.prod.int.phx2.redhat.com (LHLO + zmta01.collab.prod.int.phx2.redhat.com) (10.5.5.31) by + mail06.corp.redhat.com with LMTP; Wed, 22 Jul 2009 08:41:25 -0400 (EDT) +Received: from localhost (localhost.localdomain [127.0.0.1]) + by zmta01.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 52E8193C42 + for ; Wed, 22 Jul 2009 08:41:25 -0400 (EDT) +Received: from zmta01.collab.prod.int.phx2.redhat.com ([127.0.0.1]) + by localhost (zmta01.collab.prod.int.phx2.redhat.com [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id i+F0NOkWPqt0 for ; + Wed, 22 Jul 2009 08:41:25 -0400 (EDT) +Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) + by zmta01.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 29C8193C01 + for ; Wed, 22 Jul 2009 08:41:25 -0400 (EDT) +Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) + by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6MCfOiN011483 + for ; Wed, 22 Jul 2009 08:41:24 -0400 +Received: from mx.meyering.net (sebastian-int.corp.redhat.com [172.16.52.221]) + by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6MCfNP5023290 + for ; Wed, 22 Jul 2009 08:41:23 -0400 +Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) + id 38377558B9; Wed, 22 Jul 2009 14:41:23 +0200 (CEST) +From: Jim Meyering +To: "Richard W. M. Jones" +Subject: [PATCH] "reged -e" should not dereference NULL +Date: Wed, 22 Jul 2009 14:41:23 +0200 +Message-ID: <87y6qg51qk.fsf@meyering.net> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 +Status: RO +Content-Length: 871 +Lines: 27 + + +>From d9203daf8e29290ca82b2433722e9e56cd0ab73f Mon Sep 17 00:00:00 2001 +From: Jim Meyering +Date: Wed, 22 Jul 2009 14:25:14 +0200 +Subject: [PATCH] "reged -e" should not dereference NULL + +* reged.c (main): Diagnose a missing hive file name with -e. +--- + reged.c | 30 +++++++++++++++++------------- + 1 files changed, 17 insertions(+), 13 deletions(-) + +diff --git a/reged.c b/reged.c +index cf395bc..f99f94e 100644 +--- a/reged.c ++++ b/reged.c +@@ -99,6 +99,11 @@ int main(int argc, char **argv) + } + if (edit) { /* Call editor. Rest of arguments are considered hives to load */ + hivename = argv[optind+no_hives]; ++ if (!hivename) { ++ fprintf(stderr,"with -e you must specify at least one hive file name\n"); ++ usage(); ++ exit(1); ++ } + do { + if (!(hive[no_hives] = openHive(hivename, + HMODE_RW|mode))) { + diff --git a/chntpw.spec b/chntpw.spec index 5dd762e..2c4211f 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 11%{?dist} +Release: 12%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -26,6 +26,7 @@ Patch3: chntpw-080526-port-to-gcrypt-debian.patch Patch4: chntpw-080526-robustness.patch Patch5: chntpw-080526-correct-test-for-failing-open-syscall.patch Patch6: chntpw-080526-detect-failure-to-write-key.patch +Patch7: chntpw-080526-reged-no-deref-null.patch %description @@ -53,6 +54,7 @@ mv WinReg.txt.eol WinReg.txt %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 %build @@ -84,8 +86,8 @@ rm -rf $RPM_BUILD_ROOT %changelog -* Wed Jul 22 2009 Richard W.M. Jones - 0.99.6-11 -- Two more patches from Jim Meyering to improve general code quality. +* Wed Jul 22 2009 Richard W.M. Jones - 0.99.6-12 +- Two^W Three more patches from Jim Meyering to improve general code quality. * Mon Jul 20 2009 Richard W.M. Jones - 0.99.6-10 - Three patches from Jim Meyering aiming to improve the general From 806dc3311c5bb6b396374a25ae444b7ee15a4bd6 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Fri, 24 Jul 2009 18:56:57 +0000 Subject: [PATCH 15/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 2c4211f..beeea4e 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -86,6 +86,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Jul 24 2009 Fedora Release Engineering - 0.99.6-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + * Wed Jul 22 2009 Richard W.M. Jones - 0.99.6-12 - Two^W Three more patches from Jim Meyering to improve general code quality. From e5c8a85e8bb139f53295135e24fce9f3083d50b5 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 25 Nov 2009 22:47:31 +0000 Subject: [PATCH 16/65] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 28e8111..6e31217 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: chntpw -# $Id$ +# $Id: Makefile,v 1.1 2008/10/13 01:53:26 kevin Exp $ NAME := chntpw SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From 291030fe46d054b7e4b16281342ef323825c5773 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:29:19 +0000 Subject: [PATCH 17/65] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 28e8111..6e31217 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: chntpw -# $Id$ +# $Id: Makefile,v 1.1 2008/10/13 01:53:26 kevin Exp $ NAME := chntpw SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From d64202c304855bc0227121e7699a14942aa8a7c0 Mon Sep 17 00:00:00 2001 From: konradm Date: Tue, 8 Jun 2010 04:41:22 +0000 Subject: [PATCH 18/65] - Upstream changed hosts; fixed URL and Source0. --- chntpw.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/chntpw.spec b/chntpw.spec index beeea4e..6188242 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,12 +1,12 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 13%{?dist} +Release: 14%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 -URL: http://home.eunet.no/~pnordahl/ntpasswd/ -Source0: http://home.eunet.no/~pnordahl/ntpasswd/chntpw-source-080526.zip +URL: http://pogostick.net/~pnh/ntpasswd/ +Source0: http://pogostick.net/~pnh/ntpasswd/chntpw-source-080526.zip Source2: chntpw-README.Dist # The man page is borrowed from Debian Source3: chntpw-chntpw.8 @@ -86,6 +86,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Jun 7 2010 Conrad Meyer - 0.99.6-14 +- Upstream changed hosts; fixed URL and Source0. + * Fri Jul 24 2009 Fedora Release Engineering - 0.99.6-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild From 8d9a4d3b7b6b72492f47a145f472a6bbc28c6841 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 28 Jul 2010 11:43:02 +0000 Subject: [PATCH 19/65] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 6e31217..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: chntpw -# $Id: Makefile,v 1.1 2008/10/13 01:53:26 kevin Exp $ -NAME := chntpw -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index dc32377..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -F-10 From e8104490de1b8537cfdb669974f434b423dbe2ae Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 28 Jul 2010 11:43:03 +0000 Subject: [PATCH 20/65] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- import.log | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 import.log diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 6e31217..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: chntpw -# $Id: Makefile,v 1.1 2008/10/13 01:53:26 kevin Exp $ -NAME := chntpw -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/import.log b/import.log deleted file mode 100644 index aff7d5f..0000000 --- a/import.log +++ /dev/null @@ -1 +0,0 @@ -chntpw-0_99_6-4_fc9:HEAD:chntpw-0.99.6-4.fc9.src.rpm:1223863802 From 38f2b5cb328d8ed37bad73d71bce6d874e2d56e8 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 8 Feb 2011 02:32:54 -0600 Subject: [PATCH 21/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 6188242..717753f 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 14%{?dist} +Release: 15%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -86,6 +86,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Feb 08 2011 Fedora Release Engineering - 0.99.6-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + * Mon Jun 7 2010 Conrad Meyer - 0.99.6-14 - Upstream changed hosts; fixed URL and Source0. From fd64259e8ca1784adea3104941cb14125154a971 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Tue, 1 Nov 2011 13:41:41 -0700 Subject: [PATCH 22/65] Update chntpw to latest upstream (110511). Rhbz# 750005 --- .gitignore | 1 + ...w-080526-detect-failure-to-write-key.patch | 77 -------- chntpw-080526-get_abs_path.patch | 29 --- chntpw-080526-keyname-overflow.patch | 22 --- chntpw-080526-no-value.patch | 41 ---- chntpw-080526-reged-no-deref-null.patch | 70 ------- chntpw-080526-robustness.patch | 182 ------------------ ...w-110511-detect-failure-to-write-key.patch | 19 ++ chntpw-110511-get_abs_path.patch | 11 ++ ... chntpw-110511-port-to-gcrypt-debian.patch | 45 ++--- chntpw-110511-reged-no-deref-null.patch | 15 ++ chntpw-110511-robustness.patch | 38 ++++ chntpw.spec | 28 +-- sources | 2 +- 14 files changed, 118 insertions(+), 462 deletions(-) delete mode 100644 chntpw-080526-detect-failure-to-write-key.patch delete mode 100644 chntpw-080526-get_abs_path.patch delete mode 100644 chntpw-080526-keyname-overflow.patch delete mode 100644 chntpw-080526-no-value.patch delete mode 100644 chntpw-080526-reged-no-deref-null.patch delete mode 100644 chntpw-080526-robustness.patch create mode 100644 chntpw-110511-detect-failure-to-write-key.patch create mode 100644 chntpw-110511-get_abs_path.patch rename chntpw-080526-port-to-gcrypt-debian.patch => chntpw-110511-port-to-gcrypt-debian.patch (82%) create mode 100644 chntpw-110511-reged-no-deref-null.patch create mode 100644 chntpw-110511-robustness.patch diff --git a/.gitignore b/.gitignore index 94616b3..d7701df 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ chntpw-source-080526.zip +/chntpw-source-110511.zip diff --git a/chntpw-080526-detect-failure-to-write-key.patch b/chntpw-080526-detect-failure-to-write-key.patch deleted file mode 100644 index ea17219..0000000 --- a/chntpw-080526-detect-failure-to-write-key.patch +++ /dev/null @@ -1,77 +0,0 @@ -From jim@meyering.net Mon Jul 20 20:12:31 2009 -Return-Path: jim@meyering.net -X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on amd.home.annexia.org -X-Spam-Level: -X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00, - UNPARSEABLE_RELAY autolearn=ham version=3.2.5 -Received: from mail.corp.redhat.com [10.5.5.51] - by amd.home.annexia.org with IMAP (fetchmail-6.3.8) - for (single-drop); Mon, 20 Jul 2009 20:12:31 +0100 (BST) -Received: from zmta03.collab.prod.int.phx2.redhat.com (LHLO - zmta03.collab.prod.int.phx2.redhat.com) (10.5.5.33) by - mail06.corp.redhat.com with LMTP; Mon, 20 Jul 2009 15:12:17 -0400 (EDT) -Received: from localhost (localhost.localdomain [127.0.0.1]) - by zmta03.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 3C1A04E4EC - for ; Mon, 20 Jul 2009 15:12:17 -0400 (EDT) -Received: from zmta03.collab.prod.int.phx2.redhat.com ([127.0.0.1]) - by localhost (zmta03.collab.prod.int.phx2.redhat.com [127.0.0.1]) (amavisd-new, port 10024) - with ESMTP id a+PpYwgPRjqW for ; - Mon, 20 Jul 2009 15:12:17 -0400 (EDT) -Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) - by zmta03.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 130A44E4D6 - for ; Mon, 20 Jul 2009 15:12:17 -0400 (EDT) -Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) - by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6KJCGMZ001977 - for ; Mon, 20 Jul 2009 15:12:16 -0400 -Received: from mx.meyering.net (sebastian-int.corp.redhat.com [172.16.52.221]) - by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6KJCF82022169 - for ; Mon, 20 Jul 2009 15:12:15 -0400 -Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) - id 36C5D38154; Mon, 20 Jul 2009 21:12:15 +0200 (CEST) -From: Jim Meyering -To: "Richard W. M. Jones" -Subject: chntpw [PATCH] detect/diagnose failure to write key -Date: Mon, 20 Jul 2009 21:12:15 +0200 -Message-ID: <873a8r88z4.fsf@meyering.net> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 -Status: RO -Content-Length: 938 -Lines: 34 - -Hi Rich, here's another. - ->From 057c832cf924cabf887e59d1c1f2127cd4619572 Mon Sep 17 00:00:00 2001 -From: Jim Meyering -Date: Mon, 20 Jul 2009 15:09:26 -0400 -Subject: [PATCH] detect/diagnose failure to write key - -* ntreg.c (export_key): Detect stream write failure. ---- - ntreg.c | 9 ++++++++- - 1 files changed, 8 insertions(+), 1 deletions(-) - -diff --git a/ntreg.c b/ntreg.c -index 21cd3e3..cdb6503 100644 ---- a/ntreg.c -+++ b/ntreg.c -@@ -2735,7 +2735,14 @@ void export_key(struct hive *hdesc, int nkofs, char *name, char *filename, char - fprintf(file, "Windows Registry Editor Version 5.00\r\n\r\n"); - export_subkey(hdesc, nkofs, name, prefix, file); - -- fclose(file); -+ if (ferror (file)) { -+ printf("failed to write file '%s'\n", filename); -+ fclose (file); -+ return; -+ } -+ if (fclose(file)) -+ printf("failed to write file '%s': %s\n", filename, -+ strerror(errno)); - } - - --- -1.6.2.5 - diff --git a/chntpw-080526-get_abs_path.patch b/chntpw-080526-get_abs_path.patch deleted file mode 100644 index 4a754cd..0000000 --- a/chntpw-080526-get_abs_path.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff -ur chntpw-080526/ntreg.c chntpw-080526.get_abs_path/ntreg.c ---- chntpw-080526/ntreg.c 2009-06-08 14:32:00.000000000 +0100 -+++ chntpw-080526.get_abs_path/ntreg.c 2009-06-08 14:30:08.000000000 +0100 -@@ -1193,7 +1193,7 @@ - { - /* int newnkofs; */ - struct nk_key *key; -- char tmp[ABSPATHLEN+1]; -+ char tmp[ABSPATHLEN]; - - maxlen = (maxlen < ABSPATHLEN ? maxlen : ABSPATHLEN); - -@@ -1209,6 +1209,7 @@ - } - - strncpy(tmp,path,ABSPATHLEN-1); -+ tmp[ABSPATHLEN-1] = '\0'; - - if ( (strlen(path) + key->len_name) >= maxlen-6) { - snprintf(path,maxlen,"(...)%s",tmp); -@@ -1216,7 +1217,7 @@ - } - *path = '\\'; - memcpy(path+1,key->keyname,key->len_name); -- strncpy(path+key->len_name+1,tmp,maxlen); -+ strcpy(path+key->len_name+1,tmp); - return(get_abs_path(hdesc, key->ofs_parent+0x1004, path, maxlen)); /* go back one more */ - } - diff --git a/chntpw-080526-keyname-overflow.patch b/chntpw-080526-keyname-overflow.patch deleted file mode 100644 index 345a4cf..0000000 --- a/chntpw-080526-keyname-overflow.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -ur chntpw-080526/ntreg.c chntpw-080526.keyname/ntreg.c ---- chntpw-080526/ntreg.c 2008-05-26 20:59:44.000000000 +0100 -+++ chntpw-080526.keyname/ntreg.c 2009-06-08 12:00:00.000000000 +0100 -@@ -2607,7 +2607,6 @@ - int count = 0; - int countri = 0; - int len, byte; -- char keyname[128]; - char path[1024]; - char *value; - struct nk_key *key; -@@ -2626,10 +2625,6 @@ - - // get the key - key = (struct nk_key *)(hdesc->buffer + nkofs); -- strncpy(keyname, key->keyname, key->len_name); -- keyname[key->len_name] = '\0'; -- printf("Exporting key '%s' with %d subkeys and %d values...\n", -- keyname, key->no_subkeys, key->no_values); - - *path = 0; - get_abs_path(hdesc, nkofs, path, 1024); diff --git a/chntpw-080526-no-value.patch b/chntpw-080526-no-value.patch deleted file mode 100644 index 5bb2048..0000000 --- a/chntpw-080526-no-value.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff -ur chntpw-080526/ntreg.c chntpw-080526.novalue/ntreg.c ---- chntpw-080526/ntreg.c 2009-06-08 14:44:09.000000000 +0100 -+++ chntpw-080526.novalue/ntreg.c 2009-06-08 14:43:48.000000000 +0100 -@@ -2667,21 +2667,23 @@ - value = (char *)get_val_data(hdesc, nkofs, vex.name, vex.type, TPF_VK_EXACT); - len = get_val_len(hdesc, nkofs, vex.name, TPF_VK_EXACT); - -- if (vex.type == REG_BINARY) { -- fprintf(file, "\"%s\"=hex:", vex.name); -- } else { -- fprintf(file, "\"%s\"=hex(%x):", vex.name, vex.type); -- } -- byte = 0; -- while (byte < len) { /* go byte by byte.. probably slow.. */ -- fprintf(file, "%02x,", (unsigned char)value[byte]); -- byte++; -- if (!(byte % 20)) fprintf(file, "\\\r\n "); -- } -- fprintf(file, "%02x\r\n", (unsigned char)value[byte]); -- } -+ if (value && len >= 0) { -+ if (vex.type == REG_BINARY) { -+ fprintf(file, "\"%s\"=hex:", vex.name); -+ } else { -+ fprintf(file, "\"%s\"=hex(%x):", vex.name, vex.type); -+ } -+ byte = 0; -+ while (byte < len) { /* go byte by byte.. probably slow.. */ -+ fprintf(file, "%02x,", (unsigned char)value[byte]); -+ byte++; -+ if (!(byte % 20)) fprintf(file, "\\\r\n "); -+ } -+ fprintf(file, "%02x\r\n", (unsigned char)value[byte]); - -- FREE(vex.name); -+ FREE(vex.name); -+ } -+ } - } - } - diff --git a/chntpw-080526-reged-no-deref-null.patch b/chntpw-080526-reged-no-deref-null.patch deleted file mode 100644 index 9bd681e..0000000 --- a/chntpw-080526-reged-no-deref-null.patch +++ /dev/null @@ -1,70 +0,0 @@ -From jim@meyering.net Wed Jul 22 13:41:58 2009 -Return-Path: jim@meyering.net -X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on amd.home.annexia.org -X-Spam-Level: -X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00, - UNPARSEABLE_RELAY autolearn=ham version=3.2.5 -Received: from mail.corp.redhat.com [10.5.5.51] - by amd.home.annexia.org with IMAP (fetchmail-6.3.8) - for (single-drop); Wed, 22 Jul 2009 13:41:58 +0100 (BST) -Received: from zmta01.collab.prod.int.phx2.redhat.com (LHLO - zmta01.collab.prod.int.phx2.redhat.com) (10.5.5.31) by - mail06.corp.redhat.com with LMTP; Wed, 22 Jul 2009 08:41:25 -0400 (EDT) -Received: from localhost (localhost.localdomain [127.0.0.1]) - by zmta01.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 52E8193C42 - for ; Wed, 22 Jul 2009 08:41:25 -0400 (EDT) -Received: from zmta01.collab.prod.int.phx2.redhat.com ([127.0.0.1]) - by localhost (zmta01.collab.prod.int.phx2.redhat.com [127.0.0.1]) (amavisd-new, port 10024) - with ESMTP id i+F0NOkWPqt0 for ; - Wed, 22 Jul 2009 08:41:25 -0400 (EDT) -Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) - by zmta01.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 29C8193C01 - for ; Wed, 22 Jul 2009 08:41:25 -0400 (EDT) -Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) - by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6MCfOiN011483 - for ; Wed, 22 Jul 2009 08:41:24 -0400 -Received: from mx.meyering.net (sebastian-int.corp.redhat.com [172.16.52.221]) - by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6MCfNP5023290 - for ; Wed, 22 Jul 2009 08:41:23 -0400 -Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) - id 38377558B9; Wed, 22 Jul 2009 14:41:23 +0200 (CEST) -From: Jim Meyering -To: "Richard W. M. Jones" -Subject: [PATCH] "reged -e" should not dereference NULL -Date: Wed, 22 Jul 2009 14:41:23 +0200 -Message-ID: <87y6qg51qk.fsf@meyering.net> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 -Status: RO -Content-Length: 871 -Lines: 27 - - ->From d9203daf8e29290ca82b2433722e9e56cd0ab73f Mon Sep 17 00:00:00 2001 -From: Jim Meyering -Date: Wed, 22 Jul 2009 14:25:14 +0200 -Subject: [PATCH] "reged -e" should not dereference NULL - -* reged.c (main): Diagnose a missing hive file name with -e. ---- - reged.c | 30 +++++++++++++++++------------- - 1 files changed, 17 insertions(+), 13 deletions(-) - -diff --git a/reged.c b/reged.c -index cf395bc..f99f94e 100644 ---- a/reged.c -+++ b/reged.c -@@ -99,6 +99,11 @@ int main(int argc, char **argv) - } - if (edit) { /* Call editor. Rest of arguments are considered hives to load */ - hivename = argv[optind+no_hives]; -+ if (!hivename) { -+ fprintf(stderr,"with -e you must specify at least one hive file name\n"); -+ usage(); -+ exit(1); -+ } - do { - if (!(hive[no_hives] = openHive(hivename, - HMODE_RW|mode))) { - diff --git a/chntpw-080526-robustness.patch b/chntpw-080526-robustness.patch deleted file mode 100644 index 531bf52..0000000 --- a/chntpw-080526-robustness.patch +++ /dev/null @@ -1,182 +0,0 @@ -From jim@meyering.net Mon Jul 20 16:46:56 2009 -Return-Path: jim@meyering.net -X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on amd.home.annexia.org -X-Spam-Level: -X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00, - UNPARSEABLE_RELAY autolearn=ham version=3.2.5 -Received: from mail.corp.redhat.com [10.5.5.51] - by amd.home.annexia.org with IMAP (fetchmail-6.3.8) - for (single-drop); Mon, 20 Jul 2009 16:46:56 +0100 (BST) -Received: from zmta02.collab.prod.int.phx2.redhat.com (LHLO - zmta02.collab.prod.int.phx2.redhat.com) (10.5.5.32) by - mail06.corp.redhat.com with LMTP; Mon, 20 Jul 2009 11:31:43 -0400 (EDT) -Received: from localhost (localhost.localdomain [127.0.0.1]) - by zmta02.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 27CD09E195 - for ; Mon, 20 Jul 2009 11:31:43 -0400 (EDT) -Received: from zmta02.collab.prod.int.phx2.redhat.com ([127.0.0.1]) - by localhost (zmta02.collab.prod.int.phx2.redhat.com [127.0.0.1]) (amavisd-new, port 10024) - with ESMTP id TTbuqA5poqWA for ; - Mon, 20 Jul 2009 11:31:43 -0400 (EDT) -Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) - by zmta02.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 087319E193 - for ; Mon, 20 Jul 2009 11:31:43 -0400 (EDT) -Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) - by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n6KFVfBF002494 - for ; Mon, 20 Jul 2009 11:31:42 -0400 -Received: from mx.meyering.net (sebastian-int.corp.redhat.com [172.16.52.221]) - by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6KFVeiP013799 - for ; Mon, 20 Jul 2009 11:31:41 -0400 -Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) - id D157838154; Mon, 20 Jul 2009 17:31:40 +0200 (CEST) -From: Jim Meyering -To: "Richard W. M. Jones" -Subject: chntpw patches -Date: Mon, 20 Jul 2009 17:31:40 +0200 -Message-ID: <87my6z8j6r.fsf@meyering.net> -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 -Status: RO -Content-Length: 4197 -Lines: 140 - -Hi Rich, - -The first two were spotted via inspection. -The 3rd one was to address this: - - $ : > j && valgrind ./reged -e j - ~/w/co/chntpw: - ==16084== Memcheck, a memory error detector. - ==16084== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al. - ==16084== Using LibVEX rev 1884, a library for dynamic binary translation. - ==16084== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP. - ==16084== Using valgrind-3.4.1, a dynamic binary instrumentation framework. - ==16084== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al. - ==16084== For more details, rerun with: -v - ==16084== - reged version 0.1 080526, (c) Petter N Hagen - ==16084== Invalid read of size 4 - ==16084== at 0x407D09: openHive (ntreg.c:2856) - ==16084== by 0x4011E3: main (reged.c:103) - ==16084== Address 0x4c230d8 is 0 bytes after a block of size 0 alloc'd - ==16084== at 0x4A05414: calloc (vg_replace_malloc.c:397) - ==16084== by 0x407C5C: openHive (ntreg.c:2840) - ==16084== by 0x4011E3: main (reged.c:103) - openHive(j): File does not seem to be a registry hive! - Simple registry editor. ? for help. - ==16084== - ==16084== Invalid read of size 2 - ==16084== at 0x403C4D: get_abs_path (ntreg.c:1204) - ==16084== by 0x408D57: regedit_interactive (edlib.c:379) - ==16084== by 0x401277: main (reged.c:111) - ==16084== Address 0x4c230dc is 4 bytes after a block of size 0 alloc'd - ==16084== at 0x4A05414: calloc (vg_replace_malloc.c:397) - ==16084== by 0x407C5C: openHive (ntreg.c:2840) - ==16084== by 0x4011E3: main (reged.c:103) - get_abs_path: Not a 'nk' node! - - > - - - ->From 5c287bb158db10af96b1f1f67d4df49a47323b94 Mon Sep 17 00:00:00 2001 -From: Jim Meyering -Date: Mon, 20 Jul 2009 09:57:13 -0400 -Subject: [PATCH 1/3] improved robustness - -* ntreg.c (fmyinput): Don't clobber ibuf[-1] upon NUL input. ---- - ntreg.c | 8 +++++--- - 1 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/ntreg.c b/ntreg.c -index e27a5b9..1b84410 100644 ---- a/ntreg.c -+++ b/ntreg.c -@@ -82,14 +82,16 @@ char *str_dup( const char *str ) - - int fmyinput(char *prmpt, char *ibuf, int maxlen) - { -- -+ int len; - printf("%s",prmpt); - - fgets(ibuf,maxlen+1,stdin); -+ len = strlen(ibuf); - -- ibuf[strlen(ibuf)-1] = 0; -+ if (len) -+ ibuf[len-1] = 0; - -- return(strlen(ibuf)); -+ return len; - } - - /* Print len number of hexbytes */ --- -1.6.2.5 - - ->From b9bfb44aa1bff1f9b7badf65425f8190352966a0 Mon Sep 17 00:00:00 2001 -From: Jim Meyering -Date: Mon, 20 Jul 2009 10:04:23 -0400 -Subject: [PATCH 2/3] robustness: avoid low-memory segfault - -* ntreg.c (convert_string): Don't segfault upon low memory. ---- - ntreg.c | 5 ++++- - 1 files changed, 4 insertions(+), 1 deletions(-) - -diff --git a/ntreg.c b/ntreg.c -index 1b84410..08f9124 100644 ---- a/ntreg.c -+++ b/ntreg.c -@@ -2585,7 +2585,10 @@ char * convert_string(void *string, int len) - int i, k; - int reallen = len / 2; - char *cstring = (char *)malloc(reallen); -- -+ if (cstring == NULL) { -+ printf("FATAL! convert_string: malloc() failed! Out of memory?\n"); -+ abort(); -+ } - for(i = 0, k = 0; i < len; i += 2, k++) - { - cstring[k] = ((char *)string)[i]; --- -1.6.2.5 - - ->From 81ae3189a8dffcdb3db7229cbe992ed12b8d1327 Mon Sep 17 00:00:00 2001 -From: Jim Meyering -Date: Mon, 20 Jul 2009 11:04:38 -0400 -Subject: [PATCH 3/3] robustness: avoid malfunction for too-small hive file - -* ntreg.c (openHive): Don't read uninitialized when file is too small. ---- - ntreg.c | 8 ++++++++ - 1 files changed, 8 insertions(+), 0 deletions(-) - -diff --git a/ntreg.c b/ntreg.c -index 08f9124..be6b680 100644 ---- a/ntreg.c -+++ b/ntreg.c -@@ -2847,6 +2847,14 @@ struct hive *openHive(char *filename, int mode) - return(NULL); - } - -+ if (r < sizeof (*hdesc)) { -+ fprintf(stderr, -+ "file is too small; got %d bytes while expecting %d or more\n", -+ r, sizeof (*hdesc)); -+ closeHive(hdesc); -+ return(NULL); -+ } -+ - /* Now run through file, tallying all pages */ - /* NOTE/KLUDGE: Assume first page starts at offset 0x1000 */ - --- -1.6.2.5 - diff --git a/chntpw-110511-detect-failure-to-write-key.patch b/chntpw-110511-detect-failure-to-write-key.patch new file mode 100644 index 0000000..818639d --- /dev/null +++ b/chntpw-110511-detect-failure-to-write-key.patch @@ -0,0 +1,19 @@ +diff -ur chntpw-110511.orig/ntreg.c chntpw-110511/ntreg.c +--- chntpw-110511.orig/ntreg.c 2011-05-11 12:33:56.000000000 -0700 ++++ chntpw-110511/ntreg.c 2011-11-01 13:45:02.550421729 -0700 +@@ -3389,7 +3389,14 @@ + + fprintf(file,"\r\n"); /* Must end file with an empty line, windows does that */ + +- fclose(file); ++ if (ferror (file)) { ++ printf("failed to write file '%s'\n", filename); ++ fclose (file); ++ return; ++ } ++ if (fclose(file)) ++ printf("failed to write file '%s': %s\n", filename, ++ strerror(errno)); + } + + /* ================================================================ */ diff --git a/chntpw-110511-get_abs_path.patch b/chntpw-110511-get_abs_path.patch new file mode 100644 index 0000000..dabcb3e --- /dev/null +++ b/chntpw-110511-get_abs_path.patch @@ -0,0 +1,11 @@ +diff -ur chntpw-110511.orig/ntreg.c chntpw-110511/ntreg.c +--- chntpw-110511.orig/ntreg.c 2011-05-11 12:33:56.000000000 -0700 ++++ chntpw-110511/ntreg.c 2011-11-01 13:36:13.362856892 -0700 +@@ -1436,6 +1436,7 @@ + } + + strncpy(tmp,path,ABSPATHLEN-1); ++ tmp[ABSPATHLEN-1] = '\0'; + + if (key->type & 0x20) + keyname = mem_str(key->keyname, key->len_name); diff --git a/chntpw-080526-port-to-gcrypt-debian.patch b/chntpw-110511-port-to-gcrypt-debian.patch similarity index 82% rename from chntpw-080526-port-to-gcrypt-debian.patch rename to chntpw-110511-port-to-gcrypt-debian.patch index 217341d..eb053aa 100644 --- a/chntpw-080526-port-to-gcrypt-debian.patch +++ b/chntpw-110511-port-to-gcrypt-debian.patch @@ -1,18 +1,7 @@ -Original patch from Debian: -http://patch-tracking.debian.net/patch/series/view/chntpw/0.99.5-0+nmu1/01_port_to_gcrypt.patch - -Written by Paul Wise. - -Ported to Fedora build by Richard W.M. Jones. - -Also compiles the program as 64 bit. I see no reason why the '-m32' -flag was supplied. Building on 64 bit produces a working program -as far as I can tell. - -diff -ur chntpw-080526.orig/chntpw.c chntpw-080526.gcrypt/chntpw.c ---- chntpw-080526.orig/chntpw.c 2008-05-26 20:59:44.000000000 +0100 -+++ chntpw-080526.gcrypt/chntpw.c 2009-06-09 12:39:58.037690367 +0100 -@@ -61,12 +61,19 @@ +diff -ur chntpw-110511.orig/chntpw.c chntpw-110511/chntpw.c +--- chntpw-110511.orig/chntpw.c 2011-05-11 12:33:56.000000000 -0700 ++++ chntpw-110511/chntpw.c 2011-11-01 13:32:10.596579799 -0700 +@@ -65,12 +65,19 @@ #include #include @@ -33,7 +22,7 @@ diff -ur chntpw-080526.orig/chntpw.c chntpw-080526.gcrypt/chntpw.c #include "ntreg.h" #include "sam.h" -@@ -138,7 +145,9 @@ +@@ -142,7 +149,9 @@ for (i=0;i<8;i++) { key[i] = (key[i]<<1); } @@ -43,7 +32,7 @@ diff -ur chntpw-080526.orig/chntpw.c chntpw-080526.gcrypt/chntpw.c } /* -@@ -183,6 +192,7 @@ +@@ -187,6 +196,7 @@ void E1(uchar *k, uchar *d, uchar *out) { @@ -51,7 +40,7 @@ diff -ur chntpw-080526.orig/chntpw.c chntpw-080526.gcrypt/chntpw.c des_key_schedule ks; des_cblock deskey; -@@ -193,6 +203,15 @@ +@@ -197,6 +207,15 @@ des_set_key((des_cblock *)deskey,ks); #endif /* __FreeBsd__ */ des_ecb_encrypt((des_cblock *)d,(des_cblock *)out, ks, DES_ENCRYPT); @@ -67,7 +56,7 @@ diff -ur chntpw-080526.orig/chntpw.c chntpw-080526.gcrypt/chntpw.c } -@@ -500,10 +519,18 @@ +@@ -504,10 +523,18 @@ int dontchange = 0; struct user_V *v; @@ -86,7 +75,7 @@ diff -ur chntpw-080526.orig/chntpw.c chntpw-080526.gcrypt/chntpw.c unsigned char digest[16]; unsigned short acb; -@@ -617,6 +644,7 @@ +@@ -621,6 +648,7 @@ hexprnt("Crypted LM pw: ",(unsigned char *)(vp+lmpw_offs),16); } @@ -94,7 +83,7 @@ diff -ur chntpw-080526.orig/chntpw.c chntpw-080526.gcrypt/chntpw.c /* Get the two decrpt keys. */ sid_to_key1(rid,(unsigned char *)deskey1); des_set_key((des_cblock *)deskey1,ks1); -@@ -634,6 +662,25 @@ +@@ -638,6 +666,25 @@ (des_cblock *)lanman, ks1, DES_DECRYPT); des_ecb_encrypt((des_cblock *)(vp+lmpw_offs + 8), (des_cblock *)&lanman[8], ks2, DES_DECRYPT); @@ -120,7 +109,7 @@ diff -ur chntpw-080526.orig/chntpw.c chntpw-080526.gcrypt/chntpw.c if (gverbose) { hexprnt("MD4 hash : ",(unsigned char *)md4,16); -@@ -689,9 +736,17 @@ +@@ -693,9 +740,17 @@ /* printf("Ucase Lanman: %s\n",newlanpw); */ @@ -138,7 +127,7 @@ diff -ur chntpw-080526.orig/chntpw.c chntpw-080526.gcrypt/chntpw.c if (gverbose) hexprnt("\nNEW MD4 hash : ",digest,16); -@@ -700,6 +755,7 @@ +@@ -704,6 +759,7 @@ if (gverbose) hexprnt("NEW LANMAN hash : ",(unsigned char *)lanman,16); @@ -146,7 +135,7 @@ diff -ur chntpw-080526.orig/chntpw.c chntpw-080526.gcrypt/chntpw.c /* Encrypt the NT md4 password hash as two 8 byte blocks. */ des_ecb_encrypt((des_cblock *)digest, (des_cblock *)despw, ks1, DES_ENCRYPT); -@@ -710,6 +766,18 @@ +@@ -714,6 +770,18 @@ (des_cblock *)newlandes, ks1, DES_ENCRYPT); des_ecb_encrypt((des_cblock *)(lanman+8), (des_cblock *)&newlandes[8], ks2, DES_ENCRYPT); @@ -165,9 +154,9 @@ diff -ur chntpw-080526.orig/chntpw.c chntpw-080526.gcrypt/chntpw.c if (gverbose) { hexprnt("NEW DES crypt : ",(unsigned char *)despw,16); -diff -ur chntpw-080526.orig/Makefile chntpw-080526.gcrypt/Makefile ---- chntpw-080526.orig/Makefile 2008-05-26 20:59:44.000000000 +0100 -+++ chntpw-080526.gcrypt/Makefile 2009-06-09 12:45:07.798728999 +0100 +diff -ur chntpw-110511.orig/Makefile chntpw-110511/Makefile +--- chntpw-110511.orig/Makefile 2011-05-11 12:33:56.000000000 -0700 ++++ chntpw-110511/Makefile 2011-11-01 13:32:10.598579767 -0700 @@ -1,28 +1,11 @@ # # Makefile for the Offline NT Password Editor @@ -185,7 +174,7 @@ diff -ur chntpw-080526.orig/Makefile chntpw-080526.gcrypt/Makefile +CFLAGS=-DUSELIBGCRYPT -g -I. $(shell libgcrypt-config --cflags) -Wall $(EXTRA_CFLAGS) -# Force 32 bit --CFLAGS= -DUSEOPENSSL -g -I. -I$(OSSLINC) -Wall -m32 +-CFLAGS= -DUSEOPENSSL -g -I. -I$(OSSLINC) -Wall -m32 -OSSLLIB=$(OSSLPATH)/lib - -# 64 bit if default for compiler setup diff --git a/chntpw-110511-reged-no-deref-null.patch b/chntpw-110511-reged-no-deref-null.patch new file mode 100644 index 0000000..0193cd4 --- /dev/null +++ b/chntpw-110511-reged-no-deref-null.patch @@ -0,0 +1,15 @@ +diff -ur chntpw-110511.orig/reged.c chntpw-110511/reged.c +--- chntpw-110511.orig/reged.c 2011-05-11 12:33:56.000000000 -0700 ++++ chntpw-110511/reged.c 2011-11-01 13:46:55.569625286 -0700 +@@ -167,6 +167,11 @@ + + if (edit) { /* Call editor. Rest of arguments are considered hives to load */ + hivename = argv[optind+no_hives]; ++ if (!hivename) { ++ fprintf(stderr,"with -e you must specify at least one hive file name\n"); ++ usage(); ++ exit(1); ++ } + do { + if (!(hive[no_hives] = openHive(hivename, + HMODE_RW|mode))) { diff --git a/chntpw-110511-robustness.patch b/chntpw-110511-robustness.patch new file mode 100644 index 0000000..11ea781 --- /dev/null +++ b/chntpw-110511-robustness.patch @@ -0,0 +1,38 @@ +diff -ur chntpw-110511.orig/ntreg.c chntpw-110511/ntreg.c +--- chntpw-110511.orig/ntreg.c 2011-05-11 12:33:56.000000000 -0700 ++++ chntpw-110511/ntreg.c 2011-11-01 13:42:22.125974945 -0700 +@@ -190,14 +190,16 @@ + + int fmyinput(char *prmpt, char *ibuf, int maxlen) + { +- ++ int len; + printf("%s",prmpt); + + fgets(ibuf,maxlen+1,stdin); ++ len = strlen(ibuf); + +- ibuf[strlen(ibuf)-1] = 0; ++ if (len) ++ ibuf[len-1] = 0; + +- return(strlen(ibuf)); ++ return len; + } + + /* Print len number of hexbytes */ +@@ -4120,6 +4122,14 @@ + return(NULL); + } + ++ if (r < sizeof (*hdesc)) { ++ fprintf(stderr, ++ "file is too small; got %d bytes while expecting %d or more\n", ++ r, sizeof (*hdesc)); ++ closeHive(hdesc); ++ return(NULL); ++ } ++ + /* Now run through file, tallying all pages */ + /* NOTE/KLUDGE: Assume first page starts at offset 0x1000 */ + diff --git a/chntpw.spec b/chntpw.spec index 717753f..7399cd6 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,12 +1,12 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 15%{?dist} +Release: 16.110511%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ -Source0: http://pogostick.net/~pnh/ntpasswd/chntpw-source-080526.zip +Source0: http://pogostick.net/~pnh/ntpasswd/chntpw-source-110511.zip Source2: chntpw-README.Dist # The man page is borrowed from Debian Source3: chntpw-chntpw.8 @@ -15,18 +15,16 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libgcrypt-devel # Patches sent upstream on 2009-06-08. -Patch0: chntpw-080526-keyname-overflow.patch -Patch1: chntpw-080526-get_abs_path.patch -Patch2: chntpw-080526-no-value.patch +Patch1: chntpw-110511-get_abs_path.patch # Patch from Debian (RHBZ#504595). -Patch3: chntpw-080526-port-to-gcrypt-debian.patch +Patch3: chntpw-110511-port-to-gcrypt-debian.patch # Patches from Jim Meyering to improve robustness of the code. -Patch4: chntpw-080526-robustness.patch +Patch4: chntpw-110511-robustness.patch Patch5: chntpw-080526-correct-test-for-failing-open-syscall.patch -Patch6: chntpw-080526-detect-failure-to-write-key.patch -Patch7: chntpw-080526-reged-no-deref-null.patch +Patch6: chntpw-110511-detect-failure-to-write-key.patch +Patch7: chntpw-110511-reged-no-deref-null.patch %description @@ -41,15 +39,13 @@ than password editing. %prep -%setup -q -n %{name}-080526 +%setup -q -n %{name}-110511 cp -p %{SOURCE2} README.Dist sed -e 's/\r$//' WinReg.txt > WinReg.txt.eol touch -c -r WinReg.txt WinReg.txt.eol mv WinReg.txt.eol WinReg.txt -%patch0 -p1 %patch1 -p1 -%patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 @@ -86,6 +82,14 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Nov 1 2011 Conrad Meyer - 0.99.6-16.110511 +- Update to latest upstream (110511) (#750005). +- Update fedora patches to apply cleanly, dropping useless hunks + as needed. +- Add upstream version to "Release" tag, so that people can + actually tell which version of upstream we're shipping from the + rpm version. + * Tue Feb 08 2011 Fedora Release Engineering - 0.99.6-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild diff --git a/sources b/sources index 954d9c8..585eeb4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -09addfe7ae469677da39ed66d83858d3 chntpw-source-080526.zip +a3fb358d1adec589cd6bc8dedf68896c chntpw-source-110511.zip From 13bf89e14642a0da681384de5b6360178c3f8d57 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Sun, 18 Dec 2011 17:14:42 -0800 Subject: [PATCH 23/65] Fix 'robustness' patch (#755622) --- chntpw-110511-robustness.patch | 17 +++++++++-------- chntpw.spec | 5 ++++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/chntpw-110511-robustness.patch b/chntpw-110511-robustness.patch index 11ea781..ea2363f 100644 --- a/chntpw-110511-robustness.patch +++ b/chntpw-110511-robustness.patch @@ -1,7 +1,6 @@ -diff -ur chntpw-110511.orig/ntreg.c chntpw-110511/ntreg.c --- chntpw-110511.orig/ntreg.c 2011-05-11 12:33:56.000000000 -0700 -+++ chntpw-110511/ntreg.c 2011-11-01 13:42:22.125974945 -0700 -@@ -190,14 +190,16 @@ ++++ chntpw-110511/ntreg.c 2011-12-18 17:09:06.290818997 -0800 +@@ -190,14 +190,18 @@ int fmyinput(char *prmpt, char *ibuf, int maxlen) { @@ -13,18 +12,21 @@ diff -ur chntpw-110511.orig/ntreg.c chntpw-110511/ntreg.c + len = strlen(ibuf); - ibuf[strlen(ibuf)-1] = 0; -+ if (len) ++ if (len) { + ibuf[len-1] = 0; ++ --len; ++ } - return(strlen(ibuf)); + return len; } /* Print len number of hexbytes */ -@@ -4120,6 +4122,14 @@ +@@ -4119,6 +4123,14 @@ + closeHive(hdesc); return(NULL); } - ++ + if (r < sizeof (*hdesc)) { + fprintf(stderr, + "file is too small; got %d bytes while expecting %d or more\n", @@ -32,7 +34,6 @@ diff -ur chntpw-110511.orig/ntreg.c chntpw-110511/ntreg.c + closeHive(hdesc); + return(NULL); + } -+ + /* Now run through file, tallying all pages */ /* NOTE/KLUDGE: Assume first page starts at offset 0x1000 */ - diff --git a/chntpw.spec b/chntpw.spec index 7399cd6..47b9014 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 16.110511%{?dist} +Release: 17.110511%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -82,6 +82,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sun Dec 18 2011 Conrad Meyer - 0.99.6-17.110511 +- Fix 'robustness' patch (#755622) + * Tue Nov 1 2011 Conrad Meyer - 0.99.6-16.110511 - Update to latest upstream (110511) (#750005). - Update fedora patches to apply cleanly, dropping useless hunks From 96bb3891730ec5fba5b22a0a9dea00dc2021aa37 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 12 Jan 2012 17:20:49 -0600 Subject: [PATCH 24/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 47b9014..253b818 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 17.110511%{?dist} +Release: 18.110511%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -82,6 +82,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Jan 12 2012 Fedora Release Engineering - 0.99.6-18.110511 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + * Sun Dec 18 2011 Conrad Meyer - 0.99.6-17.110511 - Fix 'robustness' patch (#755622) From d947db7377cb0ee87325fe1eb875647d81a14d7c Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 18 Jul 2012 13:57:33 -0500 Subject: [PATCH 25/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 253b818..2b373e9 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 18.110511%{?dist} +Release: 19.110511%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -82,6 +82,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Jul 18 2012 Fedora Release Engineering - 0.99.6-19.110511 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + * Thu Jan 12 2012 Fedora Release Engineering - 0.99.6-18.110511 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild From 7a11e2b33ef4142e0779211825d131ccf50fb04b Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 13 Feb 2013 12:28:48 -0600 Subject: [PATCH 26/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 2b373e9..2d38dab 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 19.110511%{?dist} +Release: 20.110511%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -82,6 +82,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Feb 13 2013 Fedora Release Engineering - 0.99.6-20.110511 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + * Wed Jul 18 2012 Fedora Release Engineering - 0.99.6-19.110511 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild From c00bf921a6fac07469fc02da3cd9c0fe385969dc Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 2 Aug 2013 23:51:50 -0500 Subject: [PATCH 27/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 2d38dab..8b608f2 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 20.110511%{?dist} +Release: 21.110511%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -82,6 +82,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sat Aug 03 2013 Fedora Release Engineering - 0.99.6-21.110511 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + * Wed Feb 13 2013 Fedora Release Engineering - 0.99.6-20.110511 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild From 184b6480e865870fa2bd9e864595b45a1b96f91e Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Wed, 23 Apr 2014 21:38:29 +0200 Subject: [PATCH 28/65] Rebuild for new libgcrypt --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 8b608f2..9309415 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 21.110511%{?dist} +Release: 22.110511%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -82,6 +82,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Apr 23 2014 Tomáš Mráz - 0.99.6-22.110511 +- Rebuild for new libgcrypt + * Sat Aug 03 2013 Fedora Release Engineering - 0.99.6-21.110511 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild From a7ad7fd24aebefa5210fbabc2572302d43b62063 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 6 Jun 2014 23:40:46 -0500 Subject: [PATCH 29/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 9309415..78462a3 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 22.110511%{?dist} +Release: 23.110511%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -82,6 +82,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sat Jun 07 2014 Fedora Release Engineering - 0.99.6-23.110511 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + * Wed Apr 23 2014 Tomáš Mráz - 0.99.6-22.110511 - Rebuild for new libgcrypt From 0613b3bac1e50cf1dba3e4a1f2e58d5ef38aae4a Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sat, 16 Aug 2014 00:07:37 +0000 Subject: [PATCH 30/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 78462a3..4c01aea 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 23.110511%{?dist} +Release: 24.110511%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -82,6 +82,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Sat Aug 16 2014 Fedora Release Engineering - 0.99.6-24.110511 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + * Sat Jun 07 2014 Fedora Release Engineering - 0.99.6-23.110511 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild From 838c56eb85dbebba8c074067c0e2546b99500dd3 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 17 Jun 2015 02:37:39 +0000 Subject: [PATCH 31/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 4c01aea..74cca4f 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 24.110511%{?dist} +Release: 25.110511%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -82,6 +82,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Jun 17 2015 Fedora Release Engineering - 0.99.6-25.110511 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Sat Aug 16 2014 Fedora Release Engineering - 0.99.6-24.110511 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild From dffd0e18623b4c3681852a444deac3b07f7120c1 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Wed, 3 Feb 2016 17:38:53 +0000 Subject: [PATCH 32/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 74cca4f..d7cef9e 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 25.110511%{?dist} +Release: 26.110511%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -82,6 +82,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Feb 03 2016 Fedora Release Engineering - 0.99.6-26.110511 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Wed Jun 17 2015 Fedora Release Engineering - 0.99.6-25.110511 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild From ef88d99fd120e307b27eea7e2ff22afc8f01943f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 10 Feb 2017 07:28:34 +0000 Subject: [PATCH 33/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index d7cef9e..c8f7d7a 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 26.110511%{?dist} +Release: 27.110511%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -82,6 +82,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Fri Feb 10 2017 Fedora Release Engineering - 0.99.6-27.110511 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Wed Feb 03 2016 Fedora Release Engineering - 0.99.6-26.110511 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild From 925305938b648214e7e71f1355c2cdeae48bbc9f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 26 Jul 2017 04:47:37 +0000 Subject: [PATCH 34/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index c8f7d7a..c619154 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 27.110511%{?dist} +Release: 28.110511%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -82,6 +82,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Jul 26 2017 Fedora Release Engineering - 0.99.6-28.110511 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Fri Feb 10 2017 Fedora Release Engineering - 0.99.6-27.110511 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild From d6858471c25b440f2d54900696f7d2eea4a11f6e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 2 Aug 2017 18:46:07 +0000 Subject: [PATCH 35/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index c619154..b5ad303 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 28.110511%{?dist} +Release: 29.110511%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -82,6 +82,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Aug 02 2017 Fedora Release Engineering - 0.99.6-29.110511 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + * Wed Jul 26 2017 Fedora Release Engineering - 0.99.6-28.110511 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From 3cd52955f8ab88154e5083103be1709b41256ef7 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 7 Feb 2018 04:53:50 +0000 Subject: [PATCH 36/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index b5ad303..e0e1c60 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 0.99.6 -Release: 29.110511%{?dist} +Release: 30.110511%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -82,6 +82,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Feb 07 2018 Fedora Release Engineering - 0.99.6-30.110511 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Wed Aug 02 2017 Fedora Release Engineering - 0.99.6-29.110511 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild From 3af51c225dbbb2070bab65a45b69ab24e34ab1ac Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 13 Feb 2018 23:08:30 +0100 Subject: [PATCH 37/65] Remove BuildRoot definition None of currently supported distributions need that. It was needed last for EL5 which is EOL now Signed-off-by: Igor Gnatenko --- chntpw.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index e0e1c60..9365aa4 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -10,7 +10,6 @@ Source0: http://pogostick.net/~pnh/ntpasswd/chntpw-source-110511.zip Source2: chntpw-README.Dist # The man page is borrowed from Debian Source3: chntpw-chntpw.8 -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libgcrypt-devel From a4d69bc7ce51709f6a9d5575f9297515f3923bc0 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 14 Feb 2018 07:54:51 +0100 Subject: [PATCH 38/65] Remove %clean section None of currently supported distributions need that. Last one was EL5 which is EOL for a while. Signed-off-by: Igor Gnatenko --- chntpw.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/chntpw.spec b/chntpw.spec index 9365aa4..a15760d 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -66,9 +66,6 @@ mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8/ cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_mandir}/man8/%{name}.8 -%clean -rm -rf $RPM_BUILD_ROOT - %files %defattr(-,root,root,-) From 247e1f803826be57febeb3d30518a7f9aeac475c Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Mon, 2 Jul 2018 20:53:10 -0700 Subject: [PATCH 39/65] Update to latest upstream, 1.00 / 140201 Rebase patches as needed Import additional and enhanced manual pages from Debian Adds two new binaries: sampasswd and samusrgrp Clean up rpmlint warnings (tabs, spelling, log date) --- .gitignore | 1 + chntpw-110511-get_abs_path.patch | 11 -- chntpw-140201-get_abs_path.patch | 10 ++ ... chntpw-140201-port-to-gcrypt-debian.patch | 83 ++++----- chntpw-chntpw.8 | 96 ----------- chntpw.8 | 157 ++++++++++++++++++ chntpw.spec | 48 ++++-- reged.8 | 120 +++++++++++++ sampasswd.8 | 120 +++++++++++++ samusrgrp.8 | 130 +++++++++++++++ sources | 2 +- 11 files changed, 613 insertions(+), 165 deletions(-) delete mode 100644 chntpw-110511-get_abs_path.patch create mode 100644 chntpw-140201-get_abs_path.patch rename chntpw-110511-port-to-gcrypt-debian.patch => chntpw-140201-port-to-gcrypt-debian.patch (76%) delete mode 100644 chntpw-chntpw.8 create mode 100644 chntpw.8 create mode 100644 reged.8 create mode 100644 sampasswd.8 create mode 100644 samusrgrp.8 diff --git a/.gitignore b/.gitignore index d7701df..20d7fc8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ chntpw-source-080526.zip /chntpw-source-110511.zip +/chntpw-source-140201.zip diff --git a/chntpw-110511-get_abs_path.patch b/chntpw-110511-get_abs_path.patch deleted file mode 100644 index dabcb3e..0000000 --- a/chntpw-110511-get_abs_path.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -ur chntpw-110511.orig/ntreg.c chntpw-110511/ntreg.c ---- chntpw-110511.orig/ntreg.c 2011-05-11 12:33:56.000000000 -0700 -+++ chntpw-110511/ntreg.c 2011-11-01 13:36:13.362856892 -0700 -@@ -1436,6 +1436,7 @@ - } - - strncpy(tmp,path,ABSPATHLEN-1); -+ tmp[ABSPATHLEN-1] = '\0'; - - if (key->type & 0x20) - keyname = mem_str(key->keyname, key->len_name); diff --git a/chntpw-140201-get_abs_path.patch b/chntpw-140201-get_abs_path.patch new file mode 100644 index 0000000..c9f1a3d --- /dev/null +++ b/chntpw-140201-get_abs_path.patch @@ -0,0 +1,10 @@ +--- chntpw-140201/ntreg.c.orig 2014-02-01 08:54:37.000000000 -0800 ++++ chntpw-140201/ntreg.c 2018-07-02 16:10:39.625152640 -0700 +@@ -1511,6 +1511,7 @@ + } + + strncpy(tmp,path,ABSPATHLEN-1); ++ tmp[ABSPATHLEN-1] = '\0'; + + if (key->type & 0x20) + keyname = mem_str(key->keyname, key->len_name); diff --git a/chntpw-110511-port-to-gcrypt-debian.patch b/chntpw-140201-port-to-gcrypt-debian.patch similarity index 76% rename from chntpw-110511-port-to-gcrypt-debian.patch rename to chntpw-140201-port-to-gcrypt-debian.patch index eb053aa..45adefb 100644 --- a/chntpw-110511-port-to-gcrypt-debian.patch +++ b/chntpw-140201-port-to-gcrypt-debian.patch @@ -1,28 +1,36 @@ -diff -ur chntpw-110511.orig/chntpw.c chntpw-110511/chntpw.c ---- chntpw-110511.orig/chntpw.c 2011-05-11 12:33:56.000000000 -0700 -+++ chntpw-110511/chntpw.c 2011-11-01 13:32:10.596579799 -0700 -@@ -65,12 +65,19 @@ - #include - #include +01_port_to_gcrypt.patch +Paul Wise +Placed in the public domain +Port to libgcrypt to avoid GPL/OpenSSL incompatibility +Forwarded to Petter Nordahl-Hagen +Updated by Philippe Coval for debian + +--- a/chntpw.c ++++ b/chntpw.c +@@ -16,6 +16,7 @@ + * 2010-jun: Syskey not visible in menu, but is selectable (2) + * 2010-apr: Interactive menu adapts to show most relevant + * selections based on what is loaded ++ * 2008-may: port to libgcrypt to avoid GPL/OpenSSL incompatibility [Debian] + * 2008-mar: Minor other tweaks + * 2008-mar: Interactive reg ed moved out of this file, into edlib.c + * 2008-mar: 64 bit compatible patch by Mike Doty, via Alon Bar-Lev +@@ -79,8 +80,14 @@ + */ + #ifdef DOCRYPTO +#if defined(USEOPENSSL) #include #include --#define uchar u_char - #define MD4Init MD4_Init - #define MD4Update MD4_Update - #define MD4Final MD4_Final +#elif defined(USELIBGCRYPT) + #include +#else + #error No DES encryption and MD4 hashing library found +#endif -+ -+#define uchar u_char + #endif - #include "ntreg.h" - #include "sam.h" -@@ -142,7 +149,9 @@ + #define uchar u_char +@@ -155,7 +162,9 @@ for (i=0;i<8;i++) { key[i] = (key[i]<<1); } @@ -32,7 +40,7 @@ diff -ur chntpw-110511.orig/chntpw.c chntpw-110511/chntpw.c } /* -@@ -187,6 +196,7 @@ +@@ -200,6 +209,7 @@ void E1(uchar *k, uchar *d, uchar *out) { @@ -40,7 +48,7 @@ diff -ur chntpw-110511.orig/chntpw.c chntpw-110511/chntpw.c des_key_schedule ks; des_cblock deskey; -@@ -197,6 +207,15 @@ +@@ -210,6 +220,15 @@ des_set_key((des_cblock *)deskey,ks); #endif /* __FreeBsd__ */ des_ecb_encrypt((des_cblock *)d,(des_cblock *)out, ks, DES_ENCRYPT); @@ -55,35 +63,33 @@ diff -ur chntpw-110511.orig/chntpw.c chntpw-110511/chntpw.c +#endif } - -@@ -504,10 +523,18 @@ - int dontchange = 0; - struct user_V *v; - + #endif /* DOCRYPTO */ +@@ -343,9 +362,16 @@ + int i; + char md4[32],lanman[32]; + char newunipw[34], despw[20], newlanpw[16], newlandes[20]; +#ifdef USEOPENSSL des_key_schedule ks1, ks2; des_cblock deskey1, deskey2; - MD4_CTX context; +#elif defined(USELIBGCRYPT) + gcry_cipher_hd_t ks1, ks2; + uchar deskey1[8], deskey2[8]; -+ + unsigned char *p; + gcry_md_hd_t context; +#endif unsigned char digest[16]; - unsigned short acb; - -@@ -621,6 +648,7 @@ - hexprnt("Crypted LM pw: ",(unsigned char *)(vp+lmpw_offs),16); + uchar x1[] = {0x4B,0x47,0x53,0x21,0x40,0x23,0x24,0x25}; + #endif +@@ -460,6 +486,7 @@ } + #ifdef DOCRYPTO +#if defined(USEOPENSSL) /* Get the two decrpt keys. */ sid_to_key1(rid,(unsigned char *)deskey1); des_set_key((des_cblock *)deskey1,ks1); -@@ -638,6 +666,25 @@ +@@ -477,6 +504,25 @@ (des_cblock *)lanman, ks1, DES_DECRYPT); des_ecb_encrypt((des_cblock *)(vp+lmpw_offs + 8), (des_cblock *)&lanman[8], ks2, DES_DECRYPT); @@ -109,7 +115,7 @@ diff -ur chntpw-110511.orig/chntpw.c chntpw-110511/chntpw.c if (gverbose) { hexprnt("MD4 hash : ",(unsigned char *)md4,16); -@@ -693,9 +740,17 @@ +@@ -544,9 +590,17 @@ /* printf("Ucase Lanman: %s\n",newlanpw); */ @@ -127,7 +133,7 @@ diff -ur chntpw-110511.orig/chntpw.c chntpw-110511/chntpw.c if (gverbose) hexprnt("\nNEW MD4 hash : ",digest,16); -@@ -704,6 +759,7 @@ +@@ -555,6 +609,7 @@ if (gverbose) hexprnt("NEW LANMAN hash : ",(unsigned char *)lanman,16); @@ -135,7 +141,7 @@ diff -ur chntpw-110511.orig/chntpw.c chntpw-110511/chntpw.c /* Encrypt the NT md4 password hash as two 8 byte blocks. */ des_ecb_encrypt((des_cblock *)digest, (des_cblock *)despw, ks1, DES_ENCRYPT); -@@ -714,6 +770,18 @@ +@@ -565,6 +620,18 @@ (des_cblock *)newlandes, ks1, DES_ENCRYPT); des_ecb_encrypt((des_cblock *)(lanman+8), (des_cblock *)&newlandes[8], ks2, DES_ENCRYPT); @@ -154,11 +160,9 @@ diff -ur chntpw-110511.orig/chntpw.c chntpw-110511/chntpw.c if (gverbose) { hexprnt("NEW DES crypt : ",(unsigned char *)despw,16); -diff -ur chntpw-110511.orig/Makefile chntpw-110511/Makefile ---- chntpw-110511.orig/Makefile 2011-05-11 12:33:56.000000000 -0700 -+++ chntpw-110511/Makefile 2011-11-01 13:32:10.598579767 -0700 -@@ -1,28 +1,11 @@ - # +--- a/Makefile ++++ b/Makefile +@@ -2,28 +2,10 @@ # Makefile for the Offline NT Password Editor # -# @@ -183,8 +187,9 @@ diff -ur chntpw-110511.orig/Makefile chntpw-110511/Makefile - - -# This is to link with whatever we have, SSL crypto lib we put in static --LIBS=-L$(OSSLLIB) $(OSSLLIB)/libcrypto.a +-#LIBS=-L$(OSSLLIB) $(OSSLLIB)/libcrypto.a +-LIBS=-L$(OSSLLIB) +LIBS=$(shell libgcrypt-config --libs) - all: chntpw chntpw.static cpnt reged reged.static + all: chntpw chntpw.static cpnt reged reged.static samusrgrp samusrgrp.static sampasswd sampasswd.static diff --git a/chntpw-chntpw.8 b/chntpw-chntpw.8 deleted file mode 100644 index 8b0ec85..0000000 --- a/chntpw-chntpw.8 +++ /dev/null @@ -1,96 +0,0 @@ -.\" Hey, EMACS: -*- nroff -*- -.\" First parameter, NAME, should be all caps -.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection -.\" other parameters are allowed: see man(7), man(1) -.TH CHNTPW 8 "30th May 2002" -.\" Please adjust this date whenever revising the manpage. -.\" -.\" Some roff macros, for reference: -.\" .nh disable hyphenation -.\" .hy enable hyphenation -.\" .ad l left justify -.\" .ad b justify to both left and right margins -.\" .nf disable filling -.\" .fi enable filling -.\" .br insert line break -.\" .sp insert n+1 empty lines -.\" for manpage-specific macros, see man(7) -.SH NAME -chntpw \- utility to overwrite Windows NT/2000 SAM passwords -.SH SYNOPSIS -.B chntpw -.RI [ options ] -.RI < samfile > -.RI [ systemfile ] -.RI [ securityfile ] -.RI [ otherreghive ] -.RI [...] -.br -.SH DESCRIPTION -This manual page documents briefly the -.B chntpw -command. -This manual page was written for the Debian distribution -because the original program does not have a manual page. -.PP -.B chntpw -is a utility to view some information and change user passwords -in a Windows NT/2000 SAM userdatabase file. It is not necessary to -know the old passwords to reset them. In addition it contains a -simple registry editor (same size data writes) -and hex-editor with which the information contained in a registry -file can be browsed and modified. -.SH OPTIONS -.TP -.B \-h -Show summary of options. -.TP -.B \-u username -Username to change. Default is Administrator -.TP -.B \-l -List all users in the SAM database. -.TP -.B \-i -Interactive: list all users (as per \-l) and then ask for the -user to change. -.TP -.B \-e -Registry editor with limited capabilities. -.TP -.B \-d -Use buffer debugger. -.TP -.B \-t -Show hexdumps of structs/segments (deprecated debug function). -.SH EXAMPLES -.TP -.B chntpw sam system -Opens registry hives -.B sam -and -.B system -and change administrator account. This will work even if the name -has been changed or it has been localized (since different language -versions of NT use different administrator names). -.TP -.B chntpw -u jabbathehutt mysam -Prompts for password for -.B jabbathehutt -and changes it in the -.B mysam -registry file, if found (otherwise do nothing) -.SH SEE ALSO -If you are looking for an automated procedure for password -recovery, you might look at the bootdisks provided by the -upstream author at -.BR http://home.eunet.no/~pnordahl/ntpasswd/ -.br -There is more information on how this program works available at -.IR /usr/share/doc/chntpw . -This information includes in-depth information on how the -registry works, what are syskeys and some other issues. -.SH AUTHOR -This manual page was written by -Javier Fernandez-Sanguino , -for the Debian GNU/Linux system (but may be used by others). diff --git a/chntpw.8 b/chntpw.8 new file mode 100644 index 0000000..f92440b --- /dev/null +++ b/chntpw.8 @@ -0,0 +1,157 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH CHNTPW 8 "13th March 2010" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +chntpw \- utility to overwrite passwords of Windows systems +.SH SYNOPSIS +.B chntpw +.RI [ options ] +.RI < samfile > +.RI [ systemfile ] +.RI [ securityfile ] +.RI [ otherreghive ] +.RI [...] +.br +.SH DESCRIPTION +This manual page documents briefly the +.B chntpw +command. +This manual page was written for the Debian distribution +because the original program does not have a manual page. +.PP +.B chntpw +is a utility to view some information and reset user passwords +in a Windows NT/2000 SAM userdatabase file used by Microsoft Windows +Operating System (in NT3.x and later versions). This file is usually located at +\\WINDOWS\\system32\\config\\SAM on the Windows file system. It is not necessary to +know the previous passwords to reset them. In addition it contains a simple +registry editor and ahex-editor with which the information contained in a +registry file can be browsed and modified. + +This program should be able to handle both 32 and 64 bit Microsoft Windows and +all versions from NT3.x up to Win8.1. + + +.SH OPTIONS +.TP +.B \-h +Show a summary of options. +.TP +.B \-u username +Username or username ID (RID) to change. The default is 'Administrator'. +.TP +.B \-l +List all users in the SAM database and exit. +.TP +.B \-i +Interactive Menu system: list all users (as per \-l option) and then ask for the +user to change. +.TP +.B \-e +Registry editor with limited capabilities (but it does include write support). For a +slightly more powerful editor see +.B reged + +.TP +.B \-d +Use buffer debugger instead (hex editor) + +.B \-L +Log all changed filenames to /tmp/changed. When this option is set the +program automatically saves the changes in the hive files without prompting the +user. + +Be careful when using the \fB-L\fR option as a root user in a multiuser system. +The filename is fixed and this can be used by malicious users (dropping a +symlink with the same name) to overwrite system files. + +.TP +.B \-N +Do not allocate more information, only allow the editing of existing values +with same size. +.TP +.B \-E +Do not expand the hive file (safe mode). +.TP +.B \-v +Print verbose information and debug messages. + + + + + +.SH EXAMPLES +.TP +.B ntfs-3g /dev/sda1 /media/win ; cd /media/win/WINDOWS/system32/config/ +Mount the Windows file system and enters the directory +.B \\\\WINDOWS\\\\system32\\\\config +where Windows stores the SAM database. +.TP +.B chntpw SAM system +Opens registry hives +.B SAM +and +.B system +and change administrator account. This will work even if the name +has been changed or it has been localized (since different language +versions of NT use different administrator names). +.TP +.B chntpw -l SAM +Lists the users defined in the +.B SAM +registry file. +.TP +.B chntpw -u jabbathehutt SAM +Prompts for password for +.B jabbathehutt +and changes it in the +.B SAM +registry file, if found (otherwise do nothing). + +.SH KNOWN BUGS + +This program uses undocumented structures in the SAM database. Use with +caution (i.e. make sure you make a backup of the file before any changes +are done). + +Password changing is only possible if the program has been specifically +compiled with some cryptographic functions. This feature, however, only +works properly in Windows NT and Windows 2000 systems. It might not +work properly in Windows XP, Vista, Win7, Win8 and later systems. + +In the Debian distribution this feature is not enabled. + +.SH SEE ALSO +.B reged, samusrgrp, sampasswd + +If you are looking for an automated procedure for password +recovery, you might want to check the bootdisks (can be used in CD +and USB drives) provided by the upstream author at +.BR http://pogostick.net/~pnh/ntpasswd/ + +.br +You will find more information available on how this program works, including +in-depth details on how the registry works, in the text files +.IR /usr/share/doc/chntpw/README.txt +and +.IR /usr/share/doc/chntpw/MANUAL.txt + +.SH AUTHOR +This program was written by Petter N Hagen. + +This manual page was written by Javier Fernandez-Sanguino , +for the Debian GNU/Linux system (but may be used by others). diff --git a/chntpw.spec b/chntpw.spec index a15760d..a80129d 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,23 +1,26 @@ Name: chntpw # Version is taken from HISTORY.txt -Version: 0.99.6 -Release: 30.110511%{?dist} +Version: 1.00 +Release: 0.140201%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 -URL: http://pogostick.net/~pnh/ntpasswd/ -Source0: http://pogostick.net/~pnh/ntpasswd/chntpw-source-110511.zip +URL: http://pogostick.net/~pnh/ntpasswd/ +Source0: http://pogostick.net/~pnh/ntpasswd/chntpw-source-140201.zip Source2: chntpw-README.Dist -# The man page is borrowed from Debian -Source3: chntpw-chntpw.8 +# The man pages are borrowed from Debian +Source10: chntpw.8 +Source11: reged.8 +Source12: sampasswd.8 +Source13: samusrgrp.8 BuildRequires: libgcrypt-devel # Patches sent upstream on 2009-06-08. -Patch1: chntpw-110511-get_abs_path.patch +Patch1: chntpw-140201-get_abs_path.patch # Patch from Debian (RHBZ#504595). -Patch3: chntpw-110511-port-to-gcrypt-debian.patch +Patch3: chntpw-140201-port-to-gcrypt-debian.patch # Patches from Jim Meyering to improve robustness of the code. Patch4: chntpw-110511-robustness.patch @@ -30,15 +33,15 @@ Patch7: chntpw-110511-reged-no-deref-null.patch This is a utility to (re)set the password of any user that has a valid (local) account on your Windows NT/2k/XP/Vista etc system. You do not need to know the old password to set a new one. It works offline, that -is, you have to shutdown your computer and boot off a floppydisk or CD +is, you have to shutdown your computer and boot off a floppy disk or CD or another system. Will detect and offer to unlock locked or disabled out user accounts! There is also a registry editor and other registry -utilities that works under linux/unix, and can be used for other things +utilities that works under Linux/Unix, and can be used for other things than password editing. %prep -%setup -q -n %{name}-110511 +%setup -q -n %{name}-140201 cp -p %{SOURCE2} README.Dist sed -e 's/\r$//' WinReg.txt > WinReg.txt.eol touch -c -r WinReg.txt WinReg.txt.eol @@ -53,17 +56,17 @@ mv WinReg.txt.eol WinReg.txt %build -make CC="%__cc" EXTRA_CFLAGS="$RPM_OPT_FLAGS" chntpw cpnt reged +make CC="%__cc" EXTRA_CFLAGS="$RPM_OPT_FLAGS" \ + chntpw cpnt reged sampasswd samusrgrp %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_bindir} -cp chntpw $RPM_BUILD_ROOT%{_bindir} -cp cpnt $RPM_BUILD_ROOT%{_bindir} -cp reged $RPM_BUILD_ROOT%{_bindir} +cp chntpw cpnt reged sampasswd samusrgrp $RPM_BUILD_ROOT%{_bindir} mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8/ -cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_mandir}/man8/%{name}.8 +cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ + $RPM_BUILD_ROOT%{_mandir}/man8/ @@ -74,10 +77,19 @@ cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_mandir}/man8/%{name}.8 %{_bindir}/chntpw %{_bindir}/cpnt %{_bindir}/reged -%{_mandir}/man8/%{name}.8* +%{_bindir}/sampasswd +%{_bindir}/samusrgrp +%{_mandir}/man8/*.8* %changelog +* Mon Jul 02 2018 Conrad Meyer - 1.00-0.140201 +- Update to latest upstream, 1.00 / 140201 +- Rebase patches as needed +- Import additional and enhanced manual pages from Debian +- Adds two new binaries: sampasswd and samusrgrp +- Clean up rpmlint warnings (tabs, spelling, log date) + * Wed Feb 07 2018 Fedora Release Engineering - 0.99.6-30.110511 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild @@ -157,7 +169,7 @@ cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_mandir}/man8/%{name}.8 * Thu Jan 15 2009 Tomas Mraz - 0.99.6-6 - rebuild with new openssl -* Sun Oct 11 2008 Conrad Meyer - 0.99.6-5 +* Sun Oct 12 2008 Conrad Meyer - 0.99.6-5 - Bump because force-tag was removed. Please add it back. * Sat Oct 11 2008 Conrad Meyer - 0.99.6-4 diff --git a/reged.8 b/reged.8 new file mode 100644 index 0000000..36ecff4 --- /dev/null +++ b/reged.8 @@ -0,0 +1,120 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH REGED 8 "6th August 2014" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +reged \- utility to export/import and edit a Windows registry hives +.SH SYNOPSIS +.B reged +.RI [ options ] +.RI -x + +.B reged +.RI [ options ] +.RI -I + +.B reged +.RI [ options ] +.RI -e + + +.br +.SH DESCRIPTION +This manual page documents briefly the +.B reged +command. +This manual page was written for the Debian distribution +because the original program does not have a manual page. + +.PP +.B reged +is the an interactive command line utility that can be used to +export, import or edit a Microsoft Windows registry hive. + +.SH OPTIONS +.TP +.B \-h +Show summary of options. +.TP +.B \-x +Export parts of a hive file to a text registry (.reg) file. +Prefixstring indicates the part of the registry hive to dump (for example +HKEY_LOCAL_MACHINE\\SOFTWARE). The parameter defines the key to dump +(recursively). You can use \\ or \\\\ to list all the keys in the hive file. + +Only one hive file and one .reg file can be defined. + +.TP +.B \-I +Import the content of the input.reg file into the registry file. The value + can be any valid prefix, for example is +HKEY_LOCAL_MACHINE\\SOFTWARE. + +Only one .reg and one hive file supported at the same time + +.TP +.B \-e ... +Interactive edit one or more registry files. + +.TP +.B \-L +Log all changed filenames to /tmp/changed. When this option is set the +program automatically saves the changes in the hive files without prompting the +user. + +Be careful when using the \fB-L\fR option as a root user in a multiuser system. +The filename is fixed and this can be used by malicious users (dropping a +symlink with the same name) to overwrite system files. + + +.TP +.B \-C +Automatically save all changes. Do not prompt the user. + +.TP +.B \-N +Do not allocate more information, only allow the editing of existing values with same size. + +.TP +.B \-E +Do not expand the hive file (safe mode). + +.TP +.B \-t +Print debug information of allocated blocks. + +.TP +.B \-v +Print verbose information and debug messages. + +.SH KNOWN BUGS + +There are many \fBunknown\fR bugs. If you find bugs please report them to the author. + +.SH SEE ALSO +.B chntpwd, samusrgrp, sampasswd +.br +You will find more information available on how this program works, in the +text files +.IR /usr/share/doc/chntpw/README.txt +and +.IR /usr/share/doc/chntpw/MANUAL.txt + +.SH AUTHOR +This program was written by Petter N Hagen. + +This manual page was written by Javier Fernandez-Sanguino , +for the Debian GNU/Linux system (but may be used by others). diff --git a/sampasswd.8 b/sampasswd.8 new file mode 100644 index 0000000..78257c2 --- /dev/null +++ b/sampasswd.8 @@ -0,0 +1,120 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH SAMPASSWD 8 "6th August 2014" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +sampasswd \- reset passwords of users in the SAM user database +.SH SYNOPSIS +.B sampasswd +.RI [ options ] +.RI -u user +.RI < samfile > +.br +.SH DESCRIPTION +This manual page documents briefly the +.B sampasswd +command. +This manual page was written for the Debian distribution +because the original program does not have a manual page. + +.PP +.B sampasswd +is a non-interactive command line utility that can reset a user's +password and/or the user's account bits from the SAM user database file of a +Microsoft Windows system (Windows NT, 2000, XP, Vista, 7, 8.1, etc.). +This file is usually located at +\\WINDOWS\\system32\\config\\SAM on the file system of a Microsoft Windows +Operating System + +On success, the program does not output any informatin and the exit code is 0. + +.SH OPTIONS +.TP +.B \-h +Show summary of options. +.TP +.B \-r +Reset the user's password. +.TP +.B \-a +Reset all the users. If this option is used there is no need to specify the next option. +.TP +.B \-u +User to change. The user value can be provided as a username, or a RID number in +hexadecimal (if the username is preceded with '0x'). Usernames including +international characters will probably not work. +.TP +.B \-l +Lists the users in the SAM database. +.TP +.B \-H +Output human readable output. The program by default will print a parsable table unless +this option is used. +.TP +.B \-N +Do not allocate more information, only allow the editing of existing values with same size. +.TP +.B \-E +Do not expand the hive file (safe mode). +.TP +.B \-t +Print debug information of allocated blocks. +.TP +.B \-v +Print verbose information and debug messages. + +.SH EXAMPLES +.TP +.B sampasswd -r -u theboss +Reset the password of a user named 'theboss', if found. + +.TP +.B sampasswd -r -u 0x3ea +Reset the password of the user with RID '0x3a'. + +.TP +.B samusrgrp -r -a +Reset the password of all the users in the Administrator's group (0x220) + +.TP +.B samusrgrp -r -f +Reset the password of the administrative users with the lowest RID number. +This does not include the built-in administrator (0x1f4) unless no other +administrative user can be found in the database file. + + +.SH KNOWN BUGS + +If the username includes international (non-ASCII) characters the program +will not (usually) find it. Use the RID number instead. + +.SH SEE ALSO +.B chntpwd, reged, samusrgrp +.br +You will find more information available on how this program works, in the +text files +.IR /usr/share/doc/chntpw/README.txt +and +.IR /usr/share/doc/chntpw/MANUAL.txt + +More documentation is available at the upstream's author site: +.BR http://pogostick.net/~pnh/ntpasswd/ + +.SH AUTHOR +This program was written by Petter N Hagen. + +This manual page was written by Javier Fernandez-Sanguino , +for the Debian GNU/Linux system (but may be used by others). diff --git a/samusrgrp.8 b/samusrgrp.8 new file mode 100644 index 0000000..773448b --- /dev/null +++ b/samusrgrp.8 @@ -0,0 +1,130 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH SAMUSRGRP 8 "6th August 2014" +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +samusrgrp \- add or remove users from groups in SAM database files +.SH SYNOPSIS +.B samusrgrp +.RI [ options ] +.RI < samfile > +.br +.SH DESCRIPTION +This manual page documents briefly the +.B samusrgrp +command. +This manual page was written for the Debian distribution +because the original program does not have a manual page. +.PP +.B samusrgrp +is a non-interactive command line utility that can add or remove +a user from a local group that exists in the SAM user database of a +Microsoft Windows system (Windows NT, 2000, XP, Vista, 7, 8.1, etc.). +This file is usually located at +\\WINDOWS\\system32\\config\\SAM on the file system of a Microsoft Windows +Operating System + +On success, the program does not output any informatin and the exit code is 0. + +The binary program supports multiple names. If it is called named +.B samusrtogrp +it will assume \fB-a\fR mode (add user). If it is called named +.B samusrfromgrp +it will assume \fB-r\fR mode (remove user). + +.SH OPTIONS +.TP +.B \-h +Show summary of options. +.TP +.B \-a +The user is added to the group. This option has to be followed +by \-u and \-g . +.TP +.B \-r +The user is removed from the group. This option has to be followed +by \-u and \-g . +.TP +.B \-u +User to change. The user value can be provided as a username, or a RID number in +hexadecimal (if the username is preceded with '0x'). Usernames including +international characters will probably not work. +.TP +.B \-g +Group to change. The group can only be given as a group number, in hexadecimal, preceded with +with '0x'. +.TP +.B \-l +Lists the groups in the SAM database. +.TP +.B \-L +Lists the groups in the SAM database as well as their members. +.TP +.B \-s +Print the machine SID. +.TP +.B \-H +Output human readable output. The program by default will print a parsable table unless +this option is used. +.TP +.B \-N +Do not allocate more information, only allow the editing of existing values +with same size. +.TP +.B \-E +Do not expand the hive file (safe mode). +.TP +.B \-t +Print debug information of allocated blocks. +.TP +.B \-v +Print verbose information and debug messages. + +.SH EXAMPLES +.TP +.B samusrgrp -a -u theboss -g 0x220 SAMFILE +Adds a user named 'theboss' to the group 0x220 (Administrators) + +.TP +.B samusrgrp -a -u 0x3ea -g 0x221 SAMFILE +Adds a user with the id '0x3aa' to the group 0x221 (Users) + +.TP +.B samusrgrp -r -u 0x3ff -g 0x221 SAMFILE +Remove a user with the id '0x3ff' from the group 0x221 (Users) + +.SH KNOWN BUGS + +If the username includes international (non-ASCII) characters the program +will not (usually) find it. Use the RID number instead. + +.SH SEE ALSO +.B chntpwd, reged, sampasswd +.br +You will find more information available on how this program works, in the +text files +.IR /usr/share/doc/chntpw/README.txt +and +.IR /usr/share/doc/chntpw/MANUAL.txt + +More documentation is available at the upstream's author site: +.BR http://pogostick.net/~pnh/ntpasswd/ + +.SH AUTHOR +This program was written by Petter N Hagen. + +This manual page was written by Javier Fernandez-Sanguino , +for the Debian GNU/Linux system (but may be used by others). diff --git a/sources b/sources index 585eeb4..e597fc8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a3fb358d1adec589cd6bc8dedf68896c chntpw-source-110511.zip +SHA512 (chntpw-source-140201.zip) = a26d747f6e077d1bb3e9b8077781f8c37dd978e07b7426495862f15c9004572b706c34736fc4d1ed8856b1a43335d726b4d87c688f7f9a11fd6cc3a74d71a7fa From 2cae951425fd3ed6111bb90f5f876ef0e2e3fa04 Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Tue, 10 Jul 2018 00:30:30 -0500 Subject: [PATCH 40/65] Remove needless use of %defattr --- chntpw.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index a80129d..a1e1345 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -71,7 +71,6 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %files -%defattr(-,root,root,-) %doc GPL.txt LGPL.txt README.txt regedit.txt WinReg.txt HISTORY.txt %doc README.Dist %{_bindir}/chntpw From bace41e77465239c7290f299b3d0655faa2c01b2 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 12 Jul 2018 21:45:46 +0000 Subject: [PATCH 41/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index a1e1345..352afb7 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 0.140201%{?dist} +Release: 0.140202%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -82,6 +82,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Thu Jul 12 2018 Fedora Release Engineering - 1.00-0.140202 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Mon Jul 02 2018 Conrad Meyer - 1.00-0.140201 - Update to latest upstream, 1.00 / 140201 - Rebase patches as needed From fb66fe7ea3c9b3f69884c3f421fe69295e145975 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Thu, 19 Jul 2018 16:58:45 -0700 Subject: [PATCH 42/65] Add missing GCC BR after removal from buildroot Unfuck version number bumped incorrectly by RE --- chntpw.spec | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/chntpw.spec b/chntpw.spec index 352afb7..8fe90a6 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 0.140202%{?dist} +Release: 2.140201%{?dist} Summary: Change passwords in Windows SAM files Group: Applications/Engineering License: GPLv2 @@ -14,6 +14,7 @@ Source11: reged.8 Source12: sampasswd.8 Source13: samusrgrp.8 +BuildRequires: gcc BuildRequires: libgcrypt-devel # Patches sent upstream on 2009-06-08. @@ -82,7 +83,11 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog -* Thu Jul 12 2018 Fedora Release Engineering - 1.00-0.140202 +* Thu Jul 19 2018 Conrad Meyer - 1.00-2.140201 +- Add missing GCC BR after removal from buildroot +- Unfuck version number bumped incorrectly by RE + +* Thu Jul 12 2018 Fedora Release Engineering - 1.00-1.140201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Mon Jul 02 2018 Conrad Meyer - 1.00-0.140201 From b8c1f330bd88ca0c4c453435bdc77a2861f859fc Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 28 Jan 2019 20:17:40 +0100 Subject: [PATCH 43/65] Remove obsolete Group tag References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag --- chntpw.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 8fe90a6..78775a9 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -3,7 +3,6 @@ Name: chntpw Version: 1.00 Release: 2.140201%{?dist} Summary: Change passwords in Windows SAM files -Group: Applications/Engineering License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ Source0: http://pogostick.net/~pnh/ntpasswd/chntpw-source-140201.zip From b5663ce9ad803bdf873e507b41307de905b5e5dd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 31 Jan 2019 15:33:28 +0000 Subject: [PATCH 44/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 78775a9..fd2d138 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 2.140201%{?dist} +Release: 3.140201%{?dist} Summary: Change passwords in Windows SAM files License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ @@ -82,6 +82,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Thu Jan 31 2019 Fedora Release Engineering - 1.00-3.140201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Thu Jul 19 2018 Conrad Meyer - 1.00-2.140201 - Add missing GCC BR after removal from buildroot - Unfuck version number bumped incorrectly by RE From 7fea2dfcbd24adc56c91fb0fd6bfa8f75c5f2ebe Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Sat, 22 Jun 2019 13:22:59 -0700 Subject: [PATCH 45/65] Add fix for rhbz# 1645886. Thanks Oleg Samarin. --- chntpw-140201-fix-bogus-errno-use.patch | 34 +++++++++++++++++++++++++ chntpw.spec | 9 ++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 chntpw-140201-fix-bogus-errno-use.patch diff --git a/chntpw-140201-fix-bogus-errno-use.patch b/chntpw-140201-fix-bogus-errno-use.patch new file mode 100644 index 0000000..ff7c846 --- /dev/null +++ b/chntpw-140201-fix-bogus-errno-use.patch @@ -0,0 +1,34 @@ +diff -u chntpw-140201.orig/ntreg.c chntpw-140201/ntreg.c +--- chntpw-140201.orig/ntreg.c 2019-06-22 13:09:59.583717369 -0700 ++++ chntpw-140201/ntreg.c 2019-06-22 13:16:26.714726148 -0700 +@@ -4241,10 +4241,13 @@ + do { /* On some platforms read may not block, and read in chunks. handle that */ + r = read(hdesc->filedesc, hdesc->buffer + rt, hdesc->size - rt); + rt += r; +- } while ( !errno && (rt < hdesc->size) ); ++ } while ( r > 0 && (rt < hdesc->size) ); + +- if (errno) { +- perror("openHive(): read error: "); ++ if (r <= 0) { ++ if (r < 0) ++ perror("openHive(): read error"); ++ else ++ fprintf(stderr, "openHive(): read error: unexpected EOF\n"); + closeHive(hdesc); + return(NULL); + } +@@ -4255,10 +4258,10 @@ + return(NULL); + } + +- if (r < sizeof (*hdesc)) { ++ if (rt < sizeof (*hdesc)) { + fprintf(stderr, +- "file is too small; got %d bytes while expecting %d or more\n", +- r, sizeof (*hdesc)); ++ "file is too small; got %d bytes while expecting %zu or more\n", ++ rt, sizeof (*hdesc)); + closeHive(hdesc); + return(NULL); + } diff --git a/chntpw.spec b/chntpw.spec index fd2d138..8016682 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 3.140201%{?dist} +Release: 4.140201%{?dist} Summary: Change passwords in Windows SAM files License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ @@ -28,6 +28,9 @@ Patch5: chntpw-080526-correct-test-for-failing-open-syscall.patch Patch6: chntpw-110511-detect-failure-to-write-key.patch Patch7: chntpw-110511-reged-no-deref-null.patch +# Patch derived from Oleg Samarin (RHBZ#1645886) +Patch8: chntpw-140201-fix-bogus-errno-use.patch + %description This is a utility to (re)set the password of any user that has a valid @@ -53,6 +56,7 @@ mv WinReg.txt.eol WinReg.txt %patch5 -p1 %patch6 -p1 %patch7 -p1 +%patch8 -p1 %build @@ -82,6 +86,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Sat Jun 22 2019 Conrad Meyer - 1.00-4.140201 +- Add fix for rhbz# 1645886. Thanks Oleg Samarin. + * Thu Jan 31 2019 Fedora Release Engineering - 1.00-3.140201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From d28d7be6648a276404af63e1309cc2d0a9599f9e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 24 Jul 2019 20:13:23 +0000 Subject: [PATCH 46/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 8016682..e2f746c 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 4.140201%{?dist} +Release: 5.140201%{?dist} Summary: Change passwords in Windows SAM files License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ @@ -86,6 +86,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Wed Jul 24 2019 Fedora Release Engineering - 1.00-5.140201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Sat Jun 22 2019 Conrad Meyer - 1.00-4.140201 - Add fix for rhbz# 1645886. Thanks Oleg Samarin. From 70139ea65b6ee81434129edfc8c697b02e4423d6 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 28 Jan 2020 13:59:22 +0000 Subject: [PATCH 47/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index e2f746c..129d592 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 5.140201%{?dist} +Release: 6.140201%{?dist} Summary: Change passwords in Windows SAM files License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ @@ -86,6 +86,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Tue Jan 28 2020 Fedora Release Engineering - 1.00-6.140201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Wed Jul 24 2019 Fedora Release Engineering - 1.00-5.140201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild From b1ff3a5541d4551661d8ee424bc015e9e4741eab Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Mon, 27 Jul 2020 13:56:02 +0000 Subject: [PATCH 48/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 129d592..0ec6708 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 6.140201%{?dist} +Release: 7.140201%{?dist} Summary: Change passwords in Windows SAM files License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ @@ -86,6 +86,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Mon Jul 27 2020 Fedora Release Engineering - 1.00-7.140201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Tue Jan 28 2020 Fedora Release Engineering - 1.00-6.140201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From 4c3862d8e73175b5f40e3b07a43ad3abeb641af4 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 17 Dec 2020 03:31:19 +0000 Subject: [PATCH 49/65] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- chntpw.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/chntpw.spec b/chntpw.spec index 0ec6708..af0215c 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -15,6 +15,7 @@ Source13: samusrgrp.8 BuildRequires: gcc BuildRequires: libgcrypt-devel +BuildRequires: make # Patches sent upstream on 2009-06-08. Patch1: chntpw-140201-get_abs_path.patch From 8478749d932c24abe2a15dba2ba6d7776757e431 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 26 Jan 2021 01:55:54 +0000 Subject: [PATCH 50/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index af0215c..d53d7ba 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 7.140201%{?dist} +Release: 8.140201%{?dist} Summary: Change passwords in Windows SAM files License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ @@ -87,6 +87,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Tue Jan 26 2021 Fedora Release Engineering - 1.00-8.140201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Mon Jul 27 2020 Fedora Release Engineering - 1.00-7.140201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From 1fb65f50ba71a56a016192e86047dfcc5371910f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 21 Jul 2021 14:28:12 +0000 Subject: [PATCH 51/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering From e973148d5ed0e4a168582d3c1233cd67e993b114 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 21 Jul 2021 19:25:23 +0000 Subject: [PATCH 52/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index d53d7ba..e204fda 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 8.140201%{?dist} +Release: 9.140201%{?dist} Summary: Change passwords in Windows SAM files License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ @@ -87,6 +87,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Wed Jul 21 2021 Fedora Release Engineering - 1.00-9.140201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Tue Jan 26 2021 Fedora Release Engineering - 1.00-8.140201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From ad8769bcd243fa4ad0329f4087ab6dce6c65577d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 19 Jan 2022 23:10:54 +0000 Subject: [PATCH 53/65] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index e204fda..5bc1f13 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 9.140201%{?dist} +Release: 10.140201%{?dist} Summary: Change passwords in Windows SAM files License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ @@ -87,6 +87,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Wed Jan 19 2022 Fedora Release Engineering - 1.00-10.140201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Wed Jul 21 2021 Fedora Release Engineering - 1.00-9.140201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From d63bc578b7a8aee07d850b940e84c3267d82620a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 20 Jul 2022 22:53:15 +0000 Subject: [PATCH 54/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 5bc1f13..884e14a 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 10.140201%{?dist} +Release: 11.140201%{?dist} Summary: Change passwords in Windows SAM files License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ @@ -87,6 +87,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Wed Jul 20 2022 Fedora Release Engineering - 1.00-11.140201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Wed Jan 19 2022 Fedora Release Engineering - 1.00-10.140201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From ef98207ac1c0c53d6a453fb354896ee35e6ea77e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 18 Jan 2023 23:49:12 +0000 Subject: [PATCH 55/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 884e14a..75e3e16 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 11.140201%{?dist} +Release: 12.140201%{?dist} Summary: Change passwords in Windows SAM files License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ @@ -87,6 +87,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Wed Jan 18 2023 Fedora Release Engineering - 1.00-12.140201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Wed Jul 20 2022 Fedora Release Engineering - 1.00-11.140201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From 357ed638fe49b4c6e9c05de6eb9d028e6d62d7f8 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 19 Jul 2023 15:37:10 +0000 Subject: [PATCH 56/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 75e3e16..28dc665 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 12.140201%{?dist} +Release: 13.140201%{?dist} Summary: Change passwords in Windows SAM files License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ @@ -87,6 +87,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Wed Jul 19 2023 Fedora Release Engineering - 1.00-13.140201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Wed Jan 18 2023 Fedora Release Engineering - 1.00-12.140201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From 5fb5151e530ffcdb263c7251ab5d0a80f94cabbe Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 19 Jan 2024 15:24:16 +0000 Subject: [PATCH 57/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 28dc665..494f527 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 13.140201%{?dist} +Release: 14.140201%{?dist} Summary: Change passwords in Windows SAM files License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ @@ -87,6 +87,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Fri Jan 19 2024 Fedora Release Engineering - 1.00-14.140201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Wed Jul 19 2023 Fedora Release Engineering - 1.00-13.140201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 061474d1e6264835215ba8bae43e8c51ea474aec Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 23 Jan 2024 01:34:06 +0000 Subject: [PATCH 58/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 494f527..3870046 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 14.140201%{?dist} +Release: 15.140201%{?dist} Summary: Change passwords in Windows SAM files License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ @@ -87,6 +87,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Tue Jan 23 2024 Fedora Release Engineering - 1.00-15.140201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Fri Jan 19 2024 Fedora Release Engineering - 1.00-14.140201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 31075a04ab3da5206e24165f9e34a3e593a5081a Mon Sep 17 00:00:00 2001 From: Software Management Team Date: Thu, 30 May 2024 12:46:47 +0200 Subject: [PATCH 59/65] Eliminate use of obsolete %patchN syntax (#2283636) --- chntpw.spec | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/chntpw.spec b/chntpw.spec index 3870046..6e37609 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -51,13 +51,13 @@ sed -e 's/\r$//' WinReg.txt > WinReg.txt.eol touch -c -r WinReg.txt WinReg.txt.eol mv WinReg.txt.eol WinReg.txt -%patch1 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 +%patch -P1 -p1 +%patch -P3 -p1 +%patch -P4 -p1 +%patch -P5 -p1 +%patch -P6 -p1 +%patch -P7 -p1 +%patch -P8 -p1 %build From a7507a0ea81ba8182773d107776ed8302e0fdd85 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 17 Jul 2024 19:16:17 +0000 Subject: [PATCH 60/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 6e37609..d982e88 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 15.140201%{?dist} +Release: 16.140201%{?dist} Summary: Change passwords in Windows SAM files License: GPLv2 URL: http://pogostick.net/~pnh/ntpasswd/ @@ -87,6 +87,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Wed Jul 17 2024 Fedora Release Engineering - 1.00-16.140201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Tue Jan 23 2024 Fedora Release Engineering - 1.00-15.140201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From cfb1a000cc20141dbcfe40b6bda42aa86b3a2818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Mon, 29 Jul 2024 10:47:21 +0200 Subject: [PATCH 61/65] convert GPLv2 license to SPDX This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- chntpw.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chntpw.spec b/chntpw.spec index d982e88..e2d14d3 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,9 +1,10 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 16.140201%{?dist} +Release: 17.140201%{?dist} Summary: Change passwords in Windows SAM files -License: GPLv2 +# Automatically converted from old format: GPLv2 - review is highly recommended. +License: GPL-2.0-only URL: http://pogostick.net/~pnh/ntpasswd/ Source0: http://pogostick.net/~pnh/ntpasswd/chntpw-source-140201.zip Source2: chntpw-README.Dist @@ -87,6 +88,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Mon Jul 29 2024 Miroslav Suchý - 1.00-17.140201 +- convert license to SPDX + * Wed Jul 17 2024 Fedora Release Engineering - 1.00-16.140201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 3407927d5b9669acf6d98e6541f0f9f8b9b3339c Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Sat, 3 Aug 2024 15:41:51 -0700 Subject: [PATCH 62/65] Add fix for rhbz# 2300591. --- chntpw-140201-hexdump-pointer-type.patch | 21 +++++++++++++++++++++ chntpw.spec | 10 ++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 chntpw-140201-hexdump-pointer-type.patch diff --git a/chntpw-140201-hexdump-pointer-type.patch b/chntpw-140201-hexdump-pointer-type.patch new file mode 100644 index 0000000..a8924bc --- /dev/null +++ b/chntpw-140201-hexdump-pointer-type.patch @@ -0,0 +1,21 @@ +diff -urN chntpw-140201.orig/libsam.c chntpw-140201/libsam.c +--- chntpw-140201.orig/libsam.c 2014-02-01 08:54:37.000000000 -0800 ++++ chntpw-140201/libsam.c 2024-08-03 15:31:41.817601486 -0700 +@@ -511,7 +511,7 @@ + + if (gverbose) printf("put_grp_members_sid: ajusted: mofs = %x, mlen = %x (%d)\n", mofs + 0x34 ,mlen,mlen); + +- if (gverbose) hexdump(&c->data, 0, c->len, 1); ++ if (gverbose) hexdump((char*)&c->data, 0, c->len, 1); + + /* Get total size of new SID data */ + +@@ -539,7 +539,7 @@ + cd->members_len = sidlen; /* Update member count in C struct */ + cd->grp_members = i; + +- if (gverbose) hexdump(&c->data, 0, c->len, 1); ++ if (gverbose) hexdump((char*)&c->data, 0, c->len, 1); + + if (!put_buf2val(hdesc, c, 0, g, 0, TPF_VK_EXACT)) { + fprintf(stderr,"put_grp_members_sid: could not write back group info in value %s\n",g); diff --git a/chntpw.spec b/chntpw.spec index e2d14d3..79f67fc 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 17.140201%{?dist} +Release: 18.140201%{?dist} Summary: Change passwords in Windows SAM files # Automatically converted from old format: GPLv2 - review is highly recommended. License: GPL-2.0-only @@ -31,7 +31,10 @@ Patch6: chntpw-110511-detect-failure-to-write-key.patch Patch7: chntpw-110511-reged-no-deref-null.patch # Patch derived from Oleg Samarin (RHBZ#1645886) -Patch8: chntpw-140201-fix-bogus-errno-use.patch +Patch8: chntpw-140201-fix-bogus-errno-use.patch + +# Cast around new GCC error for mismatched pointer arguments +Patch9: chntpw-140201-hexdump-pointer-type.patch %description @@ -88,6 +91,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Sat Aug 03 2024 Conrad Meyer - 1.00-18.140201 +- Add fix for rhbz# 2300591. + * Mon Jul 29 2024 Miroslav Suchý - 1.00-17.140201 - convert license to SPDX From 635b28930932dee18f29838f568598f148635fbb Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Sat, 3 Aug 2024 15:41:51 -0700 Subject: [PATCH 63/65] It helps to apply the patch. --- chntpw.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/chntpw.spec b/chntpw.spec index 79f67fc..7ab4c4c 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -62,6 +62,7 @@ mv WinReg.txt.eol WinReg.txt %patch -P6 -p1 %patch -P7 -p1 %patch -P8 -p1 +%patch -P9 -p1 %build From 41b757f133a1020cd777d888fadba8485fba165b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jan 2025 13:41:30 +0000 Subject: [PATCH 64/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index 7ab4c4c..b30075e 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 18.140201%{?dist} +Release: 19.140201%{?dist} Summary: Change passwords in Windows SAM files # Automatically converted from old format: GPLv2 - review is highly recommended. License: GPL-2.0-only @@ -92,6 +92,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Thu Jan 16 2025 Fedora Release Engineering - 1.00-19.140201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Sat Aug 03 2024 Conrad Meyer - 1.00-18.140201 - Add fix for rhbz# 2300591. From dee0164d1fc8d2bd58d4ecb0e22981a66603ba8d Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 23 Jul 2025 18:16:57 +0000 Subject: [PATCH 65/65] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- chntpw.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chntpw.spec b/chntpw.spec index b30075e..120ca06 100644 --- a/chntpw.spec +++ b/chntpw.spec @@ -1,7 +1,7 @@ Name: chntpw # Version is taken from HISTORY.txt Version: 1.00 -Release: 19.140201%{?dist} +Release: 20.140201%{?dist} Summary: Change passwords in Windows SAM files # Automatically converted from old format: GPLv2 - review is highly recommended. License: GPL-2.0-only @@ -92,6 +92,9 @@ cp -p %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ %changelog +* Wed Jul 23 2025 Fedora Release Engineering - 1.00-20.140201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Thu Jan 16 2025 Fedora Release Engineering - 1.00-19.140201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild