Created
October 12, 2013 06:28
-
-
Save joshkunz/6946483 to your computer and use it in GitHub Desktop.
Patch for mpd (tag: release-0.17.4) that fixes queuing files outside of MPD's library.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/client_file.c b/src/client_file.c | |
index 2ee4333..8174c3b 100644 | |
--- a/src/client_file.c | |
+++ b/src/client_file.c | |
@@ -44,12 +44,18 @@ client_allow_file(const struct client *client, const char *path_fs, | |
instance */ | |
return true; | |
+ /* Pretty sure this check will never work. | |
if (uid <= 0) { | |
- /* unauthenticated client */ | |
+ char msg[100]; | |
+ sprintf(msg, "Access denied (Bad UID: %d)", uid); | |
+ // unauthenticated client | |
+ // g_set_error(error_r, ack_quark(), ACK_ERROR_PERMISSION, | |
+ // "Access denied (BAD UID)"); * | |
g_set_error(error_r, ack_quark(), ACK_ERROR_PERMISSION, | |
- "Access denied"); | |
+ msg); | |
return false; | |
} | |
+ */ | |
struct stat st; | |
if (stat(path_fs, &st) < 0) { | |
@@ -61,7 +67,7 @@ client_allow_file(const struct client *client, const char *path_fs, | |
if (st.st_uid != (uid_t)uid && (st.st_mode & 0444) != 0444) { | |
/* client is not owner */ | |
g_set_error(error_r, ack_quark(), ACK_ERROR_PERMISSION, | |
- "Access denied"); | |
+ "Access denied (Not owner and not world-readable)"); | |
return false; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment