diff options
author | Max Kellermann <max@duempel.org> | 2014-02-02 13:59:07 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-02 13:59:07 +0100 |
commit | a8e52ad89f60741adc474d460724e25bc783dfe5 (patch) | |
tree | 68c774f929939ea1e8e3ece394b0bf0c10c30f2e /src/client/Client.hxx | |
parent | 8cf4fb53aa102380a8e734590aa6e82920e9632c (diff) | |
download | mpd-a8e52ad89f60741adc474d460724e25bc783dfe5.tar.gz mpd-a8e52ad89f60741adc474d460724e25bc783dfe5.tar.xz mpd-a8e52ad89f60741adc474d460724e25bc783dfe5.zip |
ClientFile: move client_allow_file() into the Client class
Diffstat (limited to 'src/client/Client.hxx')
-rw-r--r-- | src/client/Client.hxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/client/Client.hxx b/src/client/Client.hxx index ec7d2d741..708b0d03d 100644 --- a/src/client/Client.hxx +++ b/src/client/Client.hxx @@ -36,6 +36,7 @@ struct sockaddr; class EventLoop; +class Path; struct Partition; class Client final : private FullyBufferedSocket, TimeoutMonitor { @@ -156,6 +157,18 @@ public: void UnsubscribeAll(); bool PushMessage(const ClientMessage &msg); + /** + * Is this client allowed to use the specified local file? + * + * Note that this function is vulnerable to timing/symlink attacks. + * We cannot fix this as long as there are plugins that open a file by + * its name, and not by file descriptor / callbacks. + * + * @param path_fs the absolute path name in filesystem encoding + * @return true if access is allowed + */ + bool AllowFile(Path path_fs, Error &error) const; + private: /* virtual methods from class BufferedSocket */ virtual InputResult OnSocketInput(void *data, size_t length) override; |