From patchwork Fri Oct 2 12:40:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Reisner X-Patchwork-Id: 51387 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n92FUlZR021113 for ; Fri, 2 Oct 2009 15:30:52 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id A91F861AF4B; Fri, 2 Oct 2009 11:30:50 -0400 (EDT) Received: from int-mx01.intmail.prod.int.phx2.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n92CeZnC002982 for ; Fri, 2 Oct 2009 08:40:35 -0400 Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.8]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n92CeZM1006277 for ; Fri, 2 Oct 2009 08:40:35 -0400 Received: from mail09.linbit.com (mail09.linbit.com [212.69.161.110]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n92CeOqD028035 for ; Fri, 2 Oct 2009 08:40:25 -0400 Received: from localhost.localdomain (unknown [10.9.9.50]) by mail09.linbit.com (LINBIT Mail Daemon) with ESMTP id 35E6210888BF; Fri, 2 Oct 2009 14:40:15 +0200 (CEST) From: Philipp Reisner To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Andrew Morton , "David S. Miller" , Greg KH Date: Fri, 2 Oct 2009 14:40:10 +0200 Message-Id: <1254487211-11810-8-git-send-email-philipp.reisner@linbit.com> In-Reply-To: <1254487211-11810-7-git-send-email-philipp.reisner@linbit.com> References: <1254487211-11810-1-git-send-email-philipp.reisner@linbit.com> <1254487211-11810-2-git-send-email-philipp.reisner@linbit.com> <1254487211-11810-3-git-send-email-philipp.reisner@linbit.com> <1254487211-11810-4-git-send-email-philipp.reisner@linbit.com> <1254487211-11810-5-git-send-email-philipp.reisner@linbit.com> <1254487211-11810-6-git-send-email-philipp.reisner@linbit.com> <1254487211-11810-7-git-send-email-philipp.reisner@linbit.com> X-RedHat-Spam-Score: -1.333 (AWL) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.8 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Fri, 02 Oct 2009 11:30:41 -0400 Cc: Evgeniy Polyakov , dm-devel@redhat.com, linux-fbdev-devel@lists.sourceforge.net, Philipp Reisner Subject: [dm-devel] [PATCH 7/8] pohmelfs/connector: Disallow unpliviged users to configure pohmelfs X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com diff --git a/drivers/staging/pohmelfs/config.c b/drivers/staging/pohmelfs/config.c index c9162b3..5d04bf5 100644 --- a/drivers/staging/pohmelfs/config.c +++ b/drivers/staging/pohmelfs/config.c @@ -531,6 +531,9 @@ static void pohmelfs_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *n { int err; + if (!cap_raised(nsp->eff_cap, CAP_SYS_ADMIN)) + return; + switch (msg->flags) { case POHMELFS_FLAGS_ADD: case POHMELFS_FLAGS_DEL: