-static usec_t arg_timeout = 60 * USEC_PER_SEC;
-
-static int create_socket(char **name) {
- int fd;
- union {
- struct sockaddr sa;
- struct sockaddr_un un;
- } sa;
- int one = 1, r;
- char *c;
-
- assert(name);
-
- if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0)) < 0) {
- log_error("socket() failed: %m");
- return -errno;
- }
-
- zero(sa);
- sa.un.sun_family = AF_UNIX;
- snprintf(sa.un.sun_path+1, sizeof(sa.un.sun_path)-1, "/org/freedesktop/systemd1/ask-password/%llu", random_ull());
-
- if (bind(fd, &sa.sa, sizeof(sa_family_t) + 1 + strlen(sa.un.sun_path+1)) < 0) {
- r = -errno;
- log_error("bind() failed: %m");
- goto fail;
- }
-
- if (setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &one, sizeof(one)) < 0) {
- r = -errno;
- log_error("SO_PASSCRED failed: %m");
- goto fail;
- }
-
- if (!(c = strdup(sa.un.sun_path+1))) {
- r = -ENOMEM;
- log_error("Out of memory");
- goto fail;
- }
-
- *name = c;
- return fd;
-
-fail:
- close_nointr_nofail(fd);
-
- return r;
-}
+static bool arg_use_tty = true;
+static usec_t arg_timeout = DEFAULT_TIMEOUT_USEC;
+static bool arg_accept_cached = false;
+static bool arg_multiple = false;