CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
added support for INSTALL rules. based on a patch by johannes. documentation needs...
[pkgutils-cross.git] / libtar-1.2.11-fix_linkname_overflow.patch
CommitLineData
9ac667e6
SR
1diff -ru libtar-1.2.11/lib/decode.c libtar-1.2.11-new/lib/decode.c
2--- libtar-1.2.11/lib/decode.c 2004-08-18 22:12:06.888107160 +0200
3+++ libtar-1.2.11-new/lib/decode.c 2004-08-18 22:05:27.569812768 +0200
4@@ -42,6 +42,17 @@
5 return filename;
6 }
7
8+char*
9+th_get_linkname(TAR* t)
10+{
11+ static char filename[MAXPATHLEN];
12+
13+ if (t->th_buf.gnu_longlink)
14+ return t->th_buf.gnu_longlink;
15+
16+ snprintf(filename, sizeof(filename), "%.100s", t->th_buf.linkname);
17+ return filename;
18+}
19
20 uid_t
21 th_get_uid(TAR *t)
22diff -ru libtar-1.2.11/lib/libtar.h libtar-1.2.11-new/lib/libtar.h
23--- libtar-1.2.11/lib/libtar.h 2003-01-07 02:40:59.000000000 +0100
24+++ libtar-1.2.11-new/lib/libtar.h 2004-08-18 21:59:12.344855632 +0200
25@@ -184,9 +184,7 @@
26 #define th_get_mtime(t) oct_to_int((t)->th_buf.mtime)
27 #define th_get_devmajor(t) oct_to_int((t)->th_buf.devmajor)
28 #define th_get_devminor(t) oct_to_int((t)->th_buf.devminor)
29-#define th_get_linkname(t) ((t)->th_buf.gnu_longlink \
30- ? (t)->th_buf.gnu_longlink \
31- : (t)->th_buf.linkname)
32+char *th_get_linkname(TAR *t);
33 char *th_get_pathname(TAR *t);
34 mode_t th_get_mode(TAR *t);
35 uid_t th_get_uid(TAR *t);