tests: Check return code of setuid()

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-08-22 08:35:19 +02:00
parent 7946104566
commit 6867a35004
8 changed files with 38 additions and 8 deletions

View File

@@ -57,7 +57,9 @@ static int session_setup(void **state)
pwd = getpwnam("bob");
assert_non_null(pwd);
setuid(pwd->pw_uid);
rc = setuid(pwd->pw_uid);
assert_return_code(rc, errno);
s->ssh.session = ssh_new();
assert_non_null(s->ssh.session);