chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move /usr/bin/systemd to /usr/lib/systemd/systemd
[elogind.git]
/
src
/
shutdownd.c
diff --git
a/src/shutdownd.c
b/src/shutdownd.c
index 49ab8863e4156421461434c5af870984ea312ca4..b4052d4933b94b241d5927fa41934e07abc30e68 100644
(file)
--- a/
src/shutdownd.c
+++ b/
src/shutdownd.c
@@
-29,11
+29,12
@@
#include <unistd.h>
#include <fcntl.h>
#include <unistd.h>
#include <fcntl.h>
+#include <systemd/sd-daemon.h>
+
#include "shutdownd.h"
#include "log.h"
#include "macro.h"
#include "util.h"
#include "shutdownd.h"
#include "log.h"
#include "macro.h"
#include "util.h"
-#include "sd-daemon.h"
#include "utmp-wtmp.h"
static int read_packet(int fd, struct shutdownd_command *_c) {
#include "utmp-wtmp.h"
static int read_packet(int fd, struct shutdownd_command *_c) {
@@
-173,7
+174,6
@@
int main(int argc, char *argv[]) {
};
int r = EXIT_FAILURE, n_fds;
};
int r = EXIT_FAILURE, n_fds;
- int one = 1;
struct shutdownd_command c;
struct pollfd pollfd[_FD_MAX];
bool exec_shutdown = false, unlink_nologin = false, failed = false;
struct shutdownd_command c;
struct pollfd pollfd[_FD_MAX];
bool exec_shutdown = false, unlink_nologin = false, failed = false;
@@
-189,10
+189,12
@@
int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}
return EXIT_FAILURE;
}
- log_set_target(LOG_TARGET_
SYSLOG_OR_KMSG
);
+ log_set_target(LOG_TARGET_
AUTO
);
log_parse_environment();
log_open();
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;
if ((n_fds = sd_listen_fds(true)) < 0) {
log_error("Failed to read listening file descriptors from environment: %s", strerror(-r));
return EXIT_FAILURE;
@@
-203,11
+205,6
@@
int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}
return EXIT_FAILURE;
}
- if (setsockopt(SD_LISTEN_FDS_START, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)) < 0) {
- log_error("SO_PASSCRED failed: %m");
- return EXIT_FAILURE;
- }
-
zero(c);
zero(pollfd);
zero(c);
zero(pollfd);