From patchwork Fri Jun 20 20:27:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 362337 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 E2EA014008B for ; Sat, 21 Jun 2014 06:27:43 +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=sR1tpzAEpY8r1a+dw/Ut/zd/HALfm Od5BLLNve1SeVFo24EDPx7YyspelojlDLE2VkplkX+aqbttSgkv2cEtZQTm4QGFb 9hYdBhnLEZV+cjLaNkZ10gSWnJL7G7fqGe8DIXpb8nKB5T3vKK3HVZUntTfoK5+Z J+qaMgQSv4YSeY= 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=Sow3otP9gKYL8wiDw9K+UaN4qpo=; b=jF7 4hjO+z9k61HuOGVPSxmjvZP0O9r3/gU6Zwv52hz1wcyTh+Zgsp8196JPDmGq9fMk kgysuIjeqkyBSADVPtRaArnHGkeJ+FVE5r+jTKtEOvfw0NHwMbveeyDSaMP9W/hG krSLQ69SD1yJFTQStOBEIKPbfcx9IvwN40NLD2Ts= Received: (qmail 30970 invoked by alias); 20 Jun 2014 20:27:37 -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 30960 invoked by uid 89); 20 Jun 2014 20:27:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Date: Fri, 20 Jun 2014 20:27:29 +0000 From: "Joseph S. Myers" To: Subject: Remove __ASSUME_XFS_RESTRICTED_CHOWN Message-ID: MIME-Version: 1.0 This patch removes the __ASSUME_XFS_RESTRICTED_CHOWN macro, now it can be presumed to be defined unconditionally. I'm not sure if what's left of __statfs_chown_restricted is actually useful (if not, a followup could remove it), but I left it there to keep the patch conservative and avoid changing the code generated for glibc. Tested x86_64 that the disassembly of installed shared libraries is unchanged by the patch. 2014-06-20 Joseph Myers * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_XFS_RESTRICTED_CHOWN): Remove macro. * sysdeps/unix/sysv/linux/pathconf.c (__statfs_chown_restricted) [__ASSUME_XFS_RESTRICTED_CHOWN]: Make code unconditional. (__statfs_chown_restricted) [!__ASSUME_XFS_RESTRICTED_CHOWN]: Remove conditional code. diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index b39b295..8db841d 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -237,7 +237,3 @@ #if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100 # define __ASSUME_GETCPU_SYSCALL 1 #endif - -/* 2.6.29 removed the XFS restricted_chown sysctl, so it is pointless looking - for it in newer kernels. */ -#define __ASSUME_XFS_RESTRICTED_CHOWN 1 diff --git a/sysdeps/unix/sysv/linux/pathconf.c b/sysdeps/unix/sysv/linux/pathconf.c index 578b736..086b2dc 100644 --- a/sysdeps/unix/sysv/linux/pathconf.c +++ b/sysdeps/unix/sysv/linux/pathconf.c @@ -289,35 +289,5 @@ __statfs_chown_restricted (int result, const struct statfs *fsbuf) return -1; } -#if __ASSUME_XFS_RESTRICTED_CHOWN return 1; -#else - int fd; - int save_errno; - long int retval = 1; - switch (fsbuf->f_type) - { - case XFS_SUPER_MAGIC: - save_errno = errno; - /* Read the value from /proc/sys/fs/xfs/restrict_chown. If we cannot - read it default to assume the restriction is in place. */ - fd = open_not_cancel_2 ("/proc/sys/fs/xfs/restrict_chown", O_RDONLY); - if (fd != -1) - { - char buf[2]; - if (TEMP_FAILURE_RETRY (read_not_cancel (fd, buf, 2)) == 2 - && buf[0] >= '0' && buf[0] <= '1') - retval = buf[0] - '0'; - - close_not_cancel_no_status (fd); - } - __set_errno (save_errno); - break; - - default: - break; - } - - return retval; -#endif }