Allow non root users to describe

This commit is contained in:
Roy Marples 2007-07-10 20:11:42 +00:00
parent 023d66578b
commit 2aa7ebfe0d

View File

@ -1192,7 +1192,10 @@ int main (int argc, char **argv)
setenv ("RC_CMD", optarg, 1); setenv ("RC_CMD", optarg, 1);
doneone = true; doneone = true;
if (strcmp (optarg, "help") == 0) {
if (strcmp (optarg, "describe") == 0) {
svc_exec (optarg, NULL);
} else if (strcmp (optarg, "help") == 0) {
execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, "help", (char *) NULL); execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, "help", (char *) NULL);
eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s", eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s",
applet, strerror (errno)); applet, strerror (errno));
@ -1218,6 +1221,7 @@ int main (int argc, char **argv)
} else if (strcmp (optarg, "status") == 0) { } else if (strcmp (optarg, "status") == 0) {
rc_service_state_t r = svc_status (service); rc_service_state_t r = svc_status (service);
retval = (int) r; retval = (int) r;
} else if (strcmp (optarg, "help") == 0) { } else if (strcmp (optarg, "help") == 0) {
execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, "help", (char *) NULL); execl (RCSCRIPT_HELP, RCSCRIPT_HELP, service, "help", (char *) NULL);
eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s", eerrorx ("%s: failed to exec `" RCSCRIPT_HELP "': %s",