summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2004-06-27 23:16:42 +0000
committerkientzle <kientzle@FreeBSD.org>2004-06-27 23:16:42 +0000
commit36a1ffc19fdb2f673d50d56144bf6e6e177efdc4 (patch)
tree2e600a07cf5a2831efef2f112c7038347d963e15 /lib
parentbac8cc2a430f9c92e42c0e8b79eac42b782d818f (diff)
downloadFreeBSD-src-36a1ffc19fdb2f673d50d56144bf6e6e177efdc4.zip
FreeBSD-src-36a1ffc19fdb2f673d50d56144bf6e6e177efdc4.tar.gz
Add two new convenience functions to query the uid/gid from an
archive_entry. Update the Makefile MLINKS and manpage to bring it up-to-date with the current status of archive_entry. At least the manpage actually lists all of the functions now, even if it doesn't really yet explain them all.
Diffstat (limited to 'lib')
-rw-r--r--lib/libarchive/Makefile25
-rw-r--r--lib/libarchive/Makefile.freebsd25
-rw-r--r--lib/libarchive/archive_entry.382
-rw-r--r--lib/libarchive/archive_entry.c12
-rw-r--r--lib/libarchive/archive_entry.h6
5 files changed, 121 insertions, 29 deletions
diff --git a/lib/libarchive/Makefile b/lib/libarchive/Makefile
index c4fa3e4..a9a4c29 100644
--- a/lib/libarchive/Makefile
+++ b/lib/libarchive/Makefile
@@ -55,6 +55,14 @@ MAN= archive_entry.3 \
libarchive-formats.5 \
tar.5
+MLINKS+= archive_entry.3 archive_entry_acl_add_entry.3
+MLINKS+= archive_entry.3 archive_entry_acl_add_entry_w.3
+MLINKS+= archive_entry.3 archive_entry_acl_clear.3
+MLINKS+= archive_entry.3 archive_entry_acl_count.3
+MLINKS+= archive_entry.3 archive_entry_acl_next.3
+MLINKS+= archive_entry.3 archive_entry_acl_next_w.3
+MLINKS+= archive_entry.3 archive_entry_acl_reset.3
+MLINKS+= archive_entry.3 archive_entry_acl_text_w.3
MLINKS+= archive_entry.3 archive_entry_clear.3
MLINKS+= archive_entry.3 archive_entry_clone.3
MLINKS+= archive_entry.3 archive_entry_copy_fflags_text_w.3
@@ -67,28 +75,37 @@ MLINKS+= archive_entry.3 archive_entry_copy_uname_w.3
MLINKS+= archive_entry.3 archive_entry_fflags.3
MLINKS+= archive_entry.3 archive_entry_fflags_text.3
MLINKS+= archive_entry.3 archive_entry_free.3
+MLINKS+= archive_entry.3 archive_entry_gid.3
MLINKS+= archive_entry.3 archive_entry_gname.3
MLINKS+= archive_entry.3 archive_entry_gname_w.3
MLINKS+= archive_entry.3 archive_entry_hardlink.3
-MLINKS+= archive_entry.3 archive_entry_hardlink_w.3
+MLINKS+= archive_entry.3 archive_entry_ino.3
+MLINKS+= archive_entry.3 archive_entry_mode.3
+MLINKS+= archive_entry.3 archive_entry_mtime.3
+MLINKS+= archive_entry.3 archive_entry_mtime_nsec.3
MLINKS+= archive_entry.3 archive_entry_new.3
MLINKS+= archive_entry.3 archive_entry_pathname.3
MLINKS+= archive_entry.3 archive_entry_pathname_w.3
-MLINKS+= archive_entry.3 archive_entry_set_devmajor.3
-MLINKS+= archive_entry.3 archive_entry_set_devminor.3
+MLINKS+= archive_entry.3 archive_entry_rdev.3
+MLINKS+= archive_entry.3 archive_entry_rdevmajor.3
+MLINKS+= archive_entry.3 archive_entry_rdevminor.3
+MLINKS+= archive_entry.3 archive_entry_set_fflags.3
MLINKS+= archive_entry.3 archive_entry_set_gid.3
MLINKS+= archive_entry.3 archive_entry_set_gname.3
MLINKS+= archive_entry.3 archive_entry_set_hardlink.3
MLINKS+= archive_entry.3 archive_entry_set_link.3
MLINKS+= archive_entry.3 archive_entry_set_mode.3
MLINKS+= archive_entry.3 archive_entry_set_pathname.3
+MLINKS+= archive_entry.3 archive_entry_set_rdevmajor.3
+MLINKS+= archive_entry.3 archive_entry_set_rdevminor.3
+MLINKS+= archive_entry.3 archive_entry_set_size.3
MLINKS+= archive_entry.3 archive_entry_set_symlink.3
MLINKS+= archive_entry.3 archive_entry_set_uid.3
MLINKS+= archive_entry.3 archive_entry_set_uname.3
MLINKS+= archive_entry.3 archive_entry_size.3
MLINKS+= archive_entry.3 archive_entry_stat.3
MLINKS+= archive_entry.3 archive_entry_symlink.3
-MLINKS+= archive_entry.3 archive_entry_symlink_w.3
+MLINKS+= archive_entry.3 archive_entry_uid.3
MLINKS+= archive_entry.3 archive_entry_uname.3
MLINKS+= archive_entry.3 archive_entry_uname_w.3
MLINKS+= archive_read.3 archive_read_data.3
diff --git a/lib/libarchive/Makefile.freebsd b/lib/libarchive/Makefile.freebsd
index c4fa3e4..a9a4c29 100644
--- a/lib/libarchive/Makefile.freebsd
+++ b/lib/libarchive/Makefile.freebsd
@@ -55,6 +55,14 @@ MAN= archive_entry.3 \
libarchive-formats.5 \
tar.5
+MLINKS+= archive_entry.3 archive_entry_acl_add_entry.3
+MLINKS+= archive_entry.3 archive_entry_acl_add_entry_w.3
+MLINKS+= archive_entry.3 archive_entry_acl_clear.3
+MLINKS+= archive_entry.3 archive_entry_acl_count.3
+MLINKS+= archive_entry.3 archive_entry_acl_next.3
+MLINKS+= archive_entry.3 archive_entry_acl_next_w.3
+MLINKS+= archive_entry.3 archive_entry_acl_reset.3
+MLINKS+= archive_entry.3 archive_entry_acl_text_w.3
MLINKS+= archive_entry.3 archive_entry_clear.3
MLINKS+= archive_entry.3 archive_entry_clone.3
MLINKS+= archive_entry.3 archive_entry_copy_fflags_text_w.3
@@ -67,28 +75,37 @@ MLINKS+= archive_entry.3 archive_entry_copy_uname_w.3
MLINKS+= archive_entry.3 archive_entry_fflags.3
MLINKS+= archive_entry.3 archive_entry_fflags_text.3
MLINKS+= archive_entry.3 archive_entry_free.3
+MLINKS+= archive_entry.3 archive_entry_gid.3
MLINKS+= archive_entry.3 archive_entry_gname.3
MLINKS+= archive_entry.3 archive_entry_gname_w.3
MLINKS+= archive_entry.3 archive_entry_hardlink.3
-MLINKS+= archive_entry.3 archive_entry_hardlink_w.3
+MLINKS+= archive_entry.3 archive_entry_ino.3
+MLINKS+= archive_entry.3 archive_entry_mode.3
+MLINKS+= archive_entry.3 archive_entry_mtime.3
+MLINKS+= archive_entry.3 archive_entry_mtime_nsec.3
MLINKS+= archive_entry.3 archive_entry_new.3
MLINKS+= archive_entry.3 archive_entry_pathname.3
MLINKS+= archive_entry.3 archive_entry_pathname_w.3
-MLINKS+= archive_entry.3 archive_entry_set_devmajor.3
-MLINKS+= archive_entry.3 archive_entry_set_devminor.3
+MLINKS+= archive_entry.3 archive_entry_rdev.3
+MLINKS+= archive_entry.3 archive_entry_rdevmajor.3
+MLINKS+= archive_entry.3 archive_entry_rdevminor.3
+MLINKS+= archive_entry.3 archive_entry_set_fflags.3
MLINKS+= archive_entry.3 archive_entry_set_gid.3
MLINKS+= archive_entry.3 archive_entry_set_gname.3
MLINKS+= archive_entry.3 archive_entry_set_hardlink.3
MLINKS+= archive_entry.3 archive_entry_set_link.3
MLINKS+= archive_entry.3 archive_entry_set_mode.3
MLINKS+= archive_entry.3 archive_entry_set_pathname.3
+MLINKS+= archive_entry.3 archive_entry_set_rdevmajor.3
+MLINKS+= archive_entry.3 archive_entry_set_rdevminor.3
+MLINKS+= archive_entry.3 archive_entry_set_size.3
MLINKS+= archive_entry.3 archive_entry_set_symlink.3
MLINKS+= archive_entry.3 archive_entry_set_uid.3
MLINKS+= archive_entry.3 archive_entry_set_uname.3
MLINKS+= archive_entry.3 archive_entry_size.3
MLINKS+= archive_entry.3 archive_entry_stat.3
MLINKS+= archive_entry.3 archive_entry_symlink.3
-MLINKS+= archive_entry.3 archive_entry_symlink_w.3
+MLINKS+= archive_entry.3 archive_entry_uid.3
MLINKS+= archive_entry.3 archive_entry_uname.3
MLINKS+= archive_entry.3 archive_entry_uname_w.3
MLINKS+= archive_read.3 archive_read_data.3
diff --git a/lib/libarchive/archive_entry.3 b/lib/libarchive/archive_entry.3
index e128b6c..a0eba79 100644
--- a/lib/libarchive/archive_entry.3
+++ b/lib/libarchive/archive_entry.3
@@ -28,27 +28,41 @@
.Dt archive_entry 3
.Os
.Sh NAME
+.Nm archive_entry_acl_add_entry
+.Nm archive_entry_acl_add_entry_w
+.Nm archive_entry_acl_clear
+.Nm archive_entry_acl_count
+.Nm archive_entry_acl_next
+.Nm archive_entry_acl_next_w
+.Nm archive_entry_acl_reset
+.Nm archive_entry_acl_text_w
.Nm archive_entry_clear
.Nm archive_entry_clone
.Nm archive_entry_copy_fflags_text_w
.Nm archive_entry_copy_gname_w
+.Nm archive_entry_copy_hardlink
.Nm archive_entry_copy_hardlink_w
.Nm archive_entry_copy_pathname_w
.Nm archive_entry_copy_stat
.Nm archive_entry_copy_symlink_w
.Nm archive_entry_copy_uname_w
+.Nm archive_entry_dev
.Nm archive_entry_fflags
.Nm archive_entry_fflags_text
.Nm archive_entry_free
+.Nm archive_entry_gid
.Nm archive_entry_gname
-.Nm archive_entry_gname_w
.Nm archive_entry_hardlink
-.Nm archive_entry_hardlink_w
+.Nm archive_entry_ino
+.Nm archive_entry_mode
+.Nm archive_entry_mtime
+.Nm archive_entry_mtime_nsec
.Nm archive_entry_new
.Nm archive_entry_pathname
.Nm archive_entry_pathname_w
-.Nm archive_entry_set_devmajor
-.Nm archive_entry_set_devminor
+.Nm archive_entry_rdev
+.Nm archive_entry_rdevmajor
+.Nm archive_entry_rdevminor
.Nm archive_entry_set_fflags
.Nm archive_entry_set_gid
.Nm archive_entry_set_gname
@@ -56,19 +70,37 @@
.Nm archive_entry_set_link
.Nm archive_entry_set_mode
.Nm archive_entry_set_pathname
+.Nm archive_entry_set_rdevmajor
+.Nm archive_entry_set_rdevminor
+.Nm archive_entry_set_size
.Nm archive_entry_set_symlink
.Nm archive_entry_set_uid
.Nm archive_entry_set_uname
.Nm archive_entry_size
.Nm archive_entry_stat
.Nm archive_entry_symlink
-.Nm archive_entry_symlink_w
+.Nm archive_entry_uid
.Nm archive_entry_uname
-.Nm archive_entry_uname_w
.Nd functions for manipulating archive entry descriptions
.Sh SYNOPSIS
.In archive_entry.h
.Ft void
+.Fn archive_entry_acl_add_entry "struct archive_entry *" "int type" "int permset" "int tag" "int qual" "const char *name"
+.Ft void
+.Fn archive_entry_acl_add_entry_w "struct archive_entry *" "int type" "int permset" "int tag" "int qual" "const wchar_t *name"
+.Ft void
+.Fn archive_entry_acl_clear "struct archive_entry *"
+.Ft int
+.Fn archive_entry_acl_count "struct archive_entry *" "int type"
+.Ft int
+.Fn archive_entry_acl_next "struct archive_entry *" "int want_type" "int *type" "int *permset" "int *tag" "int *qual" "const char **name"
+.Ft int
+.Fn archive_entry_acl_next_w "struct archive_entry *" "int want_type" "int *type" "int *permset" "int *tag" "int *qual" "const wchar_t **name"
+.Ft void
+.Fn archive_entry_acl_reset "struct archive_entry *"
+.Ft const wchar_t *
+.Fn archive_entry_acl_text_w "struct archive_entry *" "int flags"
+.Ft void
.Fn archive_entry_clear "struct archive_entry *"
.Ft struct archive_entry *
.Fn archive_entry_clone "struct archive_entry *"
@@ -77,6 +109,8 @@
.Ft void
.Fn archive_entry_copy_gname_w "struct archive_entry *" "const wchar_t *"
.Ft void
+.Fn archive_entry_copy_hardlink "struct archive_entry *" "const char *"
+.Ft void
.Fn archive_entry_copy_hardlink_w "struct archive_entry *" "const wchar_t *"
.Ft void
.Fn archive_entry_copy_pathname_w "struct archive_entry *" "const wchar_t *"
@@ -86,6 +120,8 @@
.Fn archive_entry_copy_symlink_w "struct archive_entry *" "const wchar_t *"
.Ft void
.Fn archive_entry_copy_uname_w "struct archive_entry *" "const wchar_t *"
+.Ft dev_t
+.Fn archive_entry_dev "struct archive_entry *"
.Ft void
.Fn archive_entry_fflags "struct archive_entry *" "unsigned long *set" "unsigned long *clear"
.Ft const char *
@@ -94,22 +130,28 @@
.Fn archive_entry_free "struct archive_entry *"
.Ft const char *
.Fn archive_entry_gname "struct archive_entry *"
-.Ft const wchar_t *
-.Fn archive_entry_gname_w "struct archive_entry *"
.Ft const char *
.Fn archive_entry_hardlink "struct archive_entry *"
-.Ft const wchar_t *
-.Fn archive_entry_hardlink_w "struct archive_entry *"
+.Ft ino_t
+.Fn archive_entry_ino "struct archive_entry *"
+.Ft mode_t
+.Fn archive_entry_mode "struct archive_entry *"
+.Ft time_t
+.Fn archive_entry_mtime "struct archive_entry *"
+.Ft long
+.Fn archive_entry_mtime_nsec "struct archive_entry *"
.Ft struct archive_entry *
.Fn archive_entry_new "void"
.Ft const char *
.Fn archive_entry_pathname "struct archive_entry *"
.Ft const wchar_t *
.Fn archive_entry_pathname_w "struct archive_entry *"
-.Ft void
-.Fn archive_entry_set_devmajor "struct archive_entry *" "dev_t"
-.Ft void
-.Fn archive_entry_set_devminor "struct archive_entry *" "dev_t"
+.Ft dev_t
+.Fn archive_entry_rdev "struct archive_entry *"
+.Ft dev_t
+.Fn archive_entry_rdevmajor "struct archive_entry *"
+.Ft dev_t
+.Fn archive_entry_rdevminor "struct archive_entry *"
.Ft void
.Fn archive_entry_set_fflags "struct archive_entry *" "unsigned long set" "unsigned long clear"
.Ft void
@@ -119,10 +161,18 @@
.Ft void
.Fn archive_entry_set_hardlink "struct archive_entry *" "const char *"
.Ft void
+.Fn archive_entry_set_link "struct archive_entry *" "const char *"
+.Ft void
.Fn archive_entry_set_mode "struct archive_entry *" "mode_t"
.Ft void
.Fn archive_entry_set_pathname "struct archive_entry *" "const char *"
.Ft void
+.Fn archive_entry_set_rdevmajor "struct archive_entry *" "dev_t"
+.Ft void
+.Fn archive_entry_set_rdevminor "struct archive_entry *" "dev_t"
+.Ft void
+.Fn archive_entry_set_size "struct archive_entry *" "int64_t"
+.Ft void
.Fn archive_entry_set_symlink "struct archive_entry *" "const char *"
.Ft void
.Fn archive_entry_set_uid "struct archive_entry *" "uid_t"
@@ -134,12 +184,8 @@
.Fn archive_entry_stat "struct archive_entry *"
.Ft const char *
.Fn archive_entry_symlink "struct archive_entry *"
-.Ft const wchar_t *
-.Fn archive_entry_symlink_w "struct archive_entry *"
.Ft const char *
.Fn archive_entry_uname "struct archive_entry *"
-.Ft const wchar_t *
-.Fn archive_entry_uname_w "struct archive_entry *"
.Sh DESCRIPTION
These functions create and manipulate data objects that
represent entries within an archive.
diff --git a/lib/libarchive/archive_entry.c b/lib/libarchive/archive_entry.c
index 0007e7a..0a76114 100644
--- a/lib/libarchive/archive_entry.c
+++ b/lib/libarchive/archive_entry.c
@@ -384,6 +384,12 @@ archive_entry_fflags_text(struct archive_entry *entry)
return (f);
}
+gid_t
+archive_entry_gid(struct archive_entry *entry)
+{
+ return (entry->ae_stat.st_gid);
+}
+
const char *
archive_entry_gname(struct archive_entry *entry)
{
@@ -468,6 +474,12 @@ archive_entry_symlink(struct archive_entry *entry)
return (aes_get_mbs(&entry->ae_symlink));
}
+uid_t
+archive_entry_uid(struct archive_entry *entry)
+{
+ return (entry->ae_stat.st_uid);
+}
+
const char *
archive_entry_uname(struct archive_entry *entry)
{
diff --git a/lib/libarchive/archive_entry.h b/lib/libarchive/archive_entry.h
index b725a3b..9feb6d4 100644
--- a/lib/libarchive/archive_entry.h
+++ b/lib/libarchive/archive_entry.h
@@ -47,8 +47,6 @@
* such extensions may make this library useful for special
* applications (e.g., a package manager could attach special
* package-management attributes to each entry).
- *
- * TODO: Design a good API for handling sparse files.
*/
struct archive_entry;
@@ -67,9 +65,10 @@ struct archive_entry *archive_entry_new(void);
*/
dev_t archive_entry_dev(struct archive_entry *);
-const char *archive_entry_fflags_text(struct archive_entry *);
void archive_entry_fflags(struct archive_entry *,
unsigned long *set, unsigned long *clear);
+const char *archive_entry_fflags_text(struct archive_entry *);
+gid_t archive_entry_gid(struct archive_entry *);
const char *archive_entry_gname(struct archive_entry *);
const char *archive_entry_hardlink(struct archive_entry *);
ino_t archive_entry_ino(struct archive_entry *);
@@ -84,6 +83,7 @@ dev_t archive_entry_rdevminor(struct archive_entry *);
int64_t archive_entry_size(struct archive_entry *);
const struct stat *archive_entry_stat(struct archive_entry *);
const char *archive_entry_symlink(struct archive_entry *);
+uid_t archive_entry_uid(struct archive_entry *);
const char *archive_entry_uname(struct archive_entry *);
/*
OpenPOWER on IntegriCloud