CHECK_HEADERS(stdint.h stdlib.h string.h)
CHECK_HEADERS(sys/acl.h sys/extattr.h sys/ioctl.h)
CHECK_HEADERS(sys/param.h sys/poll.h sys/select.h sys/time.h sys/utime.h)
-CHECK_HEADERS(time.h unistd.h utime.h wchar.h wctype.h)
+CHECK_HEADERS(time.h unistd.h utime.h wchar.h wctype.h windows.h)
CHECK_INCLUDE_FILE(direct.h HAVE_DIRECT_H)
CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
#
# Check functions
#
-CHECK_FUNCS(chflags chown chroot extattr_set_fd extattr_set_file)
+CHECK_FUNCS(chflags chown chroot)
+CHECK_FUNCS(extattr_get_file extattr_list_file)
+CHECK_FUNCS(extattr_set_fd extattr_set_file)
CHECK_FUNCS(fchdir fchflags fchmod fchown fcntl fork)
CHECK_FUNCS(fstat ftruncate futimes geteuid getpid)
CHECK_FUNCS(lchflags lchmod lchown)
CHECK_FUNCS(lutimes memmove memset mkdir mkfifo mknod)
-CHECK_FUNCS(nl_langinfo pipe poll select setenv setlocale)
+CHECK_FUNCS(nl_langinfo pipe poll readlink select setenv setlocale)
CHECK_FUNCS(strchr strdup strerror strrchr timegm)
CHECK_FUNCS(tzset unsetenv utime utimes vfork)
CHECK_FUNCS(wcscpy wcslen wctomb wmemcmp wmemcpy)
AC_CHECK_HEADERS([stdint.h stdlib.h string.h])
AC_CHECK_HEADERS([sys/acl.h sys/extattr.h sys/ioctl.h])
AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/select.h sys/time.h sys/utime.h])
-AC_CHECK_HEADERS([time.h unistd.h utime.h wchar.h wctype.h])
+AC_CHECK_HEADERS([time.h unistd.h utime.h wchar.h wctype.h windows.h])
# Checks for libraries.
AC_ARG_WITH([zlib],
AC_FUNC_STRERROR_R
AC_FUNC_STRFTIME
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([chflags chown chroot extattr_set_fd extattr_set_file])
+AC_CHECK_FUNCS([chflags chown chroot])
+AC_CHECK_FUNCS([extattr_get_file extattr_list_file])
+AC_CHECK_FUNCS([extattr_set_fd extattr_set_file])
AC_CHECK_FUNCS([fchdir fchflags fchmod fchown fcntl fork])
AC_CHECK_FUNCS([fstat ftruncate futimes geteuid getpid])
AC_CHECK_FUNCS([lchflags lchmod lchown])
AC_CHECK_FUNCS([lutimes memmove memset mkdir mkfifo mknod])
-AC_CHECK_FUNCS([nl_langinfo pipe poll select setenv setlocale])
+AC_CHECK_FUNCS([nl_langinfo pipe poll readlink select setenv setlocale])
AC_CHECK_FUNCS([strchr strdup strerror strrchr timegm])
AC_CHECK_FUNCS([tzset unsetenv utime utimes vfork])
AC_CHECK_FUNCS([wcscpy wcslen wctomb wmemcmp wmemcpy])
#include "archive_platform.h"
__FBSDID("$FreeBSD$");
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
#ifdef HAVE_SYS_ACL_H
#include <sys/acl.h>
#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
#include "archive.h"
#include "archive_entry.h"
int fd, const struct stat *st)
{
struct archive_read_disk *a = (struct archive_read_disk *)_a;
- static char linkbuffer[PATH_MAX + 1];
const char *path;
struct stat s;
int initial_fd = fd;
+ int r, r1;
path = archive_entry_sourcepath(entry);
if (path == NULL)
archive_entry_set_fflags(entry, st->st_flags, 0);
#endif
+#ifdef HAVE_READLINK
if (S_ISLNK(st->st_mode)) {
+ char linkbuffer[PATH_MAX + 1];
int lnklen = readlink(path, linkbuffer, PATH_MAX);
if (lnklen < 0) {
archive_set_error(&a->archive, errno,
linkbuffer[lnklen] = 0;
archive_entry_set_symlink(entry, linkbuffer);
}
+#endif
- /* TODO: collect errors here. */
- setup_acls_posix1e(a, entry, fd);
- setup_xattrs(a, entry, fd);
+ r = setup_acls_posix1e(a, entry, fd);
+ r1 = setup_xattrs(a, entry, fd);
+ if (r1 < r)
+ r = r1;
/* If we opened the file earlier in this function, close it. */
if (initial_fd != fd)
close(fd);
- return (ARCHIVE_OK);
+ return (r);
}
#ifdef HAVE_POSIX_ACL
acl_free(acl);
}
}
+ return (ARCHIVE_OK);
}
/*
}
}
#else
-static void
+static int
setup_acls_posix1e(struct archive_read_disk *a,
struct archive_entry *entry, int fd)
{
(void)a; /* UNUSED */
(void)entry; /* UNUSED */
(void)fd; /* UNUSED */
+ return (ARCHIVE_OK);
}
#else
(void)a; /* UNUSED */
(void)entry; /* UNUSED */
(void)fd; /* UNUSED */
+ return (ARCHIVE_OK);
}
#endif
#define HAVE_ACL_SET_FD_NP 1
#define HAVE_ACL_SET_FILE 1
#define HAVE_ACL_USER 1
+#define HAVE_EXTATTR_GET_FILE 1
+#define HAVE_EXTATTR_LIST_FILE 1
#define HAVE_EXTATTR_SET_FD 1
#define HAVE_EXTATTR_SET_FILE 1
#define HAVE_SYS_ACL_H 1
#define HAVE_POLL 1
#define HAVE_POLL_H 1
#define HAVE_PWD_H 1
+#define HAVE_READLINK 1
#define HAVE_SELECT 1
#define HAVE_SETENV 1
#define HAVE_STDINT_H 1