From patchwork Wed Sep 27 23:17:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 819335 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-85049-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="TFenuLOk"; dkim-atps=neutral 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 3y2Ydm5F2Bz9t6B for ; Thu, 28 Sep 2017 09:18:04 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=DqK3lDWDiN284SbEAN3NaKnsFmrGv4H twhk2a1UVwu/ZjBSa3XTFoiRubZ6Kyhklo6+8X6EAMdFbUQs0XQl79jkk+v8oXif mIG/UePfruflkN30nj1qbCMYzblr+S6zqy2tnx5c30av9ZMZ/bOq2qDPMLbnzLbd IAZX8ycueSMk= 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:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=NK5tachBSoHZE8xXyN/+SX7WBg0=; b=TFenu LOky4bmOY6PGJ5MUb3s7TEYOk1Lbm1dPzkY7zHmLS4h9d/6qbZBum2Z37zG28mwQ I1VTOJ3ZNm78wffkUqiGWexWVFPxkkm6fX0HHXcRmzwI8QitJsWUrnGKJ/XveooN zD8olhcWTJU4dH8jmsbmhU2d4m96vclJzV+R/Y= Received: (qmail 79929 invoked by alias); 27 Sep 2017 23:17:49 -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 79904 invoked by uid 89); 27 Sep 2017 23:17:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.2 spammy= X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault Subject: [hurd, commited 2/4] hurd: Fix `revoke' symbol exposition from `unlockpt' Date: Thu, 28 Sep 2017 01:17:40 +0200 Message-Id: <20170927231742.9050-3-samuel.thibault@ens-lyon.org> In-Reply-To: <20170927231742.9050-1-samuel.thibault@ens-lyon.org> References: <20170927231742.9050-1-samuel.thibault@ens-lyon.org> `revoke' is MISC only, it should not be exposed along `unlockpt' which is XOPEN. * include/unistd.h (__revoke): New declaration. * misc/revoke.c (revoke): Rename to __revoke, and redefine as weak alias. * sysdeps/mach/hurd/revoke.c (revoke): Likewise. * sysdeps/unix/bsd/unlockpt.c (unlockpt): Use __revoke instead of revoke. --- ChangeLog | 6 ++++++ include/unistd.h | 1 + misc/revoke.c | 4 +++- sysdeps/mach/hurd/revoke.c | 4 +++- sysdeps/unix/bsd/unlockpt.c | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a535da875c..ff321d7e2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,12 @@ * sysdeps/posix/dirfd/dirfd.c (dirfd): Likewise. * sysdeps/mach/hurd/dirfd.c (dirfd): Likewise. * io/ftw.c (open_dir_stream, ftw_dir): Use __dirfd instead of dirfd. + * include/unistd.h (__revoke): New declaration. + * misc/revoke.c (revoke): Rename to __revoke, and redefine as weak + alias. + * sysdeps/mach/hurd/revoke.c (revoke): Likewise. + * sysdeps/unix/bsd/unlockpt.c (unlockpt): Use __revoke instead of + revoke. 2017-09-26 H.J. Lu diff --git a/include/unistd.h b/include/unistd.h index a5625ed7f4..bfe0e4de47 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -130,6 +130,7 @@ extern int __symlink (const char *__from, const char *__to); extern ssize_t __readlink (const char *__path, char *__buf, size_t __len); extern int __unlink (const char *__name); extern int __gethostname (char *__name, size_t __len); +extern int __revoke (const char *__file); extern int __profil (unsigned short int *__sample_buffer, size_t __size, size_t __offset, unsigned int __scale); extern int __getdtablesize (void); diff --git a/misc/revoke.c b/misc/revoke.c index d953216246..21df2bbf90 100644 --- a/misc/revoke.c +++ b/misc/revoke.c @@ -20,9 +20,11 @@ #include int -revoke (const char *file) +__revoke (const char *file) { __set_errno (ENOSYS); return -1; } + +weak_alias (__revoke, revoke) stub_warning (revoke) diff --git a/sysdeps/mach/hurd/revoke.c b/sysdeps/mach/hurd/revoke.c index 15b955b733..2f47f42de6 100644 --- a/sysdeps/mach/hurd/revoke.c +++ b/sysdeps/mach/hurd/revoke.c @@ -21,7 +21,7 @@ #include int -revoke (const char *file_name) +__revoke (const char *file_name) { error_t err; file_t file = __file_name_lookup (file_name, 0, 0); @@ -36,3 +36,5 @@ revoke (const char *file_name) return __hurd_fail (err); return 0; } + +weak_alias (__revoke, revoke) diff --git a/sysdeps/unix/bsd/unlockpt.c b/sysdeps/unix/bsd/unlockpt.c index 7388c98523..ca4e7c654e 100644 --- a/sysdeps/unix/bsd/unlockpt.c +++ b/sysdeps/unix/bsd/unlockpt.c @@ -32,5 +32,5 @@ unlockpt (int fd) /* BSD doesn't have a lock, but it does have `revoke'. */ if (__ptsname_r (fd, buf, sizeof (buf))) return -1; - return revoke (buf); + return __revoke (buf); }