Discussion:
[ast-developers] [patch] "Bad address" with $ cd /dev/fd/$dirfd ... / was: Re: When will the tree reopen for normal patches?
Roland Mainz
2013-06-20 11:55:54 UTC
Permalink
cc: ast-developers at research.att.com
Subject: Re: [ast-developers] When will the tree reopen for normal patches?
--------
cd /dev/fd/$d no longer works
What do you mean that it no longer works, I just did
exec 9< /tmp
and was able to do
cd /dev/fd/9/foo
to change to /tmp/foo.
AFAIK the issue is that |openat()| on some platforms/libc combinations
doesn't like |NULL| as |filename| argument and returns "Bad Address"
via |errno|.

The quick fix for the issue seems to be:
-- snip --
diff -r -u src/cmd/ksh93/bltins/cd_pwd.c src/cmd/ksh93/bltins/cd_pwd.c
--- src/cmd/ksh93/bltins/cd_pwd.c 2013-05-16 16:36:14.000000000 +0200
+++ src/cmd/ksh93/bltins/cd_pwd.c 2013-06-20 13:46:10.754325192 +0200
@@ -114,7 +114,7 @@
{
while(*p=='/')
p++;
- path = *p?(const char*)p:0;
+ path = *p?(const char*)p:e_dot;
dir = fd;
}
}
-- snip --

----

Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
David Korn
2013-06-20 13:02:58 UTC
Permalink
cc: ast-developers at research.att.com olga.kryzhanovska at gmail.com
Subject: Re: [patch] "Bad address" with $ cd /dev/fd/$dirfd ... / was: Re: [ast-developers] When will the tree reopen for normal patches?
--------

Thanks, I was unable to reproduce it here. This explains why it happens.
The patch will be in the next alpha.

David Korn
dgk at research.att.com
Roland Mainz
2013-06-20 13:06:53 UTC
Permalink
Post by David Korn
cc: ast-developers at research.att.com olga.kryzhanovska at gmail.com
Subject: Re: [patch] "Bad address" with $ cd /dev/fd/$dirfd ... / was: Re: [ast-developers] When will the tree reopen for normal patches?
--------
Thanks, I was unable to reproduce it here. This explains why it happens.
The patch will be in the next alpha.
Erm... if there is time... can you please include the patch for
|O_search|, too ? It's the foundation for some other work and causing
major bitrot on our side...

----

Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
Loading...