chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
util: add shell_maybe_quote() call for preparing a string for shell cmdline inclusion
[elogind.git]
/
src
/
shared
/
ask-password-api.c
diff --git
a/src/shared/ask-password-api.c
b/src/shared/ask-password-api.c
index 41049d79bd9d626c0c4bbaaa10a2080cd86d44a5..44ebc584914a6b5092835f0560e8ca09c7e7c299 100644
(file)
--- a/
src/shared/ask-password-api.c
+++ b/
src/shared/ask-password-api.c
@@
-21,7
+21,7
@@
#include <stdbool.h>
#include <termios.h>
#include <unistd.h>
#include <stdbool.h>
#include <termios.h>
#include <unistd.h>
-#include <
sys/
poll.h>
+#include <poll.h>
#include <sys/inotify.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/inotify.h>
#include <errno.h>
#include <fcntl.h>
@@
-258,10
+258,8
@@
static int create_socket(char **name) {
assert(name);
fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
assert(name);
fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
- if (fd < 0) {
- log_error_errno(errno, "socket() failed: %m");
- return -errno;
- }
+ if (fd < 0)
+ return log_error_errno(errno, "socket() failed: %m");
snprintf(sa.un.sun_path, sizeof(sa.un.sun_path)-1, "/run/systemd/ask-password/sck.%" PRIx64, random_u64());
snprintf(sa.un.sun_path, sizeof(sa.un.sun_path)-1, "/run/systemd/ask-password/sck.%" PRIx64, random_u64());
@@
-477,6
+475,8
@@
int ask_password_agent(
goto finish;
}
goto finish;
}
+ cmsg_close_all(&msghdr);
+
if (n <= 0) {
log_error("Message too short");
continue;
if (n <= 0) {
log_error("Message too short");
continue;