[chntpw] Update chntpw to latest upstream (110511). Rhbz# 750005
konradm
konradm at fedoraproject.org
Tue Nov 1 20:52:17 UTC 2011
commit fd64259e8ca1784adea3104941cb14125154a971
Author: Conrad Meyer <cemeyer at uw.edu>
Date: Tue Nov 1 13:41:41 2011 -0700
Update chntpw to latest upstream (110511). Rhbz# 750005
.gitignore | 1 +
chntpw-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 --------------------
chntpw-110511-detect-failure-to-write-key.patch | 19 ++
chntpw-110511-get_abs_path.patch | 11 ++
...ch => 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(-)
---
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-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 <sys/types.h>
#include <inttypes.h>
@@ -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 <konrad at tylerc.org> - 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 <rel-eng at lists.fedoraproject.org> - 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
More information about the scm-commits
mailing list