Message ID | 20140427181904.GA31159@domone.podge |
---|---|
State | Committed |
Headers |
Return-Path: <x14307373@homiemail-mx21.g.dreamhost.com> X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx21.g.dreamhost.com (peon2454.g.dreamhost.com [208.113.200.127]) by wilcox.dreamhost.com (Postfix) with ESMTP id 8F37E360075 for <siddhesh@wilcox.dreamhost.com>; Sun, 27 Apr 2014 11:19:14 -0700 (PDT) Received: by homiemail-mx21.g.dreamhost.com (Postfix, from userid 14307373) id 2E76612DA686; Sun, 27 Apr 2014 11:19:14 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx21.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx21.g.dreamhost.com (Postfix) with ESMTPS id DB22C13D9098 for <glibc@patchwork.siddhesh.in>; Sun, 27 Apr 2014 11:19:13 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=hLlRPwUgnT+B2dBC6HnQoNQVGnXCs rbpjVjreEFtqbpSgHGQkkliybMezfgc/+b3X8rfkMq9x8DniFzznnYlrtNabXFzN kEKAtsJ41OBUzTEZx52ysarnuELYRktUhj4clOhouYCBeOHNDs+o5TrbIT/Y+Zm7 l6iV0PRO9ri3XY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=n1aN/X/cntAHuMQuhDTck3XFTsE=; b=ng8 JoxeTRmcvQ7NvAkhiR/vQA6rIdMF5R860P0CY9KPb/xdxH3ckmTFlnH8XpyQQYPn N3fPg12g+8DufRaMUJKTdwflcnuChEq74s0PI/0ll/c6HS1CIvIogXNupJGRuwC0 +yRaWwTfp5pS7PrblqFz+swmo3OKfrgg0/Gi+bSo= Received: (qmail 25064 invoked by alias); 27 Apr 2014 18:19:11 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-glibc=patchwork.siddhesh.in@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 25048 invoked by uid 89); 27 Apr 2014 18:19:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, SPF_NEUTRAL autolearn=no version=3.3.2 X-HELO: popelka.ms.mff.cuni.cz Date: Sun, 27 Apr 2014 20:19:04 +0200 From: =?utf-8?B?T25kxZllaiBCw61sa2E=?= <neleai@seznam.cz> To: libc-alpha@sourceware.org Subject: [PATCH][BZ #16877] Fix typo in nscd/selinux.c Message-ID: <20140427181904.GA31159@domone.podge> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-DH-Original-To: glibc@patchwork.siddhesh.in |
Commit Message
Ondrej Bilka
April 27, 2014, 6:19 p.m. UTC
This bug is another report of typo in code. A perm variable is unitialized so there could be spurious error message depending how gcc optimizes this. This could be changed into intended check as below. OK to commit this? [BZ #16877] * nscd/selinux.c (nscd_request_avc_has_perm): Check if there is nscd security class.
Comments
On Sun, Apr 27, 2014 at 08:19:04PM +0200, Ondřej Bílka wrote: > > This bug is another report of typo in code. A perm variable > is unitialized so there could be spurious error message > depending how gcc optimizes this. This could be changed into > intended check as below. > > OK to commit this? > > [BZ #16877] > * nscd/selinux.c (nscd_request_avc_has_perm): Check if there is > nscd security class. > > diff --git a/nscd/selinux.c b/nscd/selinux.c > index 9a8a5a8..eaed6dd 100644 > --- a/nscd/selinux.c > +++ b/nscd/selinux.c > @@ -372,7 +372,7 @@ nscd_request_avc_has_perm (int fd, request_type req) > /* Get the security class for nscd. If this fails we will likely be > unable to do anything unless avc_deny_unknown is 0. */ > sc_nscd = string_to_security_class ("nscd"); > - if (perm == 0 && avc_deny_unknown == 1) > + if (sc_nscd == 0 && avc_deny_unknown == 1) > dbg_log (_("Error getting security class for nscd.")); > > /* Convert permission to AVC bits. */
On 27 April 2014 19:19, Ondřej Bílka <neleai@seznam.cz> wrote: > > This bug is another report of typo in code. A perm variable > is unitialized so there could be spurious error message > depending how gcc optimizes this. This could be changed into > intended check as below. > > OK to commit this? > > [BZ #16877] > * nscd/selinux.c (nscd_request_avc_has_perm): Check if there is > nscd security class. This looks ok to me and fixes the build warning. > diff --git a/nscd/selinux.c b/nscd/selinux.c > index 9a8a5a8..eaed6dd 100644 > --- a/nscd/selinux.c > +++ b/nscd/selinux.c > @@ -372,7 +372,7 @@ nscd_request_avc_has_perm (int fd, request_type req) > /* Get the security class for nscd. If this fails we will likely be > unable to do anything unless avc_deny_unknown is 0. */ > sc_nscd = string_to_security_class ("nscd"); > - if (perm == 0 && avc_deny_unknown == 1) > + if (sc_nscd == 0 && avc_deny_unknown == 1) > dbg_log (_("Error getting security class for nscd.")); > > /* Convert permission to AVC bits. */
diff --git a/nscd/selinux.c b/nscd/selinux.c index 9a8a5a8..eaed6dd 100644 --- a/nscd/selinux.c +++ b/nscd/selinux.c @@ -372,7 +372,7 @@ nscd_request_avc_has_perm (int fd, request_type req) /* Get the security class for nscd. If this fails we will likely be unable to do anything unless avc_deny_unknown is 0. */ sc_nscd = string_to_security_class ("nscd"); - if (perm == 0 && avc_deny_unknown == 1) + if (sc_nscd == 0 && avc_deny_unknown == 1) dbg_log (_("Error getting security class for nscd.")); /* Convert permission to AVC bits. */