The following patch allowed a user of a local lpd to remove all his jobs
in queue but the active one with "lprm -". I find it handy but maybe it
is not the wanted behaviour for historical reason or whatever.

--8<---------------cut here---------------start------------->8---
Index: common_source/rmjob.c
===================================================================
RCS file: /cvs/src/usr.sbin/lpr/common_source/rmjob.c,v
retrieving revision 1.18
diff -u -p -r1.18 rmjob.c
--- common_source/rmjob.c       27 Oct 2009 23:59:51 -0000      1.18
+++ common_source/rmjob.c       8 Feb 2011 14:20:11 -0000
@@ -33,6 +33,7 @@
 #include <sys/param.h>
 
 #include <signal.h>
+#include <err.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <dirent.h>
@@ -131,13 +132,14 @@ rmjob(void)
                        assasinated = kill(cur_daemon, SIGINT) == 0;
                        PRIV_END;
                        if (!assasinated)
-                               fatal("cannot kill printer daemon");
+                               warnx("cannot kill printer daemon");
                }
                /*
                 * process the files
                 */
                for (i = 0; i < nitems; i++)
-                       process(files[i]->d_name);
+                       if (assasinated || strncmp(files[i]->d_name, current, 
NAME_MAX))
+                               process(files[i]->d_name);
        }
        rmremote();
        /*
--8<---------------cut here---------------end--------------->8---

-- 
Manuel Giraud

Reply via email to