mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:08:10 +00:00
SystemServer: Allow specifying per-service socket file permissions
This commit is contained in:
parent
f3dad64a3b
commit
7dd03b46ee
3 changed files with 6 additions and 1 deletions
|
@ -104,7 +104,7 @@ void Service::setup_socket()
|
|||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
if (fchmod(m_socket_fd, 0600) < 0) {
|
||||
if (fchmod(m_socket_fd, m_socket_permissions) < 0) {
|
||||
perror("fchmod");
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
@ -270,6 +270,8 @@ Service::Service(const CConfigFile& config, const StringView& name)
|
|||
|
||||
m_socket_path = config.read_entry(name, "Socket");
|
||||
if (!m_socket_path.is_null()) {
|
||||
auto socket_permissions_string = config.read_entry(name, "SocketPermissions", "0600");
|
||||
m_socket_permissions = strtol(socket_permissions_string.characters(), nullptr, 8) & 04777;
|
||||
setup_socket();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue