diff options
author | Max Kellermann <max@duempel.org> | 2008-12-30 19:14:13 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-12-30 19:14:13 +0100 |
commit | bb55ec6b4ec89408e32b9af562d891c39e96501d (patch) | |
tree | 7f53818665a40809f783880229554906cd74a50f /src | |
parent | 7330002960d2c89081614ef5d15f2f5181e5886c (diff) | |
download | mpd-bb55ec6b4ec89408e32b9af562d891c39e96501d.tar.gz mpd-bb55ec6b4ec89408e32b9af562d891c39e96501d.tar.xz mpd-bb55ec6b4ec89408e32b9af562d891c39e96501d.zip |
command: don't allow adding local files on WIN32
There are no unix sockets on WIN32, and therefore no authentication.
WIN32 might have similar capabilities, but until we implement them,
disable that MPD feature.
Diffstat (limited to '')
-rw-r--r-- | src/command.c | 4 | ||||
-rw-r--r-- | src/playlist.c | 2 | ||||
-rw-r--r-- | src/playlist.h | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/command.c b/src/command.c index c9b2fcbd2..3929978ba 100644 --- a/src/command.c +++ b/src/command.c @@ -451,8 +451,12 @@ handle_add(struct client *client, G_GNUC_UNUSED int argc, char *argv[]) enum playlist_result result; if (strncmp(path, "file:///", 8) == 0) { +#ifndef WIN32 + result = PLAYLIST_RESULT_DENIED; +#else result = playlist_append_file(path + 7, client_get_uid(client), NULL); +#endif return print_playlist_result(client, result); } diff --git a/src/playlist.c b/src/playlist.c index 7e1465ba3..59a2a0dee 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -517,6 +517,7 @@ static void clearPlayerQueue(void) pc_cancel(); } +#ifndef WIN32 enum playlist_result playlist_append_file(const char *path, int uid, unsigned *added_id) { @@ -542,6 +543,7 @@ playlist_append_file(const char *path, int uid, unsigned *added_id) return addSongToPlaylist(song, added_id); } +#endif static struct song * song_by_url(const char *url) diff --git a/src/playlist.h b/src/playlist.h index 137475afb..a4b40f6e0 100644 --- a/src/playlist.h +++ b/src/playlist.h @@ -75,12 +75,14 @@ void savePlaylistState(FILE *); void clearPlaylist(void); +#ifndef WIN32 /** * Appends a local file (outside the music database) to the playlist, * but only if the file's owner is equal to the specified uid. */ enum playlist_result playlist_append_file(const char *path, int uid, unsigned *added_id); +#endif enum playlist_result addToPlaylist(const char *file, unsigned *added_id); |