]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
archive_entry_perms.3: clarify that you don't need to strdup() [gu]name (#2239)
authorнаб <nabijaczleweli@nabijaczleweli.xyz>
Fri, 5 Jul 2024 21:36:31 +0000 (23:36 +0200)
committerGitHub <noreply@github.com>
Fri, 5 Jul 2024 21:36:31 +0000 (14:36 -0700)
Currently updating archivemount which does
```c
pwd = getpwuid(st.st_uid);
if(pwd)
archive_entry_set_uname(node->entry, strdup(pwd->pw_name));
grp = getgrgid(st.st_gid);
if(grp)
archive_entry_set_gname(node->entry, strdup(grp->gr_name));
```
and I'm assuming the strdups are actually leaks? The manual is silent on
this.

libarchive/archive_entry_perms.3

index 0291b7b4988bfa248c42049f1dbb840039ca155e..4bfbfc3c7815ae57fa40af50dd47338d47e20179 100644 (file)
@@ -150,6 +150,7 @@ character strings at the same time.
 .Fn archive_entry_set_XXX
 is an alias for
 .Fn archive_entry_copy_XXX .
+The strings are copied, and don't need to outlive the call.
 .Ss File Flags
 File flags are transparently converted between a bitmap
 representation and a textual format.