Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
31faafea
Commit
31faafea
authored
Oct 27, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Client: remove the AllowFile() overload with Error parameter
Unused.
parent
6961bd61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
37 deletions
+0
-37
Client.hxx
src/client/Client.hxx
+0
-2
ClientFile.cxx
src/client/ClientFile.cxx
+0
-35
No files found.
src/client/Client.hxx
View file @
31faafea
...
...
@@ -182,8 +182,6 @@ public:
*/
void
AllowFile
(
Path
path_fs
)
const
;
bool
AllowFile
(
Path
path_fs
,
Error
&
error
)
const
;
/**
* Wrapper for Instance::GetDatabase().
*/
...
...
src/client/ClientFile.cxx
View file @
31faafea
...
...
@@ -22,7 +22,6 @@
#include "protocol/Ack.hxx"
#include "fs/Path.hxx"
#include "fs/FileInfo.hxx"
#include "util/Error.hxx"
#include <unistd.h>
...
...
@@ -50,37 +49,3 @@ Client::AllowFile(Path path_fs) const
throw
ProtocolError
(
ACK_ERROR_PERMISSION
,
"Access denied"
);
#endif
}
bool
Client
::
AllowFile
(
Path
path_fs
,
Error
&
error
)
const
{
#ifdef WIN32
(
void
)
path_fs
;
error
.
Set
(
ack_domain
,
ACK_ERROR_PERMISSION
,
"Access denied"
);
return
false
;
#else
if
(
uid
>=
0
&&
(
uid_t
)
uid
==
geteuid
())
/* always allow access if user runs his own MPD
instance */
return
true
;
if
(
uid
<
0
)
{
/* unauthenticated client */
error
.
Set
(
ack_domain
,
ACK_ERROR_PERMISSION
,
"Access denied"
);
return
false
;
}
FileInfo
fi
;
if
(
!
GetFileInfo
(
path_fs
,
fi
,
error
))
return
false
;
if
(
fi
.
GetUid
()
!=
(
uid_t
)
uid
&&
(
fi
.
GetMode
()
&
0444
)
!=
0444
)
{
/* client is not owner */
error
.
Set
(
ack_domain
,
ACK_ERROR_PERMISSION
,
"Access denied"
);
return
false
;
}
return
true
;
#endif
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment