From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Jiri Slaby <jslaby@suse.cz>
Cc: jirislaby@gmail.com, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, Jeff Mahoney <jeffm@suse.com>,
Patrick Koppen <isdn4linux@koppen.de>,
Karsten Keil <isdn@linux-pingi.de>,
netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH -resend 1/6] mISDN: Add support for group membership check
Date: Wed, 22 May 2013 23:04:20 +0400 [thread overview]
Message-ID: <519D16B4.7080905@cogentembedded.com> (raw)
In-Reply-To: <1369227552-11743-1-git-send-email-jslaby@suse.cz>
Hello.
On 22-05-2013 16:59, Jiri Slaby wrote:
> From: Jeff Mahoney <jeffm@suse.com>
> This patch adds a module parameter to allow a group access to the
> mISDN devices. Otherwise, unpriviledged users on systems with ISDN
> hardware have the ability to dial out, potentially causing expensive
> bills.
> Based on a different implementation by Patrick Koppen <isdn4linux@koppen.de>
> Acked-by: Jeff Mahoney <jeffm@suse.com>
> Cc: Patrick Koppen <isdn4linux@koppen.de>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Cc: Karsten Keil <isdn@linux-pingi.de>
> Cc: netdev@vger.kernel.org
> Cc: "David S. Miller" <davem@davemloft.net>
> ---
> drivers/isdn/mISDN/core.c | 3 +++
> drivers/isdn/mISDN/core.h | 1 +
> drivers/isdn/mISDN/socket.c | 8 ++++++++
> 3 files changed, 12 insertions(+)
[...]
> diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
> index e47dcb9..71f4986 100644
> --- a/drivers/isdn/mISDN/socket.c
> +++ b/drivers/isdn/mISDN/socket.c
> @@ -612,6 +612,10 @@ data_sock_create(struct net *net, struct socket *sock, int protocol)
> {
> struct sock *sk;
>
> + if(!capable(CAP_SYS_ADMIN) && (misdn_permitted_gid != current_gid())
Did you run this thru scripts/checkpatch.pl? There should be space
after *if*. Also, () around != are not neccessary...
> @@ -694,6 +698,10 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
> case IMSETDEVNAME:
> {
> struct mISDN_devrename dn;
> + if(!capable(CAP_SYS_ADMIN)
Again, need space after *if*.
> + && (misdn_permitted_gid != current_gid())
Better leave && on a previous line and align the line under !. ()
again are not necessary.
> + && (!in_group_p(misdn_permitted_gid)))
() around !x are simply not needed -- ! operator has very high priority.
WBR, Sergei
next prev parent reply other threads:[~2013-05-22 19:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-22 12:59 [PATCH -resend 1/6] mISDN: Add support for group membership check Jiri Slaby
2013-05-22 12:59 ` [PATCH -resend 2/6] ehea: add alias entry for portN properties Jiri Slaby
2013-05-22 12:59 ` [PATCH -resend 4/6] netfilter: Implement RFC 1123 for FTP conntrack Jiri Slaby
2013-05-27 12:20 ` Pablo Neira Ayuso
2013-05-22 19:04 ` Sergei Shtylyov [this message]
2013-05-22 19:42 ` [PATCH v2 -resend 1/6] mISDN: Add support for group membership check Jiri Slaby
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=519D16B4.7080905@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=isdn4linux@koppen.de \
--cc=isdn@linux-pingi.de \
--cc=jeffm@suse.com \
--cc=jirislaby@gmail.com \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).