Deleted Added
full compact
lprm.c (216372) lprm.c (241852)
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:

--- 27 unchanged lines hidden (view full) ---

36
37#if 0
38#ifndef lint
39static char sccsid[] = "@(#)lprm.c 8.1 (Berkeley) 6/6/93";
40#endif /* not lint */
41#endif
42
43#include "lp.cdefs.h" /* A cross-platform version of <sys/cdefs.h> */
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:

--- 27 unchanged lines hidden (view full) ---

36
37#if 0
38#ifndef lint
39static char sccsid[] = "@(#)lprm.c 8.1 (Berkeley) 6/6/93";
40#endif /* not lint */
41#endif
42
43#include "lp.cdefs.h" /* A cross-platform version of <sys/cdefs.h> */
44__FBSDID("$FreeBSD: head/usr.sbin/lpr/lprm/lprm.c 216372 2010-12-11 09:38:12Z joel $");
44__FBSDID("$FreeBSD: head/usr.sbin/lpr/lprm/lprm.c 241852 2012-10-22 03:31:22Z eadler $");
45
46/*
47 * lprm - remove the current user's spool entry
48 *
49 * lprm [-] [[job #] [user] ...]
50 *
51 * Using information in the lock file, lprm will kill the
52 * currently active daemon (if necessary), remove the associated files,
53 * and startup a new daemon. Priviledged users may remove anyone's spool
54 * entries, otherwise one can only remove their own.
55 */
56
57#include <sys/param.h>
58
59#include <syslog.h>
60#include <dirent.h>
45
46/*
47 * lprm - remove the current user's spool entry
48 *
49 * lprm [-] [[job #] [user] ...]
50 *
51 * Using information in the lock file, lprm will kill the
52 * currently active daemon (if necessary), remove the associated files,
53 * and startup a new daemon. Priviledged users may remove anyone's spool
54 * entries, otherwise one can only remove their own.
55 */
56
57#include <sys/param.h>
58
59#include <syslog.h>
60#include <dirent.h>
61#include <err.h>
61#include <pwd.h>
62#include <unistd.h>
63#include <stdlib.h>
64#include <stdio.h>
65#include <string.h>
66#include <ctype.h>
67#include "lp.h"
68#include "lp.local.h"

--- 19 unchanged lines hidden (view full) ---

88 char *arg;
89 const char *printer;
90 struct passwd *p;
91 static char root[] = "root";
92
93 printer = NULL;
94 uid = getuid();
95 euid = geteuid();
62#include <pwd.h>
63#include <unistd.h>
64#include <stdlib.h>
65#include <stdio.h>
66#include <string.h>
67#include <ctype.h>
68#include "lp.h"
69#include "lp.local.h"

--- 19 unchanged lines hidden (view full) ---

89 char *arg;
90 const char *printer;
91 struct passwd *p;
92 static char root[] = "root";
93
94 printer = NULL;
95 uid = getuid();
96 euid = geteuid();
96 seteuid(uid); /* be safe */
97 PRIV_END /* be safe */
97 progname = argv[0];
98 gethostname(local_host, sizeof(local_host));
99 openlog("lpd", 0, LOG_LPR);
100
101 /*
102 * Bogus code later checks for string equality between
103 * `person' and "root", so if we are root, better make sure
104 * that code will succeed.

--- 57 unchanged lines hidden ---
98 progname = argv[0];
99 gethostname(local_host, sizeof(local_host));
100 openlog("lpd", 0, LOG_LPR);
101
102 /*
103 * Bogus code later checks for string equality between
104 * `person' and "root", so if we are root, better make sure
105 * that code will succeed.

--- 57 unchanged lines hidden ---