From 5d6e17e57a41071316dfa9a53cd23c85e85ce53e Mon Sep 17 00:00:00 2001 From: kitsunyan Date: Sat, 28 Apr 2018 23:51:52 +0300 Subject: Print error if chdir, setgroups, setuid, or setgid failed --- src/pacman.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/pacman.nim') 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 -- cgit v1.2.3-70-g09d2