Fix grantpt basename namespace bug

Message ID 1449237270-6181-1-git-send-email-aurelien@aurel32.net
State Committed
Headers

Commit Message

Aurelien Jarno Dec. 4, 2015, 1:54 p.m. UTC
  Commit cf06a4e3 removed test-xfail-POSIX2008/unistd.h/linknamespace, but
left one basename namespace issue in grantpt. However this issue is not
visible with the default configuration buy only when configure is passed
the --enable-pt_chown option.
---
 ChangeLog              | 5 +++++
 sysdeps/unix/grantpt.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
  

Comments

Florian Weimer Dec. 4, 2015, 2:18 p.m. UTC | #1
On 12/04/2015 02:54 PM, Aurelien Jarno wrote:
> Commit cf06a4e3 removed test-xfail-POSIX2008/unistd.h/linknamespace, but
> left one basename namespace issue in grantpt. However this issue is not
> visible with the default configuration buy only when configure is passed
> the --enable-pt_chown option.

Let's remove that option instead.  Do you want to send a patch?

Florian
  
Aurelien Jarno Dec. 4, 2015, 2:43 p.m. UTC | #2
On 2015-12-04 15:18, Florian Weimer wrote:
> On 12/04/2015 02:54 PM, Aurelien Jarno wrote:
> > Commit cf06a4e3 removed test-xfail-POSIX2008/unistd.h/linknamespace, but
> > left one basename namespace issue in grantpt. However this issue is not
> > visible with the default configuration buy only when configure is passed
> > the --enable-pt_chown option.
> 
> Let's remove that option instead.  Do you want to send a patch?

It will break GNU/Hurd.
  
Florian Weimer Dec. 4, 2015, 5:24 p.m. UTC | #3
On 12/04/2015 03:43 PM, Aurelien Jarno wrote:
> On 2015-12-04 15:18, Florian Weimer wrote:
>> On 12/04/2015 02:54 PM, Aurelien Jarno wrote:
>>> Commit cf06a4e3 removed test-xfail-POSIX2008/unistd.h/linknamespace, but
>>> left one basename namespace issue in grantpt. However this issue is not
>>> visible with the default configuration buy only when configure is passed
>>> the --enable-pt_chown option.
>>
>> Let's remove that option instead.  Do you want to send a patch?
> 
> It will break GNU/Hurd.

Okay, in this case the original patch is fine.

Florian
  

Patch

diff --git a/ChangeLog b/ChangeLog
index 292c495..b2d0432 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@ 
+2015-12-04  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* sysdeps/unix/grantpt.c (grantpt): Call__basename instead of
+	basename.
+
 2015-12-03  Chris Metcalf  <cmetcalf@ezchip.com>
 
 	* sysdeps/arm/math_private.h (LDBL_CLASSIFY_COMPAT): New symbol.
diff --git a/sysdeps/unix/grantpt.c b/sysdeps/unix/grantpt.c
index c04c85d..f019b9d 100644
--- a/sysdeps/unix/grantpt.c
+++ b/sysdeps/unix/grantpt.c
@@ -195,7 +195,7 @@  grantpt (int fd)
       CLOSE_ALL_FDS ();
 # endif
 
-      execle (_PATH_PT_CHOWN, basename (_PATH_PT_CHOWN), NULL, NULL);
+      execle (_PATH_PT_CHOWN, __basename (_PATH_PT_CHOWN), NULL, NULL);
       _exit (FAIL_EXEC);
     }
   else