Re: Making DO_POSIX_CP configurable

2007-09-12 Thread Alexander Kriegisch
Denys Vlasenko: > It *is* default behaviour. Completely unmodified current svn does this: > ... > See? It didn't unlink /dev/tty. It opened it and wrote Makefile.help's > contents to it. > ... > As I understand it, the change you requested is already done. > > If I misunderstand you, please clarif

Re: Making DO_POSIX_CP configurable

2007-09-12 Thread Denys Vlasenko
On Wednesday 12 September 2007 13:40, Alexander Kriegisch wrote: > I know, but it is not default behaviour, i.e. without manually changing > the POSIX switch in the source code it will still unlink devices and > recreate them as files. We seem to have a communication problem here. It *is* default

Re: Making DO_POSIX_CP configurable

2007-09-12 Thread Alexander Kriegisch
I know, but it is not default behaviour, i.e. without manually changing the POSIX switch in the source code it will still unlink devices and recreate them as files. This affects all users negatively, independent of their wish to be POSIX-compliant. My tendency is to call this a bug, not some option

Re: Making DO_POSIX_CP configurable

2007-09-12 Thread Denys Vlasenko
On Tuesday 11 September 2007 23:13, Alexander Kriegisch wrote: > I am sending this answer to the list again, because it was my initial > mistake that I sent the first copy of my last message to your address > instead of to the list. > > Sorry, Denys, I was never talking about the scenario you are

Re: Making DO_POSIX_CP configurable

2007-09-11 Thread Alexander Kriegisch
I am sending this answer to the list again, because it was my initial mistake that I sent the first copy of my last message to your address instead of to the list. Sorry, Denys, I was never talking about the scenario you are mentioning, really just about overwriting an existing character device by

Re: Making DO_POSIX_CP configurable

2007-09-11 Thread Denys Vlasenko
On Tuesday 11 September 2007 17:32, Ralf Friedl wrote: > > User comes to you and says "I accidentally deleted my most important > > directory. I know that you make daily backups. Can you restore > > it from backup?" > > > > You do > > > > cp -a /backup/home/user/dir /home/user > > > > But user has

Re: Making DO_POSIX_CP configurable

2007-09-11 Thread Alexander Kriegisch
> I'm not sure there are users which really need > "cp -r dir1 dir2" to follow pre-existing dir2/dir1/xxx > symlinks. I am not, either. I just need regular files overwriting devices by not unlinking them first (resulting in them being gone and recreated in a wrong fashion), because it is what can

Making DO_POSIX_CP configurable

2007-09-11 Thread Ralf Friedl
> User comes to you and says "I accidentally deleted my most important > directory. I know that you make daily backups. Can you restore > it from backup?" > > You do > > cp -a /backup/home/user/dir /home/user > > But user has crafted it so that backup contains > dir/many_more_dirs/innocuous_file,

Re: Making DO_POSIX_CP configurable

2007-09-11 Thread Denys Vlasenko
On Tuesday 11 September 2007 12:34, Alexander Kriegisch wrote: > Hi Denys! > > Thanks for introducing a special case for block/character devices. :) In > a way, you did more than I requested, in another you did not, because > DO_POSIX_CP still is not configurable the way I thought it was obviously

Re: Making DO_POSIX_CP configurable

2007-09-11 Thread Denys Vlasenko
On Tuesday 11 September 2007 14:53, Ralf Friedl wrote: > Hi Denys > > Can you point to real security problems from the use of cp with POSIX > semantics? User comes to you and says "I accidentally deleted my most important directory. I know that you make daily backups. Can you restore it from bac

Making DO_POSIX_CP configurable

2007-09-11 Thread Ralf Friedl
Hi Denys Can you point to real security problems from the use of cp with POSIX semantics? I know, the target of the copy operation could be a symbolic link to some other file that would be overwritten. This would require the attacker to have write permissions to the target directory and would

Re: Making DO_POSIX_CP configurable

2007-09-11 Thread Alexander Kriegisch
Hi Denys! Thanks for introducing a special case for block/character devices. :) In a way, you did more than I requested, in another you did not, because DO_POSIX_CP still is not configurable the way I thought it was obviously inquired by me. But as so often, questions need to be asked more precise

Re: Making DO_POSIX_CP configurable

2007-09-11 Thread Denys Vlasenko
On Tuesday 11 September 2007 00:19, Alexander Kriegisch wrote: > In SVN rev. #18119 [1] the default behaviour of 'cp' was changed by > Denis in order to improve security and also to save a few bytes. This > leads to problems in our application scenario here: We work on a > mipsel-based router platf

Making DO_POSIX_CP configurable

2007-09-10 Thread Alexander Kriegisch
In SVN rev. #18119 [1] the default behaviour of 'cp' was changed by Denis in order to improve security and also to save a few bytes. This leads to problems in our application scenario here: We work on a mipsel-based router platform equipped with a TFFS (tiny flash filesystem) showing several "files