diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-12-17 14:50:34 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-12-17 14:53:21 +0200 |
commit | 0ac42500ecdfe289b44d0d7ac10ff302e48aef5c (patch) | |
tree | ff1d0be679e935256167972034b7f88f9157f010 /src/ctl.c | |
parent | f928d00f38cc8a43f31506fadf868ba72ca93b4d (diff) | |
download | pies-0ac42500ecdfe289b44d0d7ac10ff302e48aef5c.tar.gz pies-0ac42500ecdfe289b44d0d7ac10ff302e48aef5c.tar.bz2 |
Fixes
* src/ctl.c: Make "id" command accessible only to
administrators
(cmd_id): Print PID.
(ctlio_do_command): Reword 510 text.
* src/pies.c (config_file): Remove "next"
(conf_head, conf_tail): Remove. Use grecs_list instead.
All uses changed.
Diffstat (limited to 'src/ctl.c')
-rw-r--r-- | src/ctl.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -141,7 +141,7 @@ static struct ctlio_command cmdtab[] = { | |||
141 | { "noop", "no operation", | 141 | { "noop", "no operation", |
142 | CTL_ALL_STATES, 1, 1, cmd_noop }, | 142 | CTL_ALL_STATES, 1, 1, cmd_noop }, |
143 | { "id", "identify the instance", | 143 | { "id", "identify the instance", |
144 | CTL_AUTHENTICATED_STATE, 1, 1, cmd_id }, | 144 | CTL_ADMIN_STATE, 1, 1, cmd_id }, |
145 | { "quit", "quit the session", | 145 | { "quit", "quit the session", |
146 | CTL_ALL_STATES, 1, 1, cmd_quit }, | 146 | CTL_ALL_STATES, 1, 1, cmd_quit }, |
147 | { "help", "display help", | 147 | { "help", "display help", |
@@ -300,7 +300,7 @@ ctlio_do_command (struct ctlio *io) | |||
300 | } | 300 | } |
301 | if (!(cmd->states & io->state)) | 301 | if (!(cmd->states & io->state)) |
302 | { | 302 | { |
303 | ctlio_reply (io, "510", "command not valid in state"); | 303 | ctlio_reply (io, "510", "permission denied"); |
304 | return; | 304 | return; |
305 | } | 305 | } |
306 | if (cmd->minargs && io->ws.ws_wordc < cmd->minargs) | 306 | if (cmd->minargs && io->ws.ws_wordc < cmd->minargs) |
@@ -442,6 +442,7 @@ cmd_id (struct ctlio *io, size_t argc, char **argv) | |||
442 | #if HAVE_DECL_PROGRAM_INVOCATION_NAME | 442 | #if HAVE_DECL_PROGRAM_INVOCATION_NAME |
443 | ctlio_printf (io, "Binary: %s%s", program_invocation_name, CRLF); | 443 | ctlio_printf (io, "Binary: %s%s", program_invocation_name, CRLF); |
444 | #endif | 444 | #endif |
445 | ctlio_printf (io, "PID: %lu%s", (unsigned long) getpid (), CRLF); | ||
445 | ctlio_printf (io, "Instance: %s%s", instance, CRLF); | 446 | ctlio_printf (io, "Instance: %s%s", instance, CRLF); |
446 | ctlio_eot (io); | 447 | ctlio_eot (io); |
447 | } | 448 | } |