From 1e60a4386a78ed16fc3fdf99c1f398b607178804 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 6 Mar 2012 22:01:24 +0100 Subject: playlist_edit: move UID check to client_allow_file() --- src/playlist_edit.c | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) (limited to 'src/playlist_edit.c') diff --git a/src/playlist_edit.c b/src/playlist_edit.c index dbd205a06..7adbccd7c 100644 --- a/src/playlist_edit.c +++ b/src/playlist_edit.c @@ -31,9 +31,6 @@ #include "song.h" #include "idle.h" -#include -#include -#include #include static void playlist_increment_version(struct playlist *playlist) @@ -63,34 +60,16 @@ playlist_clear(struct playlist *playlist, struct player_control *pc) playlist_increment_version(playlist); } -#ifndef WIN32 enum playlist_result playlist_append_file(struct playlist *playlist, struct player_control *pc, - const char *path, int uid, unsigned *added_id) + const char *path_fs, unsigned *added_id) { - int ret; - struct stat st; - struct song *song; - - if (uid <= 0) - /* unauthenticated client */ - return PLAYLIST_RESULT_DENIED; - - ret = stat(path, &st); - if (ret < 0) - return PLAYLIST_RESULT_ERRNO; - - if (st.st_uid != (uid_t)uid && (st.st_mode & 0444) != 0444) - /* client is not owner */ - return PLAYLIST_RESULT_DENIED; - - song = song_file_load(path, NULL); + struct song *song = song_file_load(path_fs, NULL); if (song == NULL) return PLAYLIST_RESULT_NO_SUCH_SONG; return playlist_append_song(playlist, pc, song, added_id); } -#endif enum playlist_result playlist_append_song(struct playlist *playlist, struct player_control *pc, -- cgit v1.2.3