diff options
author | 2018-09-04 08:28:14 -0400 | |
---|---|---|
committer | 2018-09-04 08:28:14 -0400 | |
commit | e8989dc95bc55644661ded3c2b68212e296d19bd (patch) | |
tree | 7ecdf9603d4bd354902db65d8bd7ca944f993447 /src/firecfg/main.c | |
parent | mainline merges (diff) | |
download | firejail-e8989dc95bc55644661ded3c2b68212e296d19bd.tar.gz firejail-e8989dc95bc55644661ded3c2b68212e296d19bd.tar.zst firejail-e8989dc95bc55644661ded3c2b68212e296d19bd.zip |
mainline merge
Diffstat (limited to 'src/firecfg/main.c')
-rw-r--r-- | src/firecfg/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/firecfg/main.c b/src/firecfg/main.c index 298314d4f..810af6ff2 100644 --- a/src/firecfg/main.c +++ b/src/firecfg/main.c | |||
@@ -318,13 +318,14 @@ int main(int argc, char **argv) { | |||
318 | 318 | ||
319 | // user setup | 319 | // user setup |
320 | char *user = get_user(); | 320 | char *user = get_user(); |
321 | assert(user); | ||
321 | uid_t uid; | 322 | uid_t uid; |
322 | gid_t gid; | 323 | gid_t gid; |
323 | char *home = get_homedir(user, &uid, &gid); | 324 | char *home = get_homedir(user, &uid, &gid); |
324 | 325 | ||
325 | 326 | ||
326 | // check for --bindir | 327 | // check for --bindir |
327 | for (i = i; i < argc; i++) { | 328 | for (i = 1; i < argc; i++) { |
328 | if (strncmp(argv[i], "--bindir=", 9) == 0) { | 329 | if (strncmp(argv[i], "--bindir=", 9) == 0) { |
329 | if (strncmp(argv[i] + 9, "~/", 2) == 0) { | 330 | if (strncmp(argv[i] + 9, "~/", 2) == 0) { |
330 | if (asprintf(&arg_bindir, "%s/%s", home, argv[i] + 11) == -1) | 331 | if (asprintf(&arg_bindir, "%s/%s", home, argv[i] + 11) == -1) |
@@ -430,7 +431,7 @@ int main(int argc, char **argv) { | |||
430 | set_links_firecfg(); | 431 | set_links_firecfg(); |
431 | 432 | ||
432 | // add user to firejail access database - only for root | 433 | // add user to firejail access database - only for root |
433 | if (user && getuid() == 0) { | 434 | if (getuid() == 0) { |
434 | printf("\nAdding user %s to Firejail access database in %s/firejail.users\n", user, SYSCONFDIR); | 435 | printf("\nAdding user %s to Firejail access database in %s/firejail.users\n", user, SYSCONFDIR); |
435 | firejail_user_add(user); | 436 | firejail_user_add(user); |
436 | } | 437 | } |