ClientFile: move client_allow_file() into the Client class
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user