Copy filename read from the stdin into the private buffer. Otherwise,
next read filename overwrite previous one, resulting in acl being applied only to the last name in the list. Submitted by: Oleg Lomaka <oleg.lomaka at gmail com> MFC after: 1 week Approved by: kan (mentor)
This commit is contained in:
parent
0295184c7e
commit
410572a159
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=159463
@ -109,6 +109,7 @@ main(int argc, char *argv[])
|
|||||||
int local_error, carried_error, ch, i;
|
int local_error, carried_error, ch, i;
|
||||||
struct sf_file *file;
|
struct sf_file *file;
|
||||||
struct sf_entry *entry;
|
struct sf_entry *entry;
|
||||||
|
const char *fn_dup;
|
||||||
|
|
||||||
acl_type = ACL_TYPE_ACCESS;
|
acl_type = ACL_TYPE_ACCESS;
|
||||||
carried_error = local_error = 0;
|
carried_error = local_error = 0;
|
||||||
@ -187,7 +188,10 @@ main(int argc, char *argv[])
|
|||||||
while (fgets(filename, (int)sizeof(filename), stdin)) {
|
while (fgets(filename, (int)sizeof(filename), stdin)) {
|
||||||
/* remove the \n */
|
/* remove the \n */
|
||||||
filename[strlen(filename) - 1] = '\0';
|
filename[strlen(filename) - 1] = '\0';
|
||||||
add_filename(filename);
|
fn_dup = strdup(filename);
|
||||||
|
if (fn_dup == NULL)
|
||||||
|
err(1, "strdup() failed");
|
||||||
|
add_filename(fn_dup);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
for (i = 0; i < argc; i++)
|
for (i = 0; i < argc; i++)
|
||||||
|
Loading…
Reference in New Issue
Block a user