From patchwork Sun Apr 27 18:19:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?T25kxZllaiBCw61sa2E=?= X-Patchwork-Id: 343177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 0D5E214009A for ; Mon, 28 Apr 2014 04:19:17 +1000 (EST) 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=f8Hob8ZzwHSVb7vGpnIlo5V58NFa7 7zetKY1p/JtFjCDuSfcu87YQHO8SM25fuP8YLHT+4NeIkpZA5TWWc9xz7FmEFE0e gcdlOvTG7qQ8Xu3ailGdv2FaquvHZwoMaqspalhpasEzX8KRYf6r5kT7kn96Sy0d 9q9TAnlPb3ehl4= 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=ga9 +yw6lI7JrnKACqpCbpsow8n4sStbRlCu9Vc5z7AJjotsnJYsNEA2V9vLHt+ewNnC 2JcRrZbxx3nxLObHjRw8kDNk0Tr8L6r1tFTETBHg0aaZqZ8ZSeQDwVZqnNvnb9yT zYfUF1adg+XKmzY+x589k3P+/8Afvx0p3GFkzoGc= 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: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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=?= 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-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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. */