lpc.c (78280) | lpc.c (78750) |
---|---|
1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 29 unchanged lines hidden (view full) --- 38 The Regents of the University of California. All rights reserved.\n"; 39#endif /* not lint */ 40 41#ifndef lint 42#if 0 43static char sccsid[] = "@(#)lpc.c 8.3 (Berkeley) 4/28/95"; 44#endif 45static const char rcsid[] = | 1/* 2 * Copyright (c) 1983, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 29 unchanged lines hidden (view full) --- 38 The Regents of the University of California. All rights reserved.\n"; 39#endif /* not lint */ 40 41#ifndef lint 42#if 0 43static char sccsid[] = "@(#)lpc.c 8.3 (Berkeley) 4/28/95"; 44#endif 45static const char rcsid[] = |
46 "$FreeBSD: head/usr.sbin/lpr/lpc/lpc.c 78280 2001-06-15 16:28:37Z gad $"; | 46 "$FreeBSD: head/usr.sbin/lpr/lpc/lpc.c 78750 2001-06-25 02:05:03Z gad $"; |
47#endif /* not lint */ 48 49#include <sys/param.h> 50 51#include <ctype.h> 52#include <dirent.h> 53#include <err.h> 54#include <grp.h> --- 55 unchanged lines hidden (view full) --- 110 printf("?Invalid command\n"); 111 exit(1); 112 } 113 if (c->c_priv && getuid() && ingroup(LPR_OPER) == 0) { 114 printf("?Privileged command\n"); 115 exit(1); 116 } 117 if (c->c_generic != 0) | 47#endif /* not lint */ 48 49#include <sys/param.h> 50 51#include <ctype.h> 52#include <dirent.h> 53#include <err.h> 54#include <grp.h> --- 55 unchanged lines hidden (view full) --- 110 printf("?Invalid command\n"); 111 exit(1); 112 } 113 if (c->c_priv && getuid() && ingroup(LPR_OPER) == 0) { 114 printf("?Privileged command\n"); 115 exit(1); 116 } 117 if (c->c_generic != 0) |
118 generic(c->c_generic, argc, argv); | 118 generic(c->c_generic, c->c_handler, argc, argv); |
119 else 120 (*c->c_handler)(argc, argv); 121 exit(0); 122 } 123 fromatty = isatty(fileno(stdin)); 124 if (!fromatty) 125 signal(SIGINT, intr); 126 for (;;) { --- 68 unchanged lines hidden (view full) --- 195 if (c == 0) { 196 printf("?Invalid command\n"); 197 continue; 198 } 199 if (c->c_priv && getuid() && ingroup(LPR_OPER) == 0) { 200 printf("?Privileged command\n"); 201 continue; 202 } | 119 else 120 (*c->c_handler)(argc, argv); 121 exit(0); 122 } 123 fromatty = isatty(fileno(stdin)); 124 if (!fromatty) 125 signal(SIGINT, intr); 126 for (;;) { --- 68 unchanged lines hidden (view full) --- 195 if (c == 0) { 196 printf("?Invalid command\n"); 197 continue; 198 } 199 if (c->c_priv && getuid() && ingroup(LPR_OPER) == 0) { 200 printf("?Privileged command\n"); 201 continue; 202 } |
203 204 /* 205 * Two different commands might have the same generic rtn 206 * (eg: "clean" and "tclean"), and just use different 207 * handler routines for distinct command-setup. The handler 208 * routine might also be set on a generic routine for 209 * initial parameter processing. 210 */ |
|
203 if (c->c_generic != 0) | 211 if (c->c_generic != 0) |
204 generic(c->c_generic, margc, margv); | 212 generic(c->c_generic, c->c_handler, margc, margv); |
205 else 206 (*c->c_handler)(margc, margv); 207 } 208} 209 210static struct cmd * 211getcmd(const char *name) 212{ --- 138 unchanged lines hidden --- | 213 else 214 (*c->c_handler)(margc, margv); 215 } 216} 217 218static struct cmd * 219getcmd(const char *name) 220{ --- 138 unchanged lines hidden --- |