summaryrefslogtreecommitdiffstats
path: root/lib/libarchive
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2009-04-17 00:59:34 +0000
committerkientzle <kientzle@FreeBSD.org>2009-04-17 00:59:34 +0000
commit14086ec084cde031ddfc95eb2c794497255fbb4c (patch)
treec1a0a5eafa5118a2695d4f29e1e8356eef0195c0 /lib/libarchive
parent10afcc1c3dccdff2eebc2abb25509056263d5e04 (diff)
downloadFreeBSD-src-14086ec084cde031ddfc95eb2c794497255fbb4c.zip
FreeBSD-src-14086ec084cde031ddfc95eb2c794497255fbb4c.tar.gz
When pulling metadata from disk, lookup the user and group name at the same time.
Diffstat (limited to 'lib/libarchive')
-rw-r--r--lib/libarchive/archive_read_disk_entry_from_file.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/libarchive/archive_read_disk_entry_from_file.c b/lib/libarchive/archive_read_disk_entry_from_file.c
index ef06faa..6e12517 100644
--- a/lib/libarchive/archive_read_disk_entry_from_file.c
+++ b/lib/libarchive/archive_read_disk_entry_from_file.c
@@ -42,6 +42,9 @@ __FBSDID("$FreeBSD$");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
+#ifdef HAVE_SYS_XATTR_H
+#include <sys/xattr.h>
+#endif
#ifdef HAVE_ACL_LIBACL_H
#include <acl/libacl.h>
#endif
@@ -84,7 +87,7 @@ archive_read_disk_entry_from_file(struct archive *_a,
int fd, const struct stat *st)
{
struct archive_read_disk *a = (struct archive_read_disk *)_a;
- const char *path;
+ const char *path, *name;
struct stat s;
int initial_fd = fd;
int r, r1;
@@ -128,6 +131,14 @@ archive_read_disk_entry_from_file(struct archive *_a,
}
archive_entry_copy_stat(entry, st);
+ /* Lookup uname/gname */
+ name = archive_read_disk_uname(_a, archive_entry_uid(entry));
+ if (name != NULL)
+ archive_entry_copy_uname(entry, name);
+ name = archive_read_disk_gname(_a, archive_entry_gid(entry));
+ if (name != NULL)
+ archive_entry_copy_gname(entry, name);
+
#ifdef HAVE_STRUCT_STAT_ST_FLAGS
/* On FreeBSD, we get flags for free with the stat. */
/* TODO: Does this belong in copy_stat()? */
OpenPOWER on IntegriCloud