Package: chntpw
Severity: normal
Tags: patch

When building 'chntpw' on amd64 with gcc-4.0,
I get the following error:

gcc -c -DUSEOPENSSL -g -I. -I/usr/include -Wall -O2 chntpw.c
chntpw.c: In function 'change_pw':
chntpw.c:514: error: invalid lvalue in assignment
chntpw.c:526: warning: pointer targets in passing argument 2 of 'hexprnt' 
differ in signedness
chntpw.c:527: warning: pointer targets in passing argument 2 of 'hexprnt' 
differ in signedness
chntpw.c:549: warning: pointer targets in passing argument 2 of 'hexprnt' 
differ in signedness
chntpw.c:550: warning: pointer targets in passing argument 2 of 'hexprnt' 
differ in signedness
chntpw.c:582: warning: pointer targets in passing argument 1 of 'E1' differ in 
signedness
chntpw.c:582: warning: pointer targets in passing argument 3 of 'E1' differ in 
signedness
chntpw.c:583: warning: pointer targets in passing argument 1 of 'E1' differ in 
signedness
chntpw.c:583: warning: pointer targets in passing argument 3 of 'E1' differ in 
signedness
chntpw.c:585: warning: pointer targets in passing argument 2 of 'hexprnt' 
differ in signedness
chntpw.c:599: warning: pointer targets in passing argument 2 of 'hexprnt' 
differ in signedness
chntpw.c:600: warning: pointer targets in passing argument 2 of 'hexprnt' 
differ in signedness
chntpw.c:624: error: invalid lvalue in assignment
chntpw.c:630: error: invalid lvalue in assignment
chntpw.c:631: error: invalid lvalue in assignment
make[1]: *** [chntpw.o] Error 1
make[1]: Leaving directory `/chntpw-0.99.2'
make: *** [build-stamp] Error 2

With the attached patch 'chntpw' can be compiled
on amd64 using gcc-4.0.

Regards
Andreas Jochens

diff -urN ../tmp-orig/chntpw-0.99.2/chntpw.c ./chntpw.c
--- ../tmp-orig/chntpw-0.99.2/chntpw.c  2004-01-16 21:05:02.000000000 +0000
+++ ./chntpw.c  2005-02-28 12:23:39.853046402 +0000
@@ -511,7 +511,7 @@
        printf("** LANMAN password IS however set. Will now install new 
password as NT pass instead.\n");
        printf("** NOTE: Continue at own risk!\n");
        ntpw_offs = lmpw_offs;
-       (unsigned int)*(vp+0xa8) = ntpw_offs - 0xcc;
+       *((unsigned int*)vp+0xa8) = ntpw_offs - 0xcc;
        ntpw_len = 16;
        lmpw_len = 0;
       }
@@ -621,14 +621,14 @@
           ntpw_len = 16;
           lmpw_len = 16;
           ntpw_offs -= 4;
-          (unsigned int)*(vp+0xa8) = ntpw_offs - 0xcc;
+          *((unsigned int*)vp+0xa8) = ntpw_offs - 0xcc;
           *(vp + 0xa0) = 16;
           *(vp + 0xac) = 16;
         }
         
         for (i = 0; i < 16; i++) {
-          (unsigned char)*(vp+ntpw_offs+i) = despw[i];
-          if (lmpw_len >= 16) (unsigned char)*(vp+lmpw_offs+i) = newlandes[i];
+          *(vp+ntpw_offs+i) = (char)despw[i];
+          if (lmpw_len >= 16) *(vp+lmpw_offs+i) = (char)newlandes[i];
         }
        } else {
         printf("Unable to set since it is blank.\n");
diff -urN ../tmp-orig/chntpw-0.99.2/ntreg.c ./ntreg.c
--- ../tmp-orig/chntpw-0.99.2/ntreg.c   2004-01-16 21:05:02.000000000 +0000
+++ ./ntreg.c   2005-02-28 12:23:57.934556337 +0000
@@ -2004,7 +2004,7 @@
   ALLOC(kr,1,sizeof(int)+sizeof(int));
   
   kr->len = sizeof(int);
-  (int)kr->data = dword;
+  kr->data = dword;
 
   r = put_buf2val(hdesc, kr, vofs, path, REG_DWORD);
 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to