add support for security.NTACL xattrs (#621215)

This commit is contained in:
Ondřej Vašík 2010-08-16 14:51:07 +02:00
parent dd644af7fe
commit e8e9e33174

View File

@ -1,6 +1,6 @@
diff -urNp tar-1.23-orig/configure.ac tar-1.23/configure.ac diff -urNp tar-1.23-orig/configure.ac tar-1.23/configure.ac
--- tar-1.23-orig/configure.ac 2010-03-10 11:47:54.000000000 +0100 --- tar-1.23-orig/configure.ac 2010-03-10 11:47:54.000000000 +0100
+++ tar-1.23/configure.ac 2010-04-07 20:35:40.393187469 +0200 +++ tar-1.23/configure.ac 2010-08-16 14:32:11.448178888 +0200
@@ -44,7 +44,7 @@ AC_CHECK_HEADERS_ONCE(fcntl.h linux/fd.h @@ -44,7 +44,7 @@ AC_CHECK_HEADERS_ONCE(fcntl.h linux/fd.h
sys/param.h sys/device.h sys/filio.h sys/gentape.h \ sys/param.h sys/device.h sys/filio.h sys/gentape.h \
sys/inet.h sys/io/trioctl.h \ sys/inet.h sys/io/trioctl.h \
@ -50,8 +50,8 @@ diff -urNp tar-1.23-orig/configure.ac tar-1.23/configure.ac
AM_GNU_GETTEXT([external], [need-formatstring-macros]) AM_GNU_GETTEXT([external], [need-formatstring-macros])
AM_GNU_GETTEXT_VERSION([0.16]) AM_GNU_GETTEXT_VERSION([0.16])
diff -urNp tar-1.23-orig/doc/tar.texi tar-1.23/doc/tar.texi diff -urNp tar-1.23-orig/doc/tar.texi tar-1.23/doc/tar.texi
--- tar-1.23-orig/doc/tar.texi 2010-03-09 15:24:24.000000000 +0100 --- tar-1.23-orig/doc/tar.texi 2010-08-16 14:29:00.421912230 +0200
+++ tar-1.23/doc/tar.texi 2010-04-07 20:35:40.413184481 +0200 +++ tar-1.23/doc/tar.texi 2010-08-16 14:32:11.459923196 +0200
@@ -2364,6 +2364,10 @@ Normally when creating an archive, @comm @@ -2364,6 +2364,10 @@ Normally when creating an archive, @comm
@samp{/} from member names. This option disables that behavior. @samp{/} from member names. This option disables that behavior.
@xref{absolute}. @xref{absolute}.
@ -183,7 +183,7 @@ diff -urNp tar-1.23-orig/doc/tar.texi tar-1.23/doc/tar.texi
@node Portability @node Portability
diff -urNp tar-1.23-orig/src/common.h tar-1.23/src/common.h diff -urNp tar-1.23-orig/src/common.h tar-1.23/src/common.h
--- tar-1.23-orig/src/common.h 2010-01-26 13:21:18.000000000 +0100 --- tar-1.23-orig/src/common.h 2010-01-26 13:21:18.000000000 +0100
+++ tar-1.23/src/common.h 2010-04-07 20:35:40.417182960 +0200 +++ tar-1.23/src/common.h 2010-08-16 14:32:11.464922567 +0200
@@ -251,6 +251,15 @@ GLOBAL int same_owner_option; @@ -251,6 +251,15 @@ GLOBAL int same_owner_option;
/* If positive, preserve permissions when extracting. */ /* If positive, preserve permissions when extracting. */
GLOBAL int same_permissions_option; GLOBAL int same_permissions_option;
@ -224,8 +224,8 @@ diff -urNp tar-1.23-orig/src/common.h tar-1.23/src/common.h
/* Module system.c */ /* Module system.c */
diff -urNp tar-1.23-orig/src/create.c tar-1.23/src/create.c diff -urNp tar-1.23-orig/src/create.c tar-1.23/src/create.c
--- tar-1.23-orig/src/create.c 2010-03-09 13:52:41.000000000 +0100 --- tar-1.23-orig/src/create.c 2010-08-16 14:29:00.431912370 +0200
+++ tar-1.23/src/create.c 2010-04-07 20:37:14.972186814 +0200 +++ tar-1.23/src/create.c 2010-08-16 14:32:11.465912091 +0200
@@ -24,6 +24,7 @@ @@ -24,6 +24,7 @@
#include <quotearg.h> #include <quotearg.h>
@ -234,7 +234,7 @@ diff -urNp tar-1.23-orig/src/create.c tar-1.23/src/create.c
#include <hash.h> #include <hash.h>
struct link struct link
@@ -947,6 +948,30 @@ start_header (struct tar_stat_info *st) @@ -954,6 +955,30 @@ start_header (struct tar_stat_info *st)
GNAME_TO_CHARS (st->gname, header->header.gname); GNAME_TO_CHARS (st->gname, header->header.gname);
} }
@ -265,7 +265,7 @@ diff -urNp tar-1.23-orig/src/create.c tar-1.23/src/create.c
return header; return header;
} }
@@ -1580,6 +1605,10 @@ dump_file0 (struct tar_stat_info *st, co @@ -1587,6 +1612,10 @@ dump_file0 (struct tar_stat_info *st, co
} }
} }
@ -276,7 +276,7 @@ diff -urNp tar-1.23-orig/src/create.c tar-1.23/src/create.c
if (is_dir) if (is_dir)
{ {
const char *tag_file_name; const char *tag_file_name;
@@ -1702,6 +1731,9 @@ dump_file0 (struct tar_stat_info *st, co @@ -1710,6 +1739,9 @@ dump_file0 (struct tar_stat_info *st, co
if (NAME_FIELD_SIZE - (archive_format == OLDGNU_FORMAT) < size) if (NAME_FIELD_SIZE - (archive_format == OLDGNU_FORMAT) < size)
write_long_link (st); write_long_link (st);
@ -286,7 +286,7 @@ diff -urNp tar-1.23-orig/src/create.c tar-1.23/src/create.c
block_ordinal = current_block_ordinal (); block_ordinal = current_block_ordinal ();
st->stat.st_size = 0; /* force 0 size on symlink */ st->stat.st_size = 0; /* force 0 size on symlink */
header = start_header (st); header = start_header (st);
@@ -1720,11 +1752,23 @@ dump_file0 (struct tar_stat_info *st, co @@ -1728,11 +1760,23 @@ dump_file0 (struct tar_stat_info *st, co
} }
#endif #endif
else if (S_ISCHR (st->stat.st_mode)) else if (S_ISCHR (st->stat.st_mode))
@ -315,7 +315,7 @@ diff -urNp tar-1.23-orig/src/create.c tar-1.23/src/create.c
WARNOPT (WARN_FILE_IGNORED, WARNOPT (WARN_FILE_IGNORED,
diff -urNp tar-1.23-orig/src/extract.c tar-1.23/src/extract.c diff -urNp tar-1.23-orig/src/extract.c tar-1.23/src/extract.c
--- tar-1.23-orig/src/extract.c 2010-01-26 12:28:09.000000000 +0100 --- tar-1.23-orig/src/extract.c 2010-01-26 12:28:09.000000000 +0100
+++ tar-1.23/src/extract.c 2010-04-07 20:35:40.419184383 +0200 +++ tar-1.23/src/extract.c 2010-08-16 14:32:11.467922288 +0200
@@ -70,6 +70,13 @@ struct delayed_set_stat @@ -70,6 +70,13 @@ struct delayed_set_stat
mode_t invert_permissions; mode_t invert_permissions;
enum permstatus permstatus; enum permstatus permstatus;
@ -524,8 +524,8 @@ diff -urNp tar-1.23-orig/src/extract.c tar-1.23/src/extract.c
struct delayed_link *next = ds->next; struct delayed_link *next = ds->next;
free (ds); free (ds);
diff -urNp tar-1.23-orig/src/list.c tar-1.23/src/list.c diff -urNp tar-1.23-orig/src/list.c tar-1.23/src/list.c
--- tar-1.23-orig/src/list.c 2010-04-07 20:34:14.637500018 +0200 --- tar-1.23-orig/src/list.c 2010-08-16 14:29:00.411912161 +0200
+++ tar-1.23/src/list.c 2010-04-07 20:35:40.421184013 +0200 +++ tar-1.23/src/list.c 2010-08-16 14:32:11.468912021 +0200
@@ -586,6 +586,13 @@ decode_header (union block *header, stru @@ -586,6 +586,13 @@ decode_header (union block *header, stru
assign_string (&stat_info->gname, assign_string (&stat_info->gname,
header->header.gname[0] ? header->header.gname : NULL); header->header.gname[0] ? header->header.gname : NULL);
@ -542,7 +542,7 @@ diff -urNp tar-1.23-orig/src/list.c tar-1.23/src/list.c
stat_info->atime.tv_sec = TIME_FROM_HEADER (header->oldgnu_header.atime); stat_info->atime.tv_sec = TIME_FROM_HEADER (header->oldgnu_header.atime);
diff -urNp tar-1.23-orig/src/Makefile.am tar-1.23/src/Makefile.am diff -urNp tar-1.23-orig/src/Makefile.am tar-1.23/src/Makefile.am
--- tar-1.23-orig/src/Makefile.am 2010-01-26 12:30:20.000000000 +0100 --- tar-1.23-orig/src/Makefile.am 2010-01-26 12:30:20.000000000 +0100
+++ tar-1.23/src/Makefile.am 2010-04-07 20:35:40.423194594 +0200 +++ tar-1.23/src/Makefile.am 2010-08-16 14:32:11.469911951 +0200
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
bin_PROGRAMS = tar bin_PROGRAMS = tar
@ -567,8 +567,8 @@ diff -urNp tar-1.23-orig/src/Makefile.am tar-1.23/src/Makefile.am
-tar_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) -tar_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
+tar_LDADD = $(LIBS) $(LDADD) $(LIB_CLOCK_GETTIME) +tar_LDADD = $(LIBS) $(LDADD) $(LIB_CLOCK_GETTIME)
diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
--- tar-1.23-orig/src/tar.c 2010-03-09 13:52:41.000000000 +0100 --- tar-1.23-orig/src/tar.c 2010-08-16 14:29:00.433923894 +0200
+++ tar-1.23/src/tar.c 2010-04-07 20:35:40.426309460 +0200 +++ tar-1.23/src/tar.c 2010-08-16 14:32:11.472912580 +0200
@@ -255,7 +255,8 @@ tar_set_quoting_style (char *arg) @@ -255,7 +255,8 @@ tar_set_quoting_style (char *arg)
enum enum
@ -643,7 +643,7 @@ diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
{"preserve", PRESERVE_OPTION, 0, 0, {"preserve", PRESERVE_OPTION, 0, 0,
N_("same as both -p and -s"), GRID+1 }, N_("same as both -p and -s"), GRID+1 },
{"delay-directory-restore", DELAY_DIRECTORY_RESTORE_OPTION, 0, 0, {"delay-directory-restore", DELAY_DIRECTORY_RESTORE_OPTION, 0, 0,
@@ -2060,6 +2078,37 @@ parse_opt (int key, char *arg, struct ar @@ -2063,6 +2081,37 @@ parse_opt (int key, char *arg, struct ar
same_permissions_option = -1; same_permissions_option = -1;
break; break;
@ -681,7 +681,7 @@ diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
case RECURSION_OPTION: case RECURSION_OPTION:
recursion_option = FNM_LEADING_DIR; recursion_option = FNM_LEADING_DIR;
break; break;
@@ -2442,6 +2491,29 @@ decode_options (int argc, char **argv) @@ -2445,6 +2494,29 @@ decode_options (int argc, char **argv)
|| subcommand_option != LIST_SUBCOMMAND)) || subcommand_option != LIST_SUBCOMMAND))
USAGE_ERROR ((0, 0, _("--pax-option can be used only on POSIX archives"))); USAGE_ERROR ((0, 0, _("--pax-option can be used only on POSIX archives")));
@ -711,7 +711,7 @@ diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
/* If ready to unlink hierarchies, so we are for simpler files. */ /* If ready to unlink hierarchies, so we are for simpler files. */
if (recursive_unlink_option) if (recursive_unlink_option)
old_files_option = UNLINK_FIRST_OLD_FILES; old_files_option = UNLINK_FIRST_OLD_FILES;
@@ -2662,11 +2734,15 @@ tar_stat_init (struct tar_stat_info *st) @@ -2665,11 +2737,15 @@ tar_stat_init (struct tar_stat_info *st)
void void
tar_stat_destroy (struct tar_stat_info *st) tar_stat_destroy (struct tar_stat_info *st)
{ {
@ -729,7 +729,7 @@ diff -urNp tar-1.23-orig/src/tar.c tar-1.23/src/tar.c
xheader_destroy (&st->xhdr); xheader_destroy (&st->xhdr);
diff -urNp tar-1.23-orig/src/tar.h tar-1.23/src/tar.h diff -urNp tar-1.23-orig/src/tar.h tar-1.23/src/tar.h
--- tar-1.23-orig/src/tar.h 2010-01-26 12:30:20.000000000 +0100 --- tar-1.23-orig/src/tar.h 2010-01-26 12:30:20.000000000 +0100
+++ tar-1.23/src/tar.h 2010-04-07 20:35:40.428311754 +0200 +++ tar-1.23/src/tar.h 2010-08-16 14:32:11.473924383 +0200
@@ -276,6 +276,14 @@ struct xheader @@ -276,6 +276,14 @@ struct xheader
uintmax_t string_length; uintmax_t string_length;
}; };
@ -773,8 +773,8 @@ diff -urNp tar-1.23-orig/src/tar.h tar-1.23/src/tar.h
diff -urNp tar-1.23-orig/src/xattrs.c tar-1.23/src/xattrs.c diff -urNp tar-1.23-orig/src/xattrs.c tar-1.23/src/xattrs.c
--- tar-1.23-orig/src/xattrs.c 1970-01-01 01:00:00.000000000 +0100 --- tar-1.23-orig/src/xattrs.c 1970-01-01 01:00:00.000000000 +0100
+++ tar-1.23/src/xattrs.c 2010-04-07 20:35:40.430309239 +0200 +++ tar-1.23/src/xattrs.c 2010-08-16 14:34:12.554509938 +0200
@@ -0,0 +1,488 @@ @@ -0,0 +1,489 @@
+/* Create a tar archive. +/* Create a tar archive.
+ +
+ Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006 Free Software Foundation, Inc.
@ -1251,7 +1251,8 @@ diff -urNp tar-1.23-orig/src/xattrs.c tar-1.23/src/xattrs.c
+ +
+ if (strncmp (keyword, "user.", strlen("user.")) && + if (strncmp (keyword, "user.", strlen("user.")) &&
+ strncmp (keyword, "lustre.", strlen("lustre.")) && + strncmp (keyword, "lustre.", strlen("lustre.")) &&
+ strncmp (keyword, "trusted.", strlen("trusted."))) + strncmp (keyword, "trusted.", strlen("trusted."))
+ strncmp (keyword, "security.NTACL", strlen("security.NTACL")))
+ continue; /* don't try and set anything but normal xattrs */ + continue; /* don't try and set anything but normal xattrs */
+ +
+ xattrs__fd_set (st, file_name, typeflag, keyword, + xattrs__fd_set (st, file_name, typeflag, keyword,
@ -1265,7 +1266,7 @@ diff -urNp tar-1.23-orig/src/xattrs.c tar-1.23/src/xattrs.c
+} +}
diff -urNp tar-1.23-orig/src/xattrs.h tar-1.23/src/xattrs.h diff -urNp tar-1.23-orig/src/xattrs.h tar-1.23/src/xattrs.h
--- tar-1.23-orig/src/xattrs.h 1970-01-01 01:00:00.000000000 +0100 --- tar-1.23-orig/src/xattrs.h 1970-01-01 01:00:00.000000000 +0100
+++ tar-1.23/src/xattrs.h 2010-04-07 20:35:40.431310870 +0200 +++ tar-1.23/src/xattrs.h 2010-08-16 14:32:11.475920821 +0200
@@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
+ +
+extern void xattrs_acls_get(struct tar_stat_info *st, +extern void xattrs_acls_get(struct tar_stat_info *st,
@ -1283,7 +1284,7 @@ diff -urNp tar-1.23-orig/src/xattrs.h tar-1.23/src/xattrs.h
+ char const *file_name, char typeflag); + char const *file_name, char typeflag);
diff -urNp tar-1.23-orig/src/xheader.c tar-1.23/src/xheader.c diff -urNp tar-1.23-orig/src/xheader.c tar-1.23/src/xheader.c
--- tar-1.23-orig/src/xheader.c 2010-02-12 11:03:09.000000000 +0100 --- tar-1.23-orig/src/xheader.c 2010-02-12 11:03:09.000000000 +0100
+++ tar-1.23/src/xheader.c 2010-04-07 20:35:40.434310075 +0200 +++ tar-1.23/src/xheader.c 2010-08-16 14:38:39.480912020 +0200
@@ -459,6 +459,74 @@ xheader_write_global (struct xheader *xh @@ -459,6 +459,74 @@ xheader_write_global (struct xheader *xh
} }
} }
@ -1554,7 +1555,7 @@ diff -urNp tar-1.23-orig/src/xheader.c tar-1.23/src/xheader.c
/* These may be present in a first global header of the archive. /* These may be present in a first global header of the archive.
They provide the same functionality as GNUTYPE_MULTIVOL header. They provide the same functionality as GNUTYPE_MULTIVOL header.
@@ -1560,11 +1703,40 @@ struct xhdr_tab const xhdr_tab[] = { @@ -1560,11 +1703,41 @@ struct xhdr_tab const xhdr_tab[] = {
GNU.volume.offset keeps the offset of the start of this volume, GNU.volume.offset keeps the offset of the start of this volume,
otherwise kept in oldgnu_header.offset. */ otherwise kept in oldgnu_header.offset. */
{ "GNU.volume.filename", volume_label_coder, volume_filename_decoder, { "GNU.volume.filename", volume_label_coder, volume_filename_decoder,
@ -1592,6 +1593,7 @@ diff -urNp tar-1.23-orig/src/xheader.c tar-1.23/src/xheader.c
+ { "SCHILY.xattr.user", xattr_coder, xattr_decoder, 0, true }, + { "SCHILY.xattr.user", xattr_coder, xattr_decoder, 0, true },
+ { "SCHILY.xattr.trusted", xattr_coder, xattr_decoder, 0, true }, + { "SCHILY.xattr.trusted", xattr_coder, xattr_decoder, 0, true },
+ { "SCHILY.xattr.lustre", xattr_coder, xattr_decoder, 0, true }, + { "SCHILY.xattr.lustre", xattr_coder, xattr_decoder, 0, true },
+ { "SCHILY.xattr.security.NTACL", xattr_coder, xattr_decoder, 0, true },
+ +
+ /* ignore everything else in the xattr namespaces... */ + /* ignore everything else in the xattr namespaces... */
+ { "SCHILY.xattr", dummy_coder, dummy_decoder, 0, true }, + { "SCHILY.xattr", dummy_coder, dummy_decoder, 0, true },