summaryrefslogtreecommitdiff
path: root/load-fragment.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-02-12 02:02:14 +0100
committerLennart Poettering <lennart@poettering.net>2010-02-12 02:02:14 +0100
commitb5a0699f0bb8b1d1ae55bb0d86f51dfe2783821b (patch)
tree71ba3fb026dadf3608720bc2514625ebd1ae453a /load-fragment.c
parenta9f5d45466c923442ceb31ab2a4206736133d9d4 (diff)
socket: allow configuration of socket/directory mode
Diffstat (limited to 'load-fragment.c')
-rw-r--r--load-fragment.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/load-fragment.c b/load-fragment.c
index ab7f830a5d..95e6cc3f88 100644
--- a/load-fragment.c
+++ b/load-fragment.c
@@ -285,7 +285,7 @@ static int config_parse_oom_adjust(
return 0;
}
-static int config_parse_umask(
+static int config_parse_mode(
const char *filename,
unsigned line,
const char *section,
@@ -306,12 +306,12 @@ static int config_parse_umask(
errno = 0;
l = strtol(rvalue, &x, 8);
if (!x || *x || errno) {
- log_error("[%s:%u] Failed to parse umask value: %s", filename, line, rvalue);
+ log_error("[%s:%u] Failed to parse mode value: %s", filename, line, rvalue);
return errno ? -errno : -EINVAL;
}
- if (l < 0000 || l > 0777) {
- log_error("[%s:%u] umask value out of range: %s", filename, line, rvalue);
+ if (l < 0000 || l > 07777) {
+ log_error("[%s:%u] mode value out of range: %s", filename, line, rvalue);
return -ERANGE;
}
@@ -1045,7 +1045,7 @@ static int load_from_path(Unit *u, const char *path) {
{ "CPUSchedulingPriority", config_parse_cpu_sched_prio, &(context), section }, \
{ "CPUSchedulingResetOnFork", config_parse_bool, &(context).cpu_sched_reset_on_fork, section }, \
{ "CPUAffinity", config_parse_cpu_affinity, &(context), section }, \
- { "UMask", config_parse_umask, &(context).umask, section }, \
+ { "UMask", config_parse_mode, &(context).umask, section }, \
{ "Environment", config_parse_strv, &(context).environment, section }, \
{ "Output", config_parse_output, &(context).output, section }, \
{ "Input", config_parse_input, &(context).input, section }, \
@@ -1112,6 +1112,8 @@ static int load_from_path(Unit *u, const char *path) {
{ "ExecStartPost", config_parse_exec, u->socket.exec_command+SOCKET_EXEC_START_POST, "Socket" },
{ "ExecStopPre", config_parse_exec, u->socket.exec_command+SOCKET_EXEC_STOP_PRE, "Socket" },
{ "ExecStopPost", config_parse_exec, u->socket.exec_command+SOCKET_EXEC_STOP_POST, "Socket" },
+ { "DirectoryMode", config_parse_mode, &u->socket.directory_mode, "Socket" },
+ { "SocketMode", config_parse_mode, &u->socket.socket_mode, "Socket" },
EXEC_CONTEXT_CONFIG_ITEMS(u->socket.exec_context, "Socket"),
EXEC_CONTEXT_CONFIG_ITEMS(u->automount.exec_context, "Automount"),