From e8e715fa62e0a9bcddfc77a931270a7af39a0b3b Mon Sep 17 00:00:00 2001 From: Garance A Drosehn Date: Thu, 13 Jun 2002 01:55:48 +0000 Subject: Almost complete rewrite of the lpc commands 'abort', 'enable', 'disable', 'restart', 'start', 'stop' and 'up'. These are commands which mainly just alter the access bits on the lock-file of a queue, and they all now use a central routine to do that. This reduces the amount of code that is run as the priv userid, and eliminates a number of cases where error messages were written while that priv uid was in effect. As far as users are concerned, there should be no noticable difference in the new versions. In case there *is*, the previous implementations are still there as 'xabort', 'xenable', etc, so they are available for instant fallback. If no one reports a problem after a few weeks, then a later update will remove those x-commands. Reviewed by: freebsd-audit and freebsd-print@bostonradio.org MFC after: 10 days --- usr.sbin/lpr/lpc/cmdtab.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'usr.sbin/lpr/lpc/cmdtab.c') diff --git a/usr.sbin/lpr/lpc/cmdtab.c b/usr.sbin/lpr/lpc/cmdtab.c index b27c3124a9c0..acae213f7583 100644 --- a/usr.sbin/lpr/lpc/cmdtab.c +++ b/usr.sbin/lpr/lpc/cmdtab.c @@ -65,22 +65,29 @@ char uphelp[] = "enable everything and restart spooling daemon"; #define PR 1 /* a privileged command */ struct cmd cmdtab[] = { - { "abort", aborthelp, PR, 0, doabort }, + { "abort", aborthelp, PR, 0, abort_q }, { "clean", cleanhelp, PR, init_clean, clean_q }, - { "enable", enablehelp, PR, 0, enable }, + { "enable", enablehelp, PR, 0, enable_q }, { "exit", quithelp, 0, quit, 0 }, - { "disable", disablehelp, PR, 0, disable }, + { "disable", disablehelp, PR, 0, disable_q }, { "down", downhelp, PR, down, 0 }, { "help", helphelp, 0, help, 0 }, { "quit", quithelp, 0, quit, 0 }, - { "restart", restarthelp, 0, 0, restart }, - { "start", starthelp, PR, 0, startcmd }, + { "restart", restarthelp, 0, 0, restart_q }, + { "start", starthelp, PR, 0, start_q }, { "status", statushelp, 0, 0, status }, - { "stop", stophelp, PR, 0, stop }, + { "stop", stophelp, PR, 0, stop_q }, { "tclean", tcleanhelp, 0, init_tclean, clean_q }, { "topq", topqhelp, PR, topq, 0 }, - { "up", uphelp, PR, 0, up }, + { "up", uphelp, PR, 0, up_q }, { "?", helphelp, 0, help, 0 }, + { "xabort", aborthelp, PR, 0, doabort }, + { "xenable", enablehelp, PR, 0, enable }, + { "xdisable", disablehelp, PR, 0, disable }, + { "xrestart", restarthelp, 0, 0, restart }, + { "xstart", starthelp, PR, 0, startcmd }, + { "xstop", stophelp, PR, 0, stop }, + { "xup", uphelp, PR, 0, up }, { 0, 0, 0, 0, 0}, }; -- cgit v1.2.3