1<!-- Creator : groff version 1.22.4 --> 2<!-- CreationDate: Sun Aug 22 23:03:25 2021 --> 3<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 4"http://www.w3.org/TR/html4/loose.dtd"> 5<html> 6<head> 7<meta name="generator" content="groff -Thtml, see www.gnu.org"> 8<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> 9<meta name="Content-Style" content="text/css"> 10<style type="text/css"> 11 p { margin-top: 0; margin-bottom: 0; vertical-align: top } 12 pre { margin-top: 0; margin-bottom: 0; vertical-align: top } 13 table { margin-top: 0; margin-bottom: 0; vertical-align: top } 14 h1 { text-align: center } 15</style> 16<title></title> 17</head> 18<body> 19 20<hr> 21 22 23<p>ARCHIVE_ENTRY_PERMS(3) BSD Library Functions Manual 24ARCHIVE_ENTRY_PERMS(3)</p> 25 26<p style="margin-top: 1em"><b>NAME</b></p> 27 28<p style="margin-left:6%;"><b>archive_entry_gid</b>, 29<b>archive_entry_set_gid</b>, <b>archive_entry_uid</b>, 30<b>archive_entry_set_uid</b>, <b>archive_entry_perm</b>, 31<b>archive_entry_set_perm</b>, <b>archive_entry_strmode</b>, 32<b>archive_entry_uname</b>, <b>archive_entry_uname_w</b>, 33<b>archive_entry_set_uname</b>, 34<b>archive_entry_copy_uname</b>, 35<b>archive_entry_copy_uname_w</b>, 36<b>archive_entry_update_uname_utf8</b>, 37<b>archive_entry_gname</b>, <b>archive_entry_gname_w</b>, 38<b>archive_entry_set_gname</b>, 39<b>archive_entry_copy_gname</b>, 40<b>archive_entry_copy_gname_w</b>, 41<b>archive_entry_update_gname_utf8</b>, 42<b>archive_entry_fflags</b>, 43<b>archive_entry_fflags_text</b>, 44<b>archive_entry_set_fflags</b>, 45<b>archive_entry_copy_fflags_text</b>, 46<b>archive_entry_copy_fflags_text_w</b> — functions 47for manipulating ownership and permissions in archive entry 48descriptions</p> 49 50<p style="margin-top: 1em"><b>LIBRARY</b></p> 51 52<p style="margin-left:6%;">Streaming Archive Library 53(libarchive, -larchive)</p> 54 55<p style="margin-top: 1em"><b>SYNOPSIS</b></p> 56 57<p style="margin-left:6%;"><b>#include 58<archive_entry.h></b></p> 59 60 61<p style="margin-left:6%; margin-top: 1em"><i>gid_t</i></p> 62 63 64<p style="margin-left:12%;"><b>archive_entry_gid</b>(<i>struct archive_entry *a</i>);</p> 65 66<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> 67 68 69<p style="margin-left:12%;"><b>archive_entry_set_gid</b>(<i>struct archive_entry *a</i>, 70<i>gid_t gid</i>);</p> 71 72 73<p style="margin-left:6%; margin-top: 1em"><i>uid_t</i></p> 74 75 76<p style="margin-left:12%;"><b>archive_entry_uid</b>(<i>struct archive_entry *a</i>);</p> 77 78<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> 79 80 81<p style="margin-left:12%;"><b>archive_entry_set_uid</b>(<i>struct archive_entry *a</i>, 82<i>uid_t uid</i>);</p> 83 84 85<p style="margin-left:6%; margin-top: 1em"><i>mode_t</i></p> 86 87 88<p style="margin-left:12%;"><b>archive_entry_perm</b>(<i>struct archive_entry *a</i>);</p> 89 90<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> 91 92 93<p style="margin-left:12%;"><b>archive_entry_set_perm</b>(<i>struct archive_entry *a</i>, 94<i>mode_t mode</i>);</p> 95 96<p style="margin-left:6%; margin-top: 1em"><i>const char 97*</i></p> 98 99 100<p style="margin-left:12%;"><b>archive_entry_strmode</b>(<i>struct archive_entry *a</i>);</p> 101 102<p style="margin-left:6%; margin-top: 1em"><i>const char 103*</i></p> 104 105 106<p style="margin-left:12%;"><b>archive_entry_gname</b>(<i>struct archive_entry *a</i>);</p> 107 108<p style="margin-left:6%; margin-top: 1em"><i>const wchar_t 109*</i></p> 110 111 112<p style="margin-left:12%;"><b>archive_entry_gname_w</b>(<i>struct archive_entry *a</i>);</p> 113 114<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> 115 116 117<p style="margin-left:12%;"><b>archive_entry_set_gname</b>(<i>struct archive_entry *a</i>, 118<i>const char *a</i>);</p> 119 120<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> 121 122 123<p style="margin-left:12%;"><b>archive_entry_copy_gname</b>(<i>struct archive_entry *a</i>, 124<i>const char *name</i>);</p> 125 126<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> 127 128 129<p style="margin-left:12%;"><b>archive_entry_copy_gname_w</b>(<i>struct archive_entry *a</i>, 130<i>const wchar_t *name</i>);</p> 131 132<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> 133 134 135<p style="margin-left:12%;"><b>archive_entry_update_gname_utf8</b>(<i>struct archive_entry *a</i>, 136<i>const char *name</i>);</p> 137 138<p style="margin-left:6%; margin-top: 1em"><i>const char 139*</i></p> 140 141 142<p style="margin-left:12%;"><b>archive_entry_uname</b>(<i>struct archive_entry *a</i>);</p> 143 144<p style="margin-left:6%; margin-top: 1em"><i>const wchar_t 145*</i></p> 146 147 148<p style="margin-left:12%;"><b>archive_entry_uname_w</b>(<i>struct archive_entry *a</i>);</p> 149 150<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> 151 152 153<p style="margin-left:12%;"><b>archive_entry_set_uname</b>(<i>struct archive_entry *a</i>, 154<i>const char *name</i>);</p> 155 156<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> 157 158 159<p style="margin-left:12%;"><b>archive_entry_copy_uname</b>(<i>struct archive_entry *a</i>, 160<i>const char *name</i>);</p> 161 162<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> 163 164 165<p style="margin-left:12%;"><b>archive_entry_copy_uname_w</b>(<i>struct archive_entry *a</i>, 166<i>const wchar_t *name</i>);</p> 167 168<p style="margin-left:6%; margin-top: 1em"><i>int</i></p> 169 170 171<p style="margin-left:12%;"><b>archive_entry_update_uname_utf8</b>(<i>struct archive_entry *a</i>, 172<i>const char *name</i>);</p> 173 174<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> 175 176 177<p><b>archive_entry_fflags</b>(<i>struct archive_entry *a</i>, 178<i>unsigned long *set_bits</i>, 179<i>unsigned long *clear_bits</i>);</p> 180 181<p style="margin-left:6%; margin-top: 1em"><i>const char 182*</i></p> 183 184 185<p style="margin-left:12%;"><b>archive_entry_fflags_text</b>(<i>struct archive_entry *a</i>);</p> 186 187<p style="margin-left:6%; margin-top: 1em"><i>void</i></p> 188 189 190<p><b>archive_entry_set_fflags</b>(<i>struct archive_entry *a</i>, 191<i>unsigned long set_bits</i>, 192<i>unsigned long clear_bits</i>);</p> 193 194<p style="margin-left:6%; margin-top: 1em"><i>const char 195*</i></p> 196 197 198<p style="margin-left:12%;"><b>archive_entry_copy_fflags_text</b>(<i>struct archive_entry *a</i>, 199<i>const char *text</i>);</p> 200 201<p style="margin-left:6%; margin-top: 1em"><i>const wchar_t 202*</i></p> 203 204 205<p style="margin-left:12%;"><b>archive_entry_copy_fflags_text_w</b>(<i>struct archive_entry *a</i>, 206<i>const wchar_t *text</i>);</p> 207 208<p style="margin-top: 1em"><b>DESCRIPTION</b></p> 209 210<p style="margin-left:6%;"><b>User id, group id and 211mode</b> <br> 212The functions <b>archive_entry_uid</b>(), 213<b>archive_entry_gid</b>(), and <b>archive_entry_perm</b>() 214can be used to extract the user id, group id and permission 215from the given entry. The corresponding functions 216<b>archive_entry_set_uid</b>(), 217<b>archive_entry_set_gid</b>(), and 218<b>archive_entry_set_perm</b>() store the given user id, 219group id and permission in the entry. The permission is also 220set as a side effect of calling 221<b>archive_entry_set_mode</b>().</p> 222 223 224<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_strmode</b>() 225returns a string representation of the permission as used by 226the long mode of ls(1).</p> 227 228<p style="margin-left:6%; margin-top: 1em"><b>User and 229group name</b> <br> 230User and group names can be provided in one of three 231different ways:</p> 232 233<p style="margin-top: 1em">char *</p> 234 235<p style="margin-left:21%; margin-top: 1em">Multibyte 236strings in the current locale.</p> 237 238<p style="margin-top: 1em">wchar_t *</p> 239 240<p style="margin-left:21%; margin-top: 1em">Wide character 241strings in the current locale. The accessor functions are 242named <b>XXX_w</b>().</p> 243 244<p style="margin-top: 1em">UTF-8</p> 245 246<p style="margin-left:21%; margin-top: 1em">Unicode strings 247encoded as UTF-8. These are convenience functions to update 248both the multibyte and wide character strings at the same 249time.</p> 250 251 252<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_set_XXX</b>() 253is an alias for <b>archive_entry_copy_XXX</b>().</p> 254 255<p style="margin-left:6%; margin-top: 1em"><b>File 256Flags</b> <br> 257File flags are transparently converted between a bitmap 258representation and a textual format. For example, if you set 259the bitmap and ask for text, the library will build a 260canonical text format. However, if you set a text format and 261request a text format, you will get back the same text, even 262if it is ill-formed. If you need to canonicalize a textual 263flags string, you should first set the text form, then 264request the bitmap form, then use that to set the bitmap 265form. Setting the bitmap format will clear the internal text 266representation and force it to be reconstructed when you 267next request the text form.</p> 268 269<p style="margin-left:6%; margin-top: 1em">The bitmap 270format consists of two integers, one containing bits that 271should be set, the other specifying bits that should be 272cleared. Bits not mentioned in either bitmap will be 273ignored. Usually, the bitmap of bits to be cleared will be 274set to zero. In unusual circumstances, you can force a 275fully-specified set of file flags by setting the bitmap of 276flags to clear to the complement of the bitmap of flags to 277set. (This differs from fflagstostr(3), which only includes 278names for set bits.) Converting a bitmap to a textual string 279is a platform-specific operation; bits that are not 280meaningful on the current platform will be ignored.</p> 281 282<p style="margin-left:6%; margin-top: 1em">The canonical 283text format is a comma-separated list of flag names. The 284<b>archive_entry_copy_fflags_text</b>() and 285<b>archive_entry_copy_fflags_text_w</b>() functions parse 286the provided text and set the internal bitmap values. This 287is a platform-specific operation; names that are not 288meaningful on the current platform will be ignored. The 289function returns a pointer to the start of the first name 290that was not recognized, or NULL if every name was 291recognized. Note that every name — including names 292that follow an unrecognized name — will be evaluated, 293and the bitmaps will be set to reflect every name that is 294recognized. (In particular, this differs from 295strtofflags(3), which stops parsing at the first 296unrecognized name.)</p> 297 298<p style="margin-top: 1em"><b>SEE ALSO</b></p> 299 300<p style="margin-left:6%;">archive_entry(3), 301archive_entry_acl(3), archive_read_disk(3), 302archive_write_disk(3), libarchive(3)</p> 303 304<p style="margin-top: 1em"><b>BUGS</b></p> 305 306<p style="margin-left:6%;">The platform types <i>uid_t</i> 307and <i>gid_t</i> are often 16 or 32 bit wide. In this case 308it is possible that the ids can not be correctly restored 309from archives and get truncated.</p> 310 311<p style="margin-left:6%; margin-top: 1em">BSD 312February 2, 2012 BSD</p> 313<hr> 314</body> 315</html> 316