Low-severity bug in cp

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Low-severity bug in cp

Adam Gleave-2
cp returns incorrect error message in some circumstances.

Always reproducible.

Steps to reproduce:

umask 077
cd /tmp
mkdir foo
cd foo
touch bar
sudo -u convenient_non_root_account -i
cd /tmp
mkdir oof
cd oof
cp -R ../foo .

On all systems I've tested it on, it returns "File Exists" rather
than, of course, what it should be. From a quick look in gdb, I think
it's due to mkdir being called on the same directory twice.

Reply | Threaded
Open this post in threaded view
|

Re: Low-severity bug in cp

Otto Moerbeek
On Sat, 27 May 2006, Adam Gleave wrote:

> cp returns incorrect error message in some circumstances.
>
> Always reproducible.
>
> Steps to reproduce:
>
> umask 077
> cd /tmp
> mkdir foo
> cd foo
> touch bar
> sudo -u convenient_non_root_account -i
> cd /tmp
> mkdir oof
> cd oof
> cp -R ../foo .
>
> On all systems I've tested it on, it returns "File Exists" rather
> than, of course, what it should be. From a quick look in gdb, I think
> it's due to mkdir being called on the same directory twice.

Please include the version of OpenBSD you are using when reporting a
bug. I think this is fixed in rev 1.30 of cp.c. This fix is included
in OpenBSD 3.9.

        -Otto

Reply | Threaded
Open this post in threaded view
|

Re: Low-severity bug in cp

Adam Gleave-2
>  I think this is fixed in rev 1.30 of cp.c.

Yes, it is. Sorry for wasting your time.