diff options
author | kitsunyan | 2018-04-28 20:51:52 +0000 |
---|---|---|
committer | kitsunyan | 2018-04-28 20:51:52 +0000 |
commit | 5d6e17e57a41071316dfa9a53cd23c85e85ce53e (patch) | |
tree | 734264d260e75daef5a9af06e4003c27fd1fa9ec /src/pacman.nim | |
parent | 8a3beef91b8d6baebd941d4378e6ebbd0dd70906 (diff) |
Print error if chdir, setgroups, setuid, or setgid failed
Diffstat (limited to 'src/pacman.nim')
-rw-r--r-- | src/pacman.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pacman.nim b/src/pacman.nim index 05abf51..58bf42b 100644 --- a/src/pacman.nim +++ b/src/pacman.nim @@ -356,8 +356,10 @@ proc obtainPacmanConfig*(args: seq[Argument]): PacmanConfig = x <- y.split(',')), string].toSet let hasKeyserver = forkWaitRedirect(() => (block: - dropPrivileges() - execResult(gpgConfCmd, "--list-options", "gpg"))) + if dropPrivileges(): + execResult(gpgConfCmd, "--list-options", "gpg") + else: + quit(1))) .output .filter(s => s.len > 10 and s[0 .. 9] == "keyserver:" and not (s[^2] == ':')) .len > 0 |