X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fxattrs.c;h=dbaa2092f5a208a280c3cb5b26f819701db235eb;hb=8e10d93d01049d4c5c58ebe57da499a3873be9db;hp=ef436c769129f7a015b6c628f08ccf53ab0124c7;hpb=8ebbef8a15967965402fc0f79371410b755f4fee;p=chaz%2Ftar diff --git a/src/xattrs.c b/src/xattrs.c index ef436c7..dbaa209 100644 --- a/src/xattrs.c +++ b/src/xattrs.c @@ -1,23 +1,23 @@ /* Support for extended attributes. - Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software - Foundation, Inc. + Copyright (C) 2006-2014 Free Software Foundation, Inc. - Written by James Antill, on 2006-07-27. + This file is part of GNU tar. - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any later - version. + GNU tar is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General - Public License for more details. + GNU tar is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + Written by James Antill, on 2006-07-27. */ #include #include @@ -484,6 +484,7 @@ xattrs_xattrs_get (int parentfd, char const *file_name, } } +#ifdef HAVE_XATTRS static void xattrs__fd_set (struct tar_stat_info const *st, char const *file_name, char typeflag, @@ -509,6 +510,7 @@ xattrs__fd_set (struct tar_stat_info const *st, sysname, attr, file_name)); } } +#endif /* lgetfileconat is called against FILE_NAME iff the FD parameter is set to zero, otherwise the fgetfileconat is used against correct file descriptor */ @@ -693,7 +695,7 @@ xattrs_print_char (struct tar_stat_info const *st, char *output) if (selinux_context_option > 0 && st->cntx_name) *output = '.'; - if (acls_option && (st->acls_a_len || st->acls_d_len)) + if (acls_option > 0 && (st->acls_a_len || st->acls_d_len)) *output = '+'; } @@ -704,11 +706,11 @@ xattrs_print (struct tar_stat_info const *st) return; /* selinux */ - if (selinux_context_option && st->cntx_name) + if (selinux_context_option > 0 && st->cntx_name) fprintf (stdlis, " s: %s\n", st->cntx_name); /* acls */ - if (acls_option && (st->acls_a_len || st->acls_d_len)) + if (acls_option > 0 && (st->acls_a_len || st->acls_d_len)) { fprintf (stdlis, " a: "); acls_one_line ("", ',', st->acls_a_ptr, st->acls_a_len); @@ -717,7 +719,7 @@ xattrs_print (struct tar_stat_info const *st) } /* xattrs */ - if (xattrs_option && st->xattr_map_size) + if (xattrs_option > 0 && st->xattr_map_size) { int i;