/* Support for extended attributes.
- Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software
- Foundation, Inc.
+ Copyright (C) 2006-2013 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 <http://www.gnu.org/licenses/>.
+
+ Written by James Antill, on 2006-07-27. */
#include <config.h>
#include <system.h>
#ifdef HAVE_POSIX_ACLS
/* acl-at wrappers, TODO: move to gnulib in future? */
-acl_t acl_get_file_at (int dirfd, const char *file, acl_type_t type);
-int acl_set_file_at (int dirfd, const char *file, acl_type_t type, acl_t acl);
-int file_has_acl_at (int dirfd, char const *, struct stat const *);
+static acl_t acl_get_file_at (int, const char *, acl_type_t);
+static int acl_set_file_at (int, const char *, acl_type_t, acl_t);
+static int file_has_acl_at (int, char const *, struct stat const *);
/* acl_get_file_at */
#define AT_FUNC_NAME acl_get_file_at
skip_to_ext_fields (char *ptr)
{
/* skip tag name (user/group/default/mask) */
- ptr += strcspn (ptr, ":,\n");
+ ptr += strcspn (ptr, ":,\n");
if (*ptr != ':')
return ptr;
xattrs__acls_set (struct tar_stat_info const *st,
char const *file_name, int type,
char *ptr, size_t len, bool def)
-{
+{
acl_t acl;
if (ptr)
xattrs__acls_get_a (int parentfd, const char *file_name,
struct tar_stat_info *st,
char **ret_ptr, size_t * ret_len)
-{
+{
char *val = NULL;
ssize_t len;
acl_t acl;
xattrs__acls_get_d (int parentfd, char const *file_name,
struct tar_stat_info *st,
char **ret_ptr, size_t * ret_len)
-{
+{
char *val = NULL;
ssize_t len;
acl_t acl;
}
void
-xattrs_clear_setup ()
+xattrs_clear_setup (void)
{
clear_mask_map (&xattrs_setup.incl);
clear_mask_map (&xattrs_setup.excl);
xattrs_masked_out (const char *kw, bool archiving)
{
return xattrs_kw_included (kw, archiving) ?
- xattrs_kw_excluded (kw, archiving) : true;
+ xattrs_kw_excluded (kw, archiving) : true;
}
void
if (xattrs_option && st->xattr_map_size)
{
int i;
-
+
for (i = 0; i < st->xattr_map_size; ++i)
{
char *keyword = st->xattr_map[i].xkey + strlen ("SCHILY.xattr.");