log_parse_environment();
log_open();
+ umask(0022);
+
if (argc > 1) {
r = apply_file(argv[1], false);
} else {
log_parse_environment();
log_open();
+ umask(0022);
+
if (!(f = fopen("/etc/crypttab", "re"))) {
if (errno == ENOENT)
log_parse_environment();
log_open();
+ umask(0022);
+
if (streq(argv[1], "attach")) {
uint32_t flags = 0;
int k;
void exec_context_init(ExecContext *c) {
assert(c);
- c->umask = 0002;
+ c->umask = 0022;
c->ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 0);
c->cpu_sched_policy = SCHED_OTHER;
c->syslog_priority = LOG_DAEMON|LOG_INFO;
log_parse_environment();
log_open();
+ umask(0022);
+
parse_proc_cmdline();
test_files();
log_parse_environment();
log_open();
+ umask(0022);
+
if (detect_container(NULL) > 0) {
log_debug("Automatic adding console shell.");
log_parse_environment();
log_open();
+ umask(0022);
+
if (argc == 2 && streq(argv[1], "--introspect")) {
fputs(DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
"<node>\n", stdout);
if (!check_nss())
log_warning("Warning: nss-myhostname is not installed. Changing the local hostname might make it unresolveable. Please install nss-myhostname!");
- umask(0022);
-
r = read_data();
if (r < 0) {
log_error("Failed to read hostname data: %s", strerror(-r));
log_parse_environment();
log_open();
+ umask(0022);
+
if ((n = sd_listen_fds(true)) < 0) {
log_error("Failed to read listening file descriptors from environment: %s", strerror(-r));
return EXIT_FAILURE;
log_parse_environment();
log_open();
+ umask(0022);
+
if ((n = sd_listen_fds(true)) < 0) {
log_error("Failed to read listening file descriptors from environment: %s", strerror(-r));
return EXIT_FAILURE;
log_parse_environment();
log_open();
+ umask(0022);
+
if (argc == 2 && streq(argv[1], "--introspect")) {
fputs(DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
"<node>\n", stdout);
goto finish;
}
- umask(0022);
-
r = read_data();
if (r < 0) {
log_error("Failed to read locale data: %s", strerror(-r));
log_parse_environment();
log_open();
+ umask(0022);
+
if ((n = sd_listen_fds(true)) < 0) {
log_error("Failed to read listening file descriptors from environment: %s", strerror(-r));
return EXIT_FAILURE;
log_parse_environment();
log_open();
+ umask(0022);
+
if (argc != 1) {
log_error("This program takes no arguments.");
r = -EINVAL;
goto finish;
}
- umask(0022);
-
m = manager_new();
if (!m) {
log_error("Out of memory");
mkdir_p("/run/systemd", 0755);
+ m = umask(0022);
r = write_one_line_file("/run/systemd/machine-id", id);
+ umask(m);
+
if (r < 0) {
log_error("Cannot write /run/systemd/machine-id: %s", strerror(-r));
log_parse_environment();
log_open();
+ umask(0022);
+
if (!(arguments = strv_new("/sbin/modprobe", "-sab", "--", NULL))) {
log_error("Failed to allocate string array");
goto finish;
}
finish:
-
umask(u);
return r;
goto child_fail;
}
- umask(0002);
+ umask(0022);
if (drop_capabilities() < 0)
goto child_fail;
log_parse_environment();
log_open();
+ umask(0022);
+
parse_proc_cmdline();
test_files();
log_parse_environment();
log_open();
+ umask(0022);
+
/* Read pool size, if possible */
if ((f = fopen("/proc/sys/kernel/random/poolsize", "re"))) {
fscanf(f, "%zu", &buf_size);
log_parse_environment();
log_open();
+ umask(0022);
+
if ((r = parse_argv(argc, argv)) <= 0)
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
log_parse_environment();
log_open();
+ umask(0022);
+
if ((r = parse_argv(argc, argv)) <= 0)
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
log_parse_environment();
log_open();
+ umask(0022);
+
if (!(f = setmntent("/etc/fstab", "r"))) {
log_error("Failed to open /etc/fstab: %m");
goto finish;
log_set_target(LOG_TARGET_CONSOLE); /* syslog will die if not gone yet */
log_open();
+ umask(0022);
+
if (getpid() != 1) {
log_error("Not executed by init (pid 1).");
r = -EPERM;
log_parse_environment();
log_open();
+ umask(0022);
+
if ((n_fds = sd_listen_fds(true)) < 0) {
log_error("Failed to read listening file descriptors from environment: %s", strerror(-r));
return EXIT_FAILURE;
log_parse_environment();
log_open();
+ umask(0022);
+
if (argc > optind)
r = apply_file(argv[optind], false);
else {
log_parse_environment();
log_open();
+ umask(0022);
+
if (argc == 2 && streq(argv[1], "--introspect")) {
fputs(DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
"<node>\n", stdout);
goto finish;
}
- umask(0022);
-
r = read_data();
if (r < 0) {
log_error("Failed to read timezone data: %s", strerror(-r));
log_parse_environment();
log_open();
+ umask(0022);
+
label_init();
items = hashmap_new(string_hash_func, string_compare_func);
log_parse_environment();
log_open();
+ umask(0022);
+
if ((r = parse_argv(argc, argv)) <= 0)
goto finish;
log_parse_environment();
log_open();
+ umask(0022);
+
if (argc < 2 || argc > 3) {
log_error("This program expects one or two arguments.");
r = -EINVAL;
log_parse_environment();
log_open();
+ umask(0022);
+
#ifdef HAVE_AUDIT
if ((c.audit_fd = audit_open()) < 0)
log_error("Failed to connect to audit log: %m");
log_parse_environment();
log_open();
+ umask(0022);
+
if (streq(argv[1], "start")) {
int q = 0, r = 0;
log_parse_environment();
log_open();
+ umask(0022);
+
if (argv[1])
vc = argv[1];
else