Thank was fast. Thanks
Irek On Wed, Aug 21, 2013 at 2:27 AM, Roland Mainz <[email protected]> wrote: > On Wed, Aug 21, 2013 at 12:58 AM, Irek Szczesniak <[email protected]> > wrote: >> On Wed, Aug 14, 2013 at 9:37 PM, Glenn Fowler <[email protected]> wrote: >>> On Wed, 14 Aug 2013 15:36:26 -0400 Glenn Fowler wrote: >>>> On Wed, 14 Aug 2013 21:29:50 +0200 Irek Szczesniak wrote: >>>> > On Wed, Aug 14, 2013 at 8:18 PM, Glenn Fowler <[email protected]> >>>> > wrote: >>>> > > >>>> > > invalid assumption that if this works >>>> > > open("/proc/self/fd/<DIRFD>/.") >>>> > > then other pathname calls will too >>>> > > and this is then used to emulate missing *at() calls >>> >>>> > Curse SUN and its half baked innovations. >>>> > if anyone of you have a patch send it to me or the list, please >>> >>>> yes >>> >>> yes to the curse >> >> How did you fix this for ast-ksh.2013-08-14? > > See |pathdev()| in src/lib/libast/path/pathcanon.c (and see my patch below) > ... > >> First I thought the code >> is clever and extracts the fd number from /proc/self/fd/<DIRFD>/ but >> then I found it just uses open() toopen /proc/self/fd/<DIRFD>/ and >> pass that to mkdirat(), which is a waste of good syscalls and doesn't >> work: >> ksh -c '/usr/bin/rm -Rf t1 ; mkdir t1 ; redirect {n}<t1 ; chmod a-r t1 >> ; mkdir /proc/$$/fd/$n/t2 ; true' >> mkdir: /proc/645/fd/11/t2: [Permission denied] >> >> I would fix it myself but can't find the place which converts the >> /proc/$$/fd/$n/$path to a <fd>,<path> pair as it should be. > > Attached (as "astksh20130814_solaris_proc_fixes001.diff.txt") is a > patch which fixes the bug from two directions: > 1. If /proc/$pid/fd/$fd is used and $pid is the same as the current > process's pid then it works now the same as /proc/self/fd/$fd has been > used > 2. The intercept code (see src/lib/libast/port/intercept.c) now > retries |open()| calls to /proc with a native |O_SEARCH| if the > previous attempt with |O_RDONLY| failed with |EACCES|. This fixes > issues when the /proc path is coming from a different process > > ---- > > Bye, > Roland > > -- > __ . . __ > (o.\ \/ /.o) [email protected] > \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer > /O /==\ O\ TEL +49 641 3992797 > (;O/ \/ \O;) _______________________________________________ ast-developers mailing list [email protected] http://lists.research.att.com/mailman/listinfo/ast-developers
