ClientFile: move client_allow_file() into the Client class

This commit is contained in:
Max Kellermann
2014-02-02 13:59:07 +01:00
parent 8cf4fb53aa
commit a8e52ad89f
7 changed files with 19 additions and 52 deletions

View File

@@ -18,7 +18,6 @@
*/
#include "config.h"
#include "ClientFile.hxx"
#include "Client.hxx"
#include "protocol/Ack.hxx"
#include "fs/Path.hxx"
@@ -29,16 +28,14 @@
#include <unistd.h>
bool
client_allow_file(const Client &client, Path path_fs, Error &error)
Client::AllowFile(Path path_fs, Error &error) const
{
#ifdef WIN32
(void)client;
(void)path_fs;
error.Set(ack_domain, ACK_ERROR_PERMISSION, "Access denied");
return false;
#else
const int uid = client.GetUID();
if (uid >= 0 && (uid_t)uid == geteuid())
/* always allow access if user runs his own MPD
instance */