summaryrefslogtreecommitdiff
path: root/src/playlist_edit.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-03-06 22:01:24 +0100
committerMax Kellermann <max@duempel.org>2012-03-06 22:10:54 +0100
commit1e60a4386a78ed16fc3fdf99c1f398b607178804 (patch)
treed0a7153adfb1869449141ca2c96b8d70561f8656 /src/playlist_edit.c
parente9f1b53ae6819170ea06f4347a2c5c631044c1f3 (diff)
playlist_edit: move UID check to client_allow_file()
Diffstat (limited to 'src/playlist_edit.c')
-rw-r--r--src/playlist_edit.c25
1 files changed, 2 insertions, 23 deletions
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 <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
#include <stdlib.h>
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,