Package: mdadm
Version: 1.9.0-4.1
Severity: normal
Tags: patch upstream confirmed pending

gcc 4 cannot compile mdadm 1.9.0 due to problems with signedness.
the following patch fixes those

--- orig/Assemble.c
+++ mod/Assemble.c
@@ -178,7 +178,7 @@
 
  while ( devlist) {
    char *devname;
-   int this_uuid[4];
+   __u32 this_uuid[4];
    int dfd;
    struct stat stb;
    int havesuper=0;


--- orig/mdadm.h
+++ mod/mdadm.h
@@ -194,7 +194,7 @@
 
 extern int md_get_version(int fd);
 extern int get_linux_version(void);
-extern int parse_uuid(char *str, int uuid[4]);
+extern int parse_uuid(char *str, __u32 uuid[4]);
 extern int check_ext2(int fd, char *name);
 extern int check_reiser(int fd, char *name);
 extern int check_raid(int fd, char *name);
@@ -212,8 +212,8 @@
 extern void free_line(char *line);
 extern int match_oneof(char *devices, char *devname);
 extern int load_super(int fd, mdp_super_t *super);
-extern void uuid_from_super(int uuid[4], mdp_super_t *super);
-extern int same_uuid(int a[4], int b[4]);
+extern void uuid_from_super(__u32 uuid[4], mdp_super_t *super);
+extern int same_uuid(__u32 a[4], __u32 b[4]);
 extern int compare_super(mdp_super_t *first, mdp_super_t *second);
 extern unsigned long calc_sb_csum(mdp_super_t *super);
 extern int store_super(int fd, mdp_super_t *super);


--- orig/util.c
+++ mod/util.c
@@ -38,7 +38,7 @@
  * If not exactly 32 hex digits are found, return 0
  * else return 1
  */
-int parse_uuid(char *str, int uuid[4])
+int parse_uuid(char *str, __u32 uuid[4])
 {
     int hit = 0; /* number of Hex digIT */
     int i;
@@ -140,7 +140,7 @@
  }
 }
 
-int same_uuid(int a[4], int b[4])
+int same_uuid(__u32 a[4], __u32 b[4])
 {
     if (a[0]==b[0] &&
  a[1]==b[1] &&
@@ -150,7 +150,7 @@
     return 0;
 }
 
-void uuid_from_super(int uuid[4], mdp_super_t *super)
+void uuid_from_super(__u32 uuid[4], mdp_super_t *super)
 {
     uuid[0] = super->set_uuid0;
     if (super->minor_version >= 90) {
@@ -173,7 +173,7 @@
      *  2 wrong uuid
      *  3 wrong other info
      */
-    int uuid1[4], uuid2[4];
+    __u32 uuid1[4], uuid2[4];
     if (second->md_magic != MD_SB_MAGIC)
  return 1;
     if (first-> md_magic != MD_SB_MAGIC) {
@@ -322,7 +322,7 @@
   * Magic string "ReIsErFs" or "ReIsEr2Fs" at 52
   *
   */
- unsigned char sb[1024];
+ char sb[1024];
  int size;
  if (lseek(fd, 64*1024, 0) != 64*1024)
    return 0;
@@ -511,7 +511,7 @@
  unsigned long long newcsum = 0;
  unsigned long csum;
  int i;
- unsigned int *superc = (int*) super;
+ unsigned int *superc = (unsigned int*) super;
  super->sb_csum = 0;
 
  for(i=0; i<MD_SB_BYTES/4; i++)



-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (600, 'testing'), (98, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.11-cirrus
Locale: LANG=en_GB, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages mdadm depends on:
ii  debconf                     1.4.52       Debian configuration management sy
ii  libc6                       2.3.2.ds1-22 GNU C Library: Shared libraries an
ii  makedev                     2.3.1-77     creates device files in /dev

-- 
 .''`.     martin f. krafft <[EMAIL PROTECTED]>
: :'  :    proud Debian developer and author: http://debiansystem.info
`. `'`
  `-  Debian - when you have better things to do than fixing a system
 
Invalid/expired PGP (sub)keys? Use subkeys.pgp.net as keyserver!
 
"anyone who is capable of getting themselves made president
 should on no account be allowed to do the job"
                                                      -- douglas adams

Attachment: signature.asc
Description: Digital signature

Reply via email to