From patchwork Wed Sep 27 23:17:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 819336 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-85050-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="HMCYNqHh"; 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 3y2Ydz5yDFz9t6B for ; Thu, 28 Sep 2017 09:18:15 +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=pvdN1RIDL8Y3p5atE8WVsnh5hecqwRr mIg3g2bAtbPfm4yP7q+VFVTtUIMSvx2Y6NiibpDkQH+Mrp3HpfECwCsu/AZBR2VJ TS6udgLgwPCFrmPGsJJtX1Z5q8E+aa+6ADOHq/I5x+dUNa57Rm/T3NuDDR19a9fy oRdk/Ogljnh0= 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=7B0JHBLhoJO2egVMpnw+C9KKZrQ=; b=HMCYN qHhAX0/4jp7T7fwYBcqvwt/J2frJ8Yv3CFxIbYMT+5N9BXcaVYDNaS7o69WjrX6w WGeZxpa6ZmSP9yQ7To8j/I+lhsFLoiD7YeRb5r15Q8TRdHE9Duq6W2KaMbbb8zqE 9XjsoZde/K65uinjk+DV5u/mKRx1KOIkEvuDGM= Received: (qmail 80065 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 79928 invoked by uid 89); 27 Sep 2017 23:17:49 -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=UD:stream X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault Subject: [hurd,commited 1/4] hurd: Fix dirfd symbol exposition from ftw Date: Thu, 28 Sep 2017 01:17:39 +0200 Message-Id: <20170927231742.9050-2-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> dirfd is XOPEN2K8 only, it should not be exposed along ftw which is earlier. * include/dirent.h (__dirfd): New declaration. * dirent/dirfd.c (dirfd): Rename to __dirfd, and redefine as weak alias. * 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. --- ChangeLog | 9 +++++++++ dirent/dirfd.c | 3 ++- include/dirent.h | 1 + io/ftw.c | 6 +++--- sysdeps/mach/hurd/dirfd.c | 4 +++- sysdeps/posix/dirfd.c | 4 +++- 6 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a731980f80..a535da875c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2017-09-27 Samuel Thibault + + * include/dirent.h (__dirfd): New declaration. + * dirent/dirfd.c (dirfd): Rename to __dirfd, and redefine as weak + alias. + * 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. + 2017-09-26 H.J. Lu [BZ #18822] diff --git a/dirent/dirfd.c b/dirent/dirfd.c index 7af77adf01..c1069ffb80 100644 --- a/dirent/dirfd.c +++ b/dirent/dirfd.c @@ -21,10 +21,11 @@ #include int -dirfd (DIR *dirp) +__dirfd (DIR *dirp) { __set_errno (ENOSYS); return -1; } +weak_alias (__dirfd, dirfd) stub_warning (dirfd) diff --git a/include/dirent.h b/include/dirent.h index bebcd52cdb..5720d589a2 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -46,6 +46,7 @@ extern int __versionsort64 (const struct dirent64 **a, extern DIR *__alloc_dir (int fd, bool close_fd, int flags, const struct stat64 *statp) attribute_hidden; extern __typeof (rewinddir) __rewinddir; +extern __typeof (dirfd) __dirfd; extern void __scandir_cancel_handler (void *arg) attribute_hidden; extern int __scandir_tail (DIR *dp, diff --git a/io/ftw.c b/io/ftw.c index 63448e188a..6cca0e4cbc 100644 --- a/io/ftw.c +++ b/io/ftw.c @@ -361,7 +361,7 @@ open_dir_stream (int *dfdp, struct ftw_data *data, struct dir_data *dirp) result = -1; else { - dirp->streamfd = dirfd (dirp->stream); + dirp->streamfd = __dirfd (dirp->stream); dirp->content = NULL; data->dirstreams[data->actdir] = dirp; @@ -518,7 +518,7 @@ fail: /* If necessary, change to this directory. */ if (data->flags & FTW_CHDIR) { - if (__fchdir (dirfd (dir.stream)) < 0) + if (__fchdir (__dirfd (dir.stream)) < 0) { result = -1; goto fail; @@ -602,7 +602,7 @@ fail: /* Change back to the parent directory. */ int done = 0; if (old_dir->stream != NULL) - if (__fchdir (dirfd (old_dir->stream)) == 0) + if (__fchdir (__dirfd (old_dir->stream)) == 0) done = 1; if (!done) diff --git a/sysdeps/mach/hurd/dirfd.c b/sysdeps/mach/hurd/dirfd.c index 0ad290d515..65673336e3 100644 --- a/sysdeps/mach/hurd/dirfd.c +++ b/sysdeps/mach/hurd/dirfd.c @@ -22,7 +22,7 @@ #include int -dirfd (DIR *dirp) +__dirfd (DIR *dirp) { int fd; @@ -41,3 +41,5 @@ dirfd (DIR *dirp) return fd; } + +weak_alias (__dirfd, dirfd) diff --git a/sysdeps/posix/dirfd.c b/sysdeps/posix/dirfd.c index fee8326d93..ce779c50ae 100644 --- a/sysdeps/posix/dirfd.c +++ b/sysdeps/posix/dirfd.c @@ -22,7 +22,9 @@ #undef dirfd int -dirfd (DIR *dirp) +__dirfd (DIR *dirp) { return dirp->fd; } + +weak_alias (__dirfd, dirfd) 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); } From patchwork Wed Sep 27 23:17:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 819355 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-85052-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="Y69jOZHa"; 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 3y2Yq50FHDz9sRm for ; Thu, 28 Sep 2017 09:26:08 +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=c1o/nyRbwby7UY6j+oawNIDR2rUanua kvBpnVY/FBNsTCGvaXx5L+H9y7cMRcYqbOeVHBW8ESqf1+9vbdqOiCoai6NoO8fw u3iQ3AojyEVK0mqAdwBZ/pXRm3FRY4EqtQtPcpZc6ZBY2lEYYV2Ie7F9KevfFP4R 1lRy/MBvrei0= 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=HpKZ1JioNVCpf+C97QK8twPYjeU=; b=Y69jO ZHanW3qDoxucmhdqZS2IU5kq4DRgO1wPMDNxP24hcEsqj/pzuBW9DN7Q1SHpzn9u O/nUq+C23ds/iXc6/rnSWVEqfkLqhcLUgyVkYlT7cohjNCLqV8BNBCqQCrRtpFBv fINmMTr5IKuyB51NE4kax9ahawOYctKwKuzmbk= Received: (qmail 104188 invoked by alias); 27 Sep 2017 23:26:01 -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 104175 invoked by uid 89); 27 Sep 2017 23:26:00 -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 3/4] hurd: Fix `seekdir' symbol exposition from `rewinddir' Date: Thu, 28 Sep 2017 01:17:41 +0200 Message-Id: <20170927231742.9050-4-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> `seekdir' is MISC || XOPEN, it should not be exposed along `rewinddir' which is POSIX. * include/dirent.h (__seekdir): New declaration. * sysdeps/mach/hurd/seekdir.c (seekdir): Rename to __seekdir and redefine as weak alias. * sysdeps/mach/hurd/rewinddir.c (__rewinddir): Use __seekdir instead of seekdir. --- ChangeLog | 5 +++++ include/dirent.h | 1 + sysdeps/mach/hurd/rewinddir.c | 2 +- sysdeps/mach/hurd/seekdir.c | 5 +++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ff321d7e2b..737dc8f808 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,11 @@ * sysdeps/mach/hurd/revoke.c (revoke): Likewise. * sysdeps/unix/bsd/unlockpt.c (unlockpt): Use __revoke instead of revoke. + * include/dirent.h (__seekdir): New declaration. + * sysdeps/mach/hurd/seekdir.c (seekdir): Rename to __seekdir and + redefine as weak alias. + * sysdeps/mach/hurd/rewinddir.c (__rewinddir): Use __seekdir instead + of seekdir. 2017-09-26 H.J. Lu diff --git a/include/dirent.h b/include/dirent.h index 5720d589a2..d7dbf83964 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -46,6 +46,7 @@ extern int __versionsort64 (const struct dirent64 **a, extern DIR *__alloc_dir (int fd, bool close_fd, int flags, const struct stat64 *statp) attribute_hidden; extern __typeof (rewinddir) __rewinddir; +extern __typeof (seekdir) __seekdir; extern __typeof (dirfd) __dirfd; extern void __scandir_cancel_handler (void *arg) attribute_hidden; diff --git a/sysdeps/mach/hurd/rewinddir.c b/sysdeps/mach/hurd/rewinddir.c index b6791d95c3..84aa87c961 100644 --- a/sysdeps/mach/hurd/rewinddir.c +++ b/sysdeps/mach/hurd/rewinddir.c @@ -24,7 +24,7 @@ void __rewinddir (DIR *dirp) { - seekdir (dirp, (off_t) 0L); + __seekdir (dirp, (off_t) 0L); } libc_hidden_def (__rewinddir) weak_alias (__rewinddir, rewinddir) diff --git a/sysdeps/mach/hurd/seekdir.c b/sysdeps/mach/hurd/seekdir.c index 8d3020b02c..68f7ce07c5 100644 --- a/sysdeps/mach/hurd/seekdir.c +++ b/sysdeps/mach/hurd/seekdir.c @@ -22,9 +22,8 @@ #include "dirstream.h" /* Seek to position POS in DIRP. */ -/* XXX should be __seekdir ? */ void -seekdir (DIR *dirp, long int pos) +__seekdir (DIR *dirp, long int pos) { __libc_lock_lock (dirp->__lock); /* Change our entry index pointer to POS and discard any data already @@ -35,3 +34,5 @@ seekdir (DIR *dirp, long int pos) dirp->__size = 0; __libc_lock_unlock (dirp->__lock); } + +weak_alias (__seekdir, seekdir) From patchwork Wed Sep 27 23:17:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 819337 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-85051-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="aOoPDXo1"; 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 3y2Yf75vLLz9t6B for ; Thu, 28 Sep 2017 09:18:23 +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=ArO519PG1ePoebqIfQQX1XtJBNsdLJT VGmicH51qhKM7DRoJk4m5hsE/E61FAtYzkgq2QU30FoG076Ww3Jj3X2TWvr2vn+8 PUOOSZYbudNyJYoMwhxtfVZhb46EvXZFHFzgnwXAfdZnEXbx1WoHI3+3NHmBX0mg bb0IaEdpLemg= 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=eLKme+GVNdPbwNOHQW4PqKpKMfo=; b=aOoPD Xo1gHzUJRw+u/ktH18XqUYZrst2+0Wrc9HxiyqC5ID1xLp/hwQ1eKAN6Z/Sm+uSL 6RbaUc8zneasgcC+S9o/alEQcarsIPzJQo4X6RpeOgSjXNWNxpD03vcCBQFrZFgC 2qEthxqKJVEAmCAUok9k/PQtdTV7EypI22ojm8= Received: (qmail 80363 invoked by alias); 27 Sep 2017 23:17:51 -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 80271 invoked by uid 89); 27 Sep 2017 23:17:50 -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 4/4] hurd: Fix `getifaddrs' and `freeifaddrs' symbol exposition Date: Thu, 28 Sep 2017 01:17:42 +0200 Message-Id: <20170927231742.9050-5-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> from `freeaddrinfo'. `getifaddrs' and `freeifaddrs' are not in POSIX, they should not be exposed along `freeaddrinfo' (through `__check_pf') which is POSIX. * include/ifaddrs.h (__getifaddrs, __freeifaddrs): New declarations, and use libc_hidden_def on them. * inet/ifaddrs.c (__getifaddrs, __freeifaddrs): Use libc_hidden_def on them. * sysdeps/gnu/ifaddrs.c (__getifaddrs, __freeifaddrs): Likewise. * inet/check_pf.c (__check_pf): Use __getifaddrs and __freeifaddrs instead of getifaddrs and freeifaddrs. --- ChangeLog | 7 +++++++ include/ifaddrs.h | 5 +++++ inet/check_pf.c | 4 ++-- inet/ifaddrs.c | 2 ++ sysdeps/gnu/ifaddrs.c | 2 ++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 737dc8f808..8e26c003a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,13 @@ redefine as weak alias. * sysdeps/mach/hurd/rewinddir.c (__rewinddir): Use __seekdir instead of seekdir. + * include/ifaddrs.h (__getifaddrs, __freeifaddrs): New declarations, + and use libc_hidden_def on them. + * inet/ifaddrs.c (__getifaddrs, __freeifaddrs): Use libc_hidden_def on + them. + * sysdeps/gnu/ifaddrs.c (__getifaddrs, __freeifaddrs): Likewise. + * inet/check_pf.c (__check_pf): Use __getifaddrs and __freeifaddrs + instead of getifaddrs and freeifaddrs. 2017-09-26 H.J. Lu diff --git a/include/ifaddrs.h b/include/ifaddrs.h index 54f4b7a3ce..416118f1b3 100644 --- a/include/ifaddrs.h +++ b/include/ifaddrs.h @@ -9,6 +9,11 @@ libc_hidden_proto (getifaddrs) libc_hidden_proto (freeifaddrs) +extern int __getifaddrs (struct ifaddrs **__ifap); +libc_hidden_proto (__getifaddrs) +extern void __freeifaddrs (struct ifaddrs *__ifa); +libc_hidden_proto (__freeifaddrs) + struct in6addrinfo { enum { diff --git a/inet/check_pf.c b/inet/check_pf.c index a56723a7df..84dd1699d5 100644 --- a/inet/check_pf.c +++ b/inet/check_pf.c @@ -32,7 +32,7 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6, /* Get the interface list via getifaddrs. */ struct ifaddrs *ifa = NULL; - if (getifaddrs (&ifa) != 0) + if (__getifaddrs (&ifa) != 0) { /* We cannot determine what interfaces are available. Be pessimistic. */ @@ -51,7 +51,7 @@ __check_pf (bool *seen_ipv4, bool *seen_ipv6, else if (runp->ifa_addr->sa_family == PF_INET6) *seen_ipv6 = true; - (void) freeifaddrs (ifa); + (void) __freeifaddrs (ifa); } diff --git a/inet/ifaddrs.c b/inet/ifaddrs.c index 35cc277225..0a5c71c059 100644 --- a/inet/ifaddrs.c +++ b/inet/ifaddrs.c @@ -30,6 +30,7 @@ __getifaddrs (struct ifaddrs **ifap) return -1; } weak_alias (__getifaddrs, getifaddrs) +libc_hidden_def (__getifaddrs) libc_hidden_weak (getifaddrs) stub_warning (getifaddrs) @@ -43,5 +44,6 @@ __freeifaddrs (struct ifaddrs *ifa) abort (); } weak_alias (__freeifaddrs, freeifaddrs) +libc_hidden_def (__freeifaddrs) libc_hidden_weak (freeifaddrs) stub_warning (freeifaddrs) diff --git a/sysdeps/gnu/ifaddrs.c b/sysdeps/gnu/ifaddrs.c index 37b3248669..80702eb1d1 100644 --- a/sysdeps/gnu/ifaddrs.c +++ b/sysdeps/gnu/ifaddrs.c @@ -151,6 +151,7 @@ __getifaddrs (struct ifaddrs **ifap) return 0; } weak_alias (__getifaddrs, getifaddrs) +libc_hidden_def (__getifaddrs) #ifndef getifaddrs libc_hidden_weak (getifaddrs) #endif @@ -161,4 +162,5 @@ __freeifaddrs (struct ifaddrs *ifa) free (ifa); } weak_alias (__freeifaddrs, freeifaddrs) +libc_hidden_def (__freeifaddrs) libc_hidden_weak (freeifaddrs)