summaryrefslogtreecommitdiffstats
path: root/usr.sbin/jail
diff options
context:
space:
mode:
authorjamie <jamie@FreeBSD.org>2016-01-16 18:13:28 +0000
committerjamie <jamie@FreeBSD.org>2016-01-16 18:13:28 +0000
commite18c504ec0c5fd91ce3c4175489580acf97c26b9 (patch)
tree1c7d356d7fe73b589713cacc3ab35f3ce819d35f /usr.sbin/jail
parentf52ebb9e171e7e0c24ff210b8fc53a2bb7b7c06c (diff)
downloadFreeBSD-src-e18c504ec0c5fd91ce3c4175489580acf97c26b9.zip
FreeBSD-src-e18c504ec0c5fd91ce3c4175489580acf97c26b9.tar.gz
Clear errno before calling getpw*.
Diffstat (limited to 'usr.sbin/jail')
-rw-r--r--usr.sbin/jail/command.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c
index f162c3c..7132a5f 100644
--- a/usr.sbin/jail/command.c
+++ b/usr.sbin/jail/command.c
@@ -877,6 +877,7 @@ get_user_info(struct cfjail *j, const char *username,
{
const struct passwd *pwd;
+ errno = 0;
*pwdp = pwd = username ? getpwnam(username) : getpwuid(getuid());
if (pwd == NULL) {
if (errno)
OpenPOWER on IntegriCloud