summaryrefslogtreecommitdiff
path: root/src/shared/spawn-polkit-agent.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-12-22 15:07:22 +0100
committerLennart Poettering <lennart@poettering.net>2017-12-25 11:48:21 +0100
commit78752f2eb4abfee3cd09ef96f8e6c745290aa42b (patch)
treec4267bbaf19fbe591a3d9d809c85ea86422c2e94 /src/shared/spawn-polkit-agent.c
parentfa7ff4cf03e5f6becf4db847a11bbdbfc4382f58 (diff)
downloadsystemd-78752f2eb4abfee3cd09ef96f8e6c745290aa42b.tar.gz
process-util: move fork_agent() to process-util.[ch]
It's a relatively small wrapper around safe_fork() now, hence let's move it over, and make its signature even more alike. Also, set a different process name for the polkit and askpw agents.
Diffstat (limited to 'src/shared/spawn-polkit-agent.c')
-rw-r--r--src/shared/spawn-polkit-agent.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/shared/spawn-polkit-agent.c b/src/shared/spawn-polkit-agent.c
index 423069fb0e..c6bd65eb71 100644
--- a/src/shared/spawn-polkit-agent.c
+++ b/src/shared/spawn-polkit-agent.c
@@ -38,9 +38,8 @@
static pid_t agent_pid = 0;
int polkit_agent_open(void) {
- int r;
- int pipe_fd[2];
char notify_fd[DECIMAL_STR_MAX(int) + 1];
+ int pipe_fd[2], r;
if (agent_pid > 0)
return 0;
@@ -49,8 +48,7 @@ int polkit_agent_open(void) {
if (geteuid() == 0)
return 0;
- /* We check STDIN here, not STDOUT, since this is about input,
- * not output */
+ /* We check STDIN here, not STDOUT, since this is about input, not output */
if (!isatty(STDIN_FILENO))
return 0;
@@ -59,8 +57,9 @@ int polkit_agent_open(void) {
xsprintf(notify_fd, "%i", pipe_fd[1]);
- r = fork_agent(&agent_pid,
+ r = fork_agent("(polkit-agent)",
&pipe_fd[1], 1,
+ &agent_pid,
POLKIT_AGENT_BINARY_PATH,
POLKIT_AGENT_BINARY_PATH, "--notify-fd", notify_fd, "--fallback", NULL);