From: Tim Kientzle Date: Sun, 21 Feb 2010 23:52:52 +0000 (-0500) Subject: Fill in archive_entry_perm() as the read counterpart to X-Git-Tag: v3.0.0a~1216 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50f8302a14f0c3b8225e93ebc5007db1a7b6841c;p=thirdparty%2Flibarchive.git Fill in archive_entry_perm() as the read counterpart to archive_entry_set_perm(). In inadvertently used this in the Mac copyfile() support without realizing that it hadn't actually been implemented. SVN-Revision: 1947 --- diff --git a/libarchive/archive_entry.3 b/libarchive/archive_entry.3 index 9ceb18b7a..6464ab940 100644 --- a/libarchive/archive_entry.3 +++ b/libarchive/archive_entry.3 @@ -73,6 +73,7 @@ .Nm archive_entry_new , .Nm archive_entry_pathname , .Nm archive_entry_pathname_w , +.Nm archive_entry_perm , .Nm archive_entry_rdev , .Nm archive_entry_rdevmajor , .Nm archive_entry_rdevminor , @@ -90,6 +91,7 @@ .Nm archive_entry_set_mode , .Nm archive_entry_set_mtime , .Nm archive_entry_set_pathname , +.Nm archive_entry_set_perm , .Nm archive_entry_set_rdevmajor , .Nm archive_entry_set_rdevminor , .Nm archive_entry_set_size , @@ -355,6 +357,12 @@ There are a few set/get functions that merit additional description: .It Fn archive_entry_set_link This function sets the symlink field if it is already set. Otherwise, it sets the hardlink field. +.It Fn archive_entry_filetype , Fn archive_entry_set_filetype +These allow reading and writing of the file type information +stored in the mode value without affecting the permission bits. +.It Fn archive_entry_perm , Fn archive_entry_set_perm +These allow reading and writing the permission bits stored +in the mode value without affecting the file type information. .El .Ss File Flags File flags are transparently converted between a bitmap diff --git a/libarchive/archive_entry.c b/libarchive/archive_entry.c index b328b17dc..9b89b8127 100644 --- a/libarchive/archive_entry.c +++ b/libarchive/archive_entry.c @@ -705,6 +705,12 @@ archive_entry_pathname_w(struct archive_entry *entry) return (aes_get_wcs(&entry->ae_pathname)); } +mode_t +archive_entry_perm(struct archive_entry *entry) +{ + return (~AE_IFMT & entry->ae_stat.aest_mode); +} + dev_t archive_entry_rdev(struct archive_entry *entry) { diff --git a/libarchive/archive_entry.h b/libarchive/archive_entry.h index d461a26b6..103878d26 100644 --- a/libarchive/archive_entry.h +++ b/libarchive/archive_entry.h @@ -222,6 +222,7 @@ __LA_DECL int archive_entry_mtime_is_set(struct archive_entry *); __LA_DECL unsigned int archive_entry_nlink(struct archive_entry *); __LA_DECL const char *archive_entry_pathname(struct archive_entry *); __LA_DECL const wchar_t *archive_entry_pathname_w(struct archive_entry *); +__LA_DECL __LA_MODE_T archive_entry_perm(struct archive_entry *); __LA_DECL dev_t archive_entry_rdev(struct archive_entry *); __LA_DECL dev_t archive_entry_rdevmajor(struct archive_entry *); __LA_DECL dev_t archive_entry_rdevminor(struct archive_entry *);