about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2013-08-31 22:42:56 +0200
committerFlorian Westphal <fw@strlen.de>2013-08-31 22:42:56 +0200
commitf8f8a9a04146fb7a4e1570ce0474ea86806879ed (patch)
treee9594c95dbb4537ede27fb6e9a5f5f7eccff3566 /src
parent04b947cdc3ad1f3370aae2ba2e7308587bea0dda (diff)
downloadngircd-f8f8a9a04146fb7a4e1570ce0474ea86806879ed.tar.gz
ngircd-f8f8a9a04146fb7a4e1570ce0474ea86806879ed.zip
ngircd: use setgid/setuid errno value in error path
Need to use saved errno value as strerror argument, else you
get bogus output ('success') in the log message.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/ngircd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c
index e26ac3bd..f0cb1504 100644
--- a/src/ngircd/ngircd.c
+++ b/src/ngircd/ngircd.c
@@ -720,7 +720,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
 			grp = getgrgid(Conf_GID);
 			Log(LOG_ERR, "Can't change group ID to %s(%u): %s!",
 			    grp ? grp->gr_name : "?", Conf_GID,
-			    strerror(errno));
+			    strerror(real_errno));
 			if (real_errno != EPERM) 
 				goto out;
 		}
@@ -741,7 +741,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
 			pwd = getpwuid(Conf_UID);
 			Log(LOG_ERR, "Can't change user ID to %s(%u): %s!",
 			    pwd ? pwd->pw_name : "?", Conf_UID,
-			    strerror(errno));
+			    strerror(real_errno));
 			if (real_errno != EPERM)
 				goto out;
 		}