Import libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
[dragonfly.git] / lib / libarchive / patches / archive_read_extract.c.patch
1 $DragonFly: src/lib/libarchive/patches/Attic/archive_read_extract.c.patch,v 1.1 2004/11/10 18:02:24 joerg Exp $
2
3 --- archive_read_extract.c.orig 2004-11-09 23:59:26.000000000 +0100
4 +++ archive_read_extract.c      2004-11-10 00:25:17.000000000 +0100
5 @@ -77,7 +77,10 @@
6  struct bucket {
7         char    *name;
8         int      hash;
9 -       id_t     id;
10 +       union {
11 +               uid_t uid;
12 +               gid_t gid;
13 +       } id;
14  };
15  
16  struct extract {
17 @@ -1229,7 +1232,7 @@
18         h = hash(gname);
19         b = &extract->gcache[h % cache_size ];
20         if (b->name != NULL && b->hash == h && strcmp(gname, b->name) == 0)
21 -               return ((gid_t)b->id);
22 +               return (b->id.gid);
23  
24         /* Free the cache slot for a new entry. */
25         if (b->name != NULL)
26 @@ -1240,7 +1243,7 @@
27         grent = getgrnam(gname);
28         if (grent != NULL)
29                 gid = grent->gr_gid;
30 -       b->id = gid;
31 +       b->id.gid = gid;
32  
33         return (gid);
34  }
35 @@ -1265,7 +1268,7 @@
36         h = hash(uname);
37         b = &extract->ucache[h % cache_size ];
38         if (b->name != NULL && b->hash == h && strcmp(uname, b->name) == 0)
39 -               return ((uid_t)b->id);
40 +               return (b->id.uid);
41  
42         /* Free the cache slot for a new entry. */
43         if (b->name != NULL)
44 @@ -1276,7 +1279,7 @@
45         pwent = getpwnam(uname);
46         if (pwent != NULL)
47                 uid = pwent->pw_uid;
48 -       b->id = uid;
49 +       b->id.uid = uid;
50  
51         return (uid);
52  }