Discussion:
[ast-developers] [patch] Directory file descriptor test module ("directoryfd.sh") ... / was: Re: 'command exec {n}<"." ; echo "foo" >~{n}/test1 ' doesn't work
Roland Mainz
2013-08-01 23:25:26 UTC
Permalink
[snip]
its in src/lib/libast/path/pathopen.c which unifies all of the
/dev/ and /proc/<pid>/<fd>/ intercepts in one place
my bad
try this patch
(your line numbers will differ because mast source doesn't have the copyright comment)
--- .../path/pathopen.c Tue Jul 23 14:51:50 2013
+++ path/pathopen.c Thu Aug 1 14:55:47 2013
@@ -162,7 +162,12 @@
return 1;
}
- /* F_GETFL must match oflags */
+ /* a trailing path component means dev.fd must be a directory */
+
+ if (b[dev.path.offset])
+ return openat(dev.fd, b + dev.path.offset, oflags, mode);
+
+ /* the path boils down to just dev.fd -- F_GETFL must match oflags */
if (!(f & O_RDWR) && (f & O_ACCMODE) != (oflags & O_ACCMODE))
{
Thanks... the patch seems to fix the issue on SuSE
12.3/Linux/AMD64/64bit... I'll test more platforms (Solaris) later
today...
... and if I find time I write a "directoryfd.sh" test module to cover
this area...
Attached (as "directoryfd.sh.gz") is the prototype for a test module
which watches over the directory file descriptor functionality. It
doesn't contain all tests I'd like to integrate but it would be nice
to add it to ast-ksh&co. for now so this functioanlity doesn't get
broken again...

----

Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: directoryfd.sh.gz
Type: application/x-gzip
Size: 1508 bytes
Desc: not available
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20130802/f091c435/attachment.gz>
Loading...