mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Stop APM readers from responding to events
@ 2001-10-31 14:29 Stephen Rothwell
  2001-11-01  0:50 ` David Weinehall
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Rothwell @ 2001-10-31 14:29 UTC (permalink / raw)
  To: Linus Torvlads; +Cc: Alan Cox, Thomas Hood, linux-kernel

Hi Linus,

This is just a small patch, but fills a hole.  Thanks to Thomas Hood for a
patch.

Alan, This will also apply to 2.4.13-ac5.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.4.14-pre5/arch/i386/kernel/apm.c 2.4.14-pre5-APM.1/arch/i386/kernel/apm.c
--- 2.4.14-pre5/arch/i386/kernel/apm.c	Wed Oct 24 16:12:20 2001
+++ 2.4.14-pre5-APM.1/arch/i386/kernel/apm.c	Thu Nov  1 01:09:48 2001
@@ -1471,7 +1471,7 @@
 	as = filp->private_data;
 	if (check_apm_user(as, "ioctl"))
 		return -EIO;
-	if (!as->suser)
+	if ((!as->suser) || (!as->writer))
 		return -EPERM;
 	switch (cmd) {
 	case APM_IOC_STANDBY:

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

* Re: [PATCH] Stop APM readers from responding to events
  2001-10-31 14:29 [PATCH] Stop APM readers from responding to events Stephen Rothwell
@ 2001-11-01  0:50 ` David Weinehall
  0 siblings, 0 replies; 2+ messages in thread
From: David Weinehall @ 2001-11-01  0:50 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Linus Torvlads, Alan Cox, Thomas Hood, linux-kernel

On Thu, Nov 01, 2001 at 01:29:00AM +1100, Stephen Rothwell wrote:
> Hi Linus,
> 
> This is just a small patch, but fills a hole.  Thanks to Thomas Hood for a
> patch.
> 
> Alan, This will also apply to 2.4.13-ac5.

Shouldn't this be done using capabilities instead?!

> diff -ruN 2.4.14-pre5/arch/i386/kernel/apm.c 2.4.14-pre5-APM.1/arch/i386/kernel/apm.c
> --- 2.4.14-pre5/arch/i386/kernel/apm.c	Wed Oct 24 16:12:20 2001
> +++ 2.4.14-pre5-APM.1/arch/i386/kernel/apm.c	Thu Nov  1 01:09:48 2001
> @@ -1471,7 +1471,7 @@
>  	as = filp->private_data;
>  	if (check_apm_user(as, "ioctl"))
>  		return -EIO;
> -	if (!as->suser)
> +	if ((!as->suser) || (!as->writer))
>  		return -EPERM;
>  	switch (cmd) {
>  	case APM_IOC_STANDBY:


/David Weinehall
  _                                                                 _
 // David Weinehall <tao@acc.umu.se> /> Northern lights wander      \\
//  Project MCA Linux hacker        //  Dance across the winter sky //
\>  http://www.acc.umu.se/~tao/    </   Full colour fire           </

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

end of thread, other threads:[~2001-11-01  0:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-31 14:29 [PATCH] Stop APM readers from responding to events Stephen Rothwell
2001-11-01  0:50 ` David Weinehall

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

all inboxes | Powered by JetHome®