***/
#include <linux/oom.h>
-#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <unistd.h>
#include <fcntl.h>
#include <sched.h>
-#include <sys/prctl.h>
-#include <sys/mount.h>
#include <linux/fs.h>
#include <sys/stat.h>
-#include <sys/time.h>
#include <sys/resource.h>
-#include <sys/types.h>
-#include <grp.h>
#ifdef HAVE_SECCOMP
#include <seccomp.h>
#endif
-#include "sd-messages.h"
#include "unit.h"
#include "strv.h"
#include "conf-parser.h"
}
if (socket_address_family(&p->address) != AF_LOCAL && p->address.type == SOCK_SEQPACKET) {
- log_syntax(unit, LOG_ERR, filename, line, ENOTSUP,
+ log_syntax(unit, LOG_ERR, filename, line, EOPNOTSUPP,
"Address family not supported, ignoring: %s", rvalue);
return 0;
}
n[k] = NULL;
- log_debug("path: %s", path ?: n[0]);
-
if (!n[0])
reason = "Empty executable name or zeroeth argument";
else if (!string_is_safe(path ?: n[0]))
return 0;
}
-#ifdef HAVE_SYSV_COMPAT
-int config_parse_sysv_priority(const char *unit,
- const char *filename,
- unsigned line,
- const char *section,
- unsigned section_line,
- const char *lvalue,
- int ltype,
- const char *rvalue,
- void *data,
- void *userdata) {
-
- int *priority = data;
- int i, r;
-
- assert(filename);
- assert(lvalue);
- assert(rvalue);
- assert(data);
-
- r = safe_atoi(rvalue, &i);
- if (r < 0 || i < 0) {
- log_syntax(unit, LOG_ERR, filename, line, -r,
- "Failed to parse SysV start priority, ignoring: %s", rvalue);
- return 0;
- }
-
- *priority = (int) i;
- return 0;
-}
-#endif
-
DEFINE_CONFIG_PARSE_ENUM(config_parse_kill_mode, kill_mode, KillMode, "Failed to parse kill mode");
int config_parse_kill_signal(const char *unit,
FOREACH_WORD(word, l, rvalue, state) {
_cleanup_free_ char *temp;
int val;
+ Set **set;
temp = strndup(word, l);
if (!temp)
if (val <= 0) {
log_syntax(unit, LOG_ERR, filename, line, -val,
"Failed to parse value, ignoring: %s", word);
- return 0;
+ continue;
}
+ set = &status_set->signal;
} else {
if (val < 0 || val > 255) {
log_syntax(unit, LOG_ERR, filename, line, ERANGE,
"Value %d is outside range 0-255, ignoring", val);
continue;
}
+ set = &status_set->status;
}
- r = set_ensure_allocated(&status_set->status, NULL);
+ r = set_ensure_allocated(set, NULL);
if (r < 0)
return log_oom();
- r = set_put(status_set->status, INT_TO_PTR(val));
+ r = set_put(*set, INT_TO_PTR(val));
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, -r,
"Unable to store: %s", word);
f = fdopen(fd, "re");
if (!f) {
- r = -errno;
safe_close(fd);
- return r;
+ return -errno;
}
*_f = f;
const ConfigParserCallback callback;
const char *rvalue;
} table[] = {
-#if !defined(HAVE_SYSV_COMPAT) || !defined(HAVE_SECCOMP) || !defined(HAVE_PAM) || !defined(HAVE_SELINUX) || !defined(HAVE_SMACK) || !defined(HAVE_APPARMOR)
{ config_parse_warn_compat, "NOTSUPPORTED" },
-#endif
{ config_parse_int, "INTEGER" },
{ config_parse_unsigned, "UNSIGNED" },
{ config_parse_iec_size, "SIZE" },
{ config_parse_exec, "PATH [ARGUMENT [...]]" },
{ config_parse_service_type, "SERVICETYPE" },
{ config_parse_service_restart, "SERVICERESTART" },
-#ifdef HAVE_SYSV_COMPAT
- { config_parse_sysv_priority, "SYSVPRIORITY" },
-#endif
{ config_parse_kill_mode, "KILLMODE" },
{ config_parse_kill_signal, "SIGNAL" },
{ config_parse_socket_listen, "SOCKET [...]" },