public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] 2.4.0: lp superuser check
@ 2001-01-05 17:16 Tim Waugh
  2001-01-05 23:41 ` suser() check audit Was: " David Weinehall
  0 siblings, 1 reply; 2+ messages in thread
From: Tim Waugh @ 2001-01-05 17:16 UTC (permalink / raw)
  To: linux-kernel

Here is a patch that changes the superuser check in lp to use
capabilities instead.

Does anyone see a problem with it before I send it to Linus?

Tim.
*/

2001-01-05  Tim Waugh  <twaugh@redhat.com>

	* drivers/char/lp.c: Capability check instead of superuser check.
	Patch from acme@connectiva.com.br.

--- linux-2.4.0/drivers/char/lp.c.lp	Wed Nov  1 15:06:20 2000
+++ linux-2.4.0/drivers/char/lp.c	Fri Jan  5 10:58:18 2001
@@ -485,7 +485,7 @@
 			if (copy_to_user((int *) arg, &LP_STAT(minor),
 					sizeof(struct lp_stats)))
 				return -EFAULT;
-			if (suser())
+			if (capable(CAP_SYS_ADMIN))
 				memset(&LP_STAT(minor), 0,
 						sizeof(struct lp_stats));
 			break;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-01-05 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-05 17:16 [patch] 2.4.0: lp superuser check Tim Waugh
2001-01-05 23:41 ` suser() check audit Was: " David Weinehall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox