From patchwork Wed Jun 1 12:56:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Fergeau X-Patchwork-Id: 98187 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CEAF4B6F85 for ; Wed, 1 Jun 2011 23:35:19 +1000 (EST) Received: from localhost ([::1]:56518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRlZr-0000tJ-Ec for incoming@patchwork.ozlabs.org; Wed, 01 Jun 2011 09:35:15 -0400 Received: from eggs.gnu.org ([140.186.70.92]:45262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRkyd-0000a4-5Z for qemu-devel@nongnu.org; Wed, 01 Jun 2011 08:56:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QRkyY-0000c1-DR for qemu-devel@nongnu.org; Wed, 01 Jun 2011 08:56:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRkyX-0000be-L0 for qemu-devel@nongnu.org; Wed, 01 Jun 2011 08:56:41 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p51CuexW031806 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 1 Jun 2011 08:56:40 -0400 Received: from localhost.localdomain (ovpn-113-86.phx2.redhat.com [10.3.113.86]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p51CuXXI031284 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 1 Jun 2011 08:56:39 -0400 From: Christophe Fergeau To: qemu-devel@nongnu.org Date: Wed, 1 Jun 2011 14:56:32 +0200 Message-Id: <1306932992-30075-4-git-send-email-cfergeau@redhat.com> In-Reply-To: <1306932992-30075-1-git-send-email-cfergeau@redhat.com> References: <1306932992-30075-1-git-send-email-cfergeau@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Christophe Fergeau Subject: [Qemu-devel] [PATCH 3/3] linux-user: Fix unused-but-set-variable warning X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This warning is new in gcc 4.6. Signed-off-by: Christophe Fergeau --- linux-user/linuxload.c | 9 +-------- 1 files changed, 1 insertions(+), 8 deletions(-) diff --git a/linux-user/linuxload.c b/linux-user/linuxload.c index ac8c486..e66a4ea 100644 --- a/linux-user/linuxload.c +++ b/linux-user/linuxload.c @@ -57,7 +57,7 @@ static int prepare_binprm(struct linux_binprm *bprm) { struct stat st; int mode; - int retval, id_change; + int retval; if(fstat(bprm->fd, &st) < 0) { return(-errno); @@ -73,14 +73,10 @@ static int prepare_binprm(struct linux_binprm *bprm) bprm->e_uid = geteuid(); bprm->e_gid = getegid(); - id_change = 0; /* Set-uid? */ if(mode & S_ISUID) { bprm->e_uid = st.st_uid; - if(bprm->e_uid != geteuid()) { - id_change = 1; - } } /* Set-gid? */ @@ -91,9 +87,6 @@ static int prepare_binprm(struct linux_binprm *bprm) */ if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) { bprm->e_gid = st.st_gid; - if (!in_group_p(bprm->e_gid)) { - id_change = 1; - } } retval = read(bprm->fd, bprm->buf, BPRM_BUF_SIZE);