On Fri, 22 Dec 2006, patrick ~ wrote:

> Hi Otto,
> 
> It is very late here, but thanks for your hint
> about NAME_MAX.
> 
> I've been looking at the systrace sources trying
> to figure out how it works and if there would be
> any obvious path len issues that would pop-out.
> I couldn't find any.
> 
> I took your suggestion to try and find a simple(er)
> test-case.  I created a directory with a very long
> name where 'pwd | wc -c' returned 301.  I placed a
> patch.c file in there with a patch.c.diff file in
> /tmp and run similar command to what is run in the
> ports patch:
> 
>   $ cd /tmp
>   $ /bin/systrace -e -i -a -f $longdirname/my.policy \
>       /usr/bin/patch -z .bak.orig -d $longdirname -E -p0 \
>       < patch.c.diff
> 
> I encounter the same problem I had reported.
> 
> The patch succeeds without the systrace.

The problem reduces too the rename(2) system call.

create a deep path:

$ mkdir $(jot -s '' -b d 200)
$ cd d*
$ mkdir $(jot -s '' -b d 100)
$ cd  d*
$ touch foo
$ systrace -At mv foo bar
: $ [this is an incomplete  error message]
$ systrace -A mv foo bar
mv: rename foo to bar: Invalid argument

If you look with ktrace -i you'll see mv and systrace interacting.
Dunno yet where things go wrong, though.

        -Otto


Reply via email to