diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2006-06-09 16:09:26 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2006-06-09 16:09:26 +0000 |
| commit | 410572a159fa2625dd6eef80e8f3727b76700290 (patch) | |
| tree | 48e980e98ccf5b2e538ff31b212cbe5b9078b460 /bin/setfacl | |
| parent | 0295184c7e77df0e56f06096b4280a4cc6064b58 (diff) | |
Notes
Diffstat (limited to 'bin/setfacl')
| -rw-r--r-- | bin/setfacl/setfacl.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/setfacl/setfacl.c b/bin/setfacl/setfacl.c index e04feac2e92b..43a55459e0b9 100644 --- a/bin/setfacl/setfacl.c +++ b/bin/setfacl/setfacl.c @@ -109,6 +109,7 @@ main(int argc, char *argv[]) int local_error, carried_error, ch, i; struct sf_file *file; struct sf_entry *entry; + const char *fn_dup; acl_type = ACL_TYPE_ACCESS; carried_error = local_error = 0; @@ -187,7 +188,10 @@ main(int argc, char *argv[]) while (fgets(filename, (int)sizeof(filename), stdin)) { /* remove the \n */ 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 for (i = 0; i < argc; i++) |
