All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org, eibach@gdsys.de
Subject: Re: [PATCH 1/1] Char: moxa, prevent opening unavailable ports
Date: Tue, 09 Jun 2009 21:36:04 +0200	[thread overview]
Message-ID: <4A2EB9A4.4040403@gmail.com> (raw)
In-Reply-To: <20090609122735.9a915cbf.akpm@linux-foundation.org>

On 06/09/2009 09:27 PM, Andrew Morton wrote:
> btw, what's this code in moxa_open() doing?
> 
> 	if (port == MAX_PORTS) {
> 		return capable(CAP_SYS_ADMIN) ? 0 : -EPERM;
> 	}
> 
> why does it return 0 if CAP_SYS_ADMIN?				

There is some global stats ioctl crap on that port number available only
to users with permissions. Look at moxa_ioctl, there is:

        if (tty->index == MAX_PORTS) {
                if (cmd != MOXA_GETDATACOUNT && cmd != MOXA_GET_IOQUEUE &&
                                cmd != MOXA_GETMSTATUS)
                        return -EINVAL;

Of course, there is also alloc_tty_driver(MAX_PORTS + 1).

  reply	other threads:[~2009-06-09 19:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-09 14:33 [PATCH 1/1] Char: moxa, prevent opening unavailable ports Jiri Slaby
2009-06-09 19:27 ` Andrew Morton
2009-06-09 19:36   ` Jiri Slaby [this message]
2009-06-09 23:34   ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A2EB9A4.4040403@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=eibach@gdsys.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.