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))
                        {

On Thu, 1 Aug 2013 19:44:16 +0200 Roland Mainz wrote:
> 2013/8/1 Irek Szczesniak <[email protected]>:
> > I'm trying to create a file relative to a directory fd but it doesn't work:
> >
> > ksh -c 'command exec {n}<"." ; echo "foo" >~{n}/test1 ; true '
> >
> > Does anyone know what's wrong in this case?
> >
> > ksh --version
> >   version         sh (AT&T Research) 93v- 2013-07-24

> Grrr... someone broke directory fds again...

> Glenn: It worked in ast-ksh.2013-07-19 and first failed in ast-ksh.2013-07-27:
> -- snip --
> $ (find . -name ksh -type f | sort -u | fgrep 'linux.i386-64/bin/ksh'
> | while read i ; do echo "#### $i" ; "$i" -c 'command exec {n}<"." ;
> echo "test123" >~{n}/test1 ; true ' ; done)
> ...
> ...
> ### 
> ./ast_ksh_20130719/build_i386_64bit_debug_patched/arch/linux.i386-64/bin/ksh
> #### 
> ./ast_ksh_20130719/build_i386_64bit_debug_stpcpy/arch/linux.i386-64/bin/ksh
> #### ./ast_ksh_20130727/build_fgetcwd/arch/linux.i386-64/bin/ksh
> ./ast_ksh_20130727/build_fgetcwd/arch/linux.i386-64/bin/ksh:
> /proc/30863/fd/11/test1: cannot create [Permission denied]
> #### ./ast_ksh_20130727/build_i386_64bit_debug/arch/linux.i386-64/bin/ksh
> -- snip --

_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to