Received: from eggs.gnu.org ([140.186.70.92]:57108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXFZJ-0002k3-Pq for qemu-devel@nongnu.org; Thu, 16 Jun 2011 12:37:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXFZI-0005I3-1h for qemu-devel@nongnu.org; Thu, 16 Jun 2011 12:37:21 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:50682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXFZH-0005Hn-Ia for qemu-devel@nongnu.org; Thu, 16 Jun 2011 12:37:19 -0400 From: Peter Maydell Date: Thu, 16 Jun 2011 17:37:08 +0100 Message-Id: <1308242235-8261-2-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1308242235-8261-1-git-send-email-peter.maydell@linaro.org> References: <1308242235-8261-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH 1/8] linuxload: id_change was a write only variable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Riku Voipio , Juan Quintela , patches@linaro.org From: Juan Quintela Signed-off-by: Juan Quintela Signed-off-by: Peter Maydell --- linux-user/linuxload.c | 25 +------------------------ 1 files changed, 1 insertions(+), 24 deletions(-) diff --git a/linux-user/linuxload.c b/linux-user/linuxload.c index ac8c486..62ebc7e 100644 --- a/linux-user/linuxload.c +++ b/linux-user/linuxload.c @@ -26,22 +26,6 @@ abi_long memcpy_to_target(abi_ulong dest, const void *src, return 0; } -static int in_group_p(gid_t g) -{ - /* return TRUE if we're in the specified group, FALSE otherwise */ - int ngroup; - int i; - gid_t grouplist[NGROUPS]; - - ngroup = getgroups(NGROUPS, grouplist); - for(i = 0; i < ngroup; i++) { - if(grouplist[i] == g) { - return 1; - } - } - return 0; -} - static int count(char ** vec) { int i; @@ -57,7 +41,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 +57,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 +71,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); -- 1.7.1