mirror of
https://repo.or.cz/socat.git
synced 2025-06-18 06:46:51 +00:00
getpwuid() errno
This commit is contained in:
parent
7b26406d96
commit
264b21c1a9
2 changed files with 9 additions and 2 deletions
3
CHANGES
3
CHANGES
|
@ -78,6 +78,9 @@ Corrections:
|
||||||
DCCP_CONNECT_MAXCHILDREN OPENSSL_CONNECT_MAXCHILDREN
|
DCCP_CONNECT_MAXCHILDREN OPENSSL_CONNECT_MAXCHILDREN
|
||||||
SOCKS4_MAXCHILDREN SOCKS5_CONNECT_MAXCHILDREN PROXY_CONNECT_MAXCHILDREN
|
SOCKS4_MAXCHILDREN SOCKS5_CONNECT_MAXCHILDREN PROXY_CONNECT_MAXCHILDREN
|
||||||
|
|
||||||
|
On failure of getpwuid() (used in options su and su-d) now consider
|
||||||
|
errno.
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
POSIXMQ-RECV now takes option o-nonblock; this, in combination with -T,
|
POSIXMQ-RECV now takes option o-nonblock; this, in combination with -T,
|
||||||
makes it possible to terminate Socat in case the queue is empty.
|
makes it possible to terminate Socat in case the queue is empty.
|
||||||
|
|
|
@ -3944,8 +3944,12 @@ int applyopt_spec(
|
||||||
{
|
{
|
||||||
struct passwd *pwd;
|
struct passwd *pwd;
|
||||||
if ((pwd = getpwuid(opt->value.u_uidt)) == NULL) {
|
if ((pwd = getpwuid(opt->value.u_uidt)) == NULL) {
|
||||||
Error1("getpwuid("F_uid"): no such user",
|
if (errno != 0)
|
||||||
opt->value.u_uidt);
|
Error2("getpwuid("F_uid"): %s",
|
||||||
|
opt->value.u_uidt, strerror(errno));
|
||||||
|
else
|
||||||
|
Error1("getpwuid("F_uid"): no such user",
|
||||||
|
opt->value.u_uidt);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (Initgroups(pwd->pw_name, pwd->pw_gid) < 0) {
|
if (Initgroups(pwd->pw_name, pwd->pw_gid) < 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue