diff options
author | Max Kellermann <max@duempel.org> | 2014-11-18 20:56:27 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-11-18 20:56:27 +0100 |
commit | c8b93d6573550ec3735b070245769970db62a312 (patch) | |
tree | bef98cd06011636e457307c2d088bad673e7e4b8 /src | |
parent | 3f5f96ac91f570a6aa8b73d20f406410d8a79ed4 (diff) | |
download | mpd-c8b93d6573550ec3735b070245769970db62a312.tar.gz mpd-c8b93d6573550ec3735b070245769970db62a312.tar.xz mpd-c8b93d6573550ec3735b070245769970db62a312.zip |
Client: assume uid==0 is local socket
A negative uid value means it's not a "local socket" (PF_LOCAL).
uid==0 means user "root" connected.
Diffstat (limited to '')
-rw-r--r-- | src/Client.hxx | 2 | ||||
-rw-r--r-- | src/ClientFile.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/Client.hxx b/src/Client.hxx index f0bc6b0f7..fd81b59e0 100644 --- a/src/Client.hxx +++ b/src/Client.hxx @@ -109,7 +109,7 @@ public: * a local (UNIX domain) socket? */ bool IsLocal() const { - return uid > 0; + return uid >= 0; } unsigned GetPermission() const { diff --git a/src/ClientFile.cxx b/src/ClientFile.cxx index 382b76083..7a5dd37a6 100644 --- a/src/ClientFile.cxx +++ b/src/ClientFile.cxx @@ -47,7 +47,7 @@ client_allow_file(const Client &client, Path path_fs, Error &error) instance */ return true; - if (uid <= 0) { + if (uid < 0) { /* unauthenticated client */ error.Set(ack_domain, ACK_ERROR_PERMISSION, "Access denied"); return false; |