Merge branch 'v0.23.x'

This commit is contained in:
Max Kellermann
2025-01-29 12:09:18 +01:00
4 changed files with 15 additions and 3 deletions

View File

@@ -12,7 +12,7 @@ Client::AllowFile(Path path_fs) const
#ifdef _WIN32
(void)path_fs;
throw ProtocolError(ACK_ERROR_PERMISSION, "Access denied");
throw ProtocolError(ACK_ERROR_PERMISSION, "Access to local files not implemented on Windows");
#else
if (uid >= 0 && (uid_t)uid == geteuid())
/* always allow access if user runs his own MPD
@@ -21,12 +21,12 @@ Client::AllowFile(Path path_fs) const
if (uid < 0)
/* unauthenticated client */
throw ProtocolError(ACK_ERROR_PERMISSION, "Access denied");
throw ProtocolError(ACK_ERROR_PERMISSION, "Access to local files via TCP is not allowed");
const FileInfo fi(path_fs);
if (fi.GetUid() != (uid_t)uid && (fi.GetMode() & 0444) != 0444)
/* client is not owner */
throw ProtocolError(ACK_ERROR_PERMISSION, "Access denied");
throw ProtocolError(ACK_ERROR_PERMISSION, "Access to this local file denied due to file permissions");
#endif
}