bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so.

2012-09-04 Thread Jim Meyering
Paul Eggert wrote: > On 09/03/2012 10:20 PM, Bernhard Voelker wrote: >> the question is what rm should remove: >> the symlink or the target? > > The convention in POSIX is that if a symlink is > followed by '/', it's dereferenced. So this does > appear to be a bug in coreutils 'rm'. > > I confirm

bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so.

2012-09-04 Thread Bernhard Voelker
On 09/04/2012 12:42 PM, Jim Meyering wrote: > I have mixed feelings, but am leaning towards the > Solaris 11/FreeBSD behavior. They must have fixed it for Solaris, here's an older one: $ uname -sr ; mkdir d; ln -s d s; /bin/rm -r s/; ls SunOS 5.9 d Have a nice day, Berny

bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so.

2012-09-04 Thread Jim Meyering
Paul Eggert wrote: > I was about to suggest the following, on GNU/Linux: > > # Don't do this unless you know what you're doing! > rm -fr /proc/self/cwd/ > > Except it doesn't work! Not even if I append '.': > > $ mkdir /tmp/victim > $ cd /tmp/victim > $ touch foo > $ rm -fr /proc/self

bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)

2012-09-04 Thread Torbjorn Granlund
The very old factoring code cut from an now obsolete version GMP does not pass proper arguments to the mpz_probab_prime_p function. It ask for 3 Miller-Rabin tests only, which is not sufficient. I am afraid the original poor code was wrritten by me, where this particular problem was introduced wi

bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so.

2012-09-04 Thread Bernhard Voelker
On 09/04/2012 02:55 PM, Jim Meyering wrote: > With the following patch, I see new behavior. > It's an improvement, but we're still not there: > > $ mkdir -p d/e/f; ln -s d s; rm -r s/ > rm: cannot remove 's/': Not a directory > [Exit 1] > $ find > . > ./s > ./d > > N

bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)

2012-09-04 Thread Jim Meyering
Torbjorn Granlund wrote: > The very old factoring code cut from an now obsolete version GMP does > not pass proper arguments to the mpz_probab_prime_p function. It ask > for 3 Miller-Rabin tests only, which is not sufficient. Hi Torbjorn Thank you for the patch and explanation. I've converted th

bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)

2012-09-04 Thread Bernhard Voelker
On 09/04/2012 04:46 PM, Jim Meyering wrote: > incvolving 3 or more prime factors.) When s = 2, we get the 3/4 factor. s/incvolving/involving/ Have a nice day, Berny

bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so.

2012-09-04 Thread Jim Meyering
Bernhard Voelker wrote: > On 09/04/2012 02:55 PM, Jim Meyering wrote: >> With the following patch, I see new behavior. >> It's an improvement, but we're still not there: >> >> $ mkdir -p d/e/f; ln -s d s; rm -r s/ >> rm: cannot remove 's/': Not a directory >> [Exit 1] >> $ find >>

bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)

2012-09-04 Thread Jim Meyering
Bernhard Voelker wrote: > On 09/04/2012 04:46 PM, Jim Meyering wrote: >> incvolving 3 or more prime factors.) When s = 2, we get the 3/4 factor. > > s/incvolving/involving/ Pádraig Brady wrote: > Miller-Rabin test, one would expect about 9008992/4^64 = 140766 to be s/4^64/64/ ? Fixed both. Than

bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)

2012-09-04 Thread Jim Meyering
Jim Meyering wrote: > Torbjorn Granlund wrote: >> The very old factoring code cut from an now obsolete version GMP does >> not pass proper arguments to the mpz_probab_prime_p function. It ask >> for 3 Miller-Rabin tests only, which is not sufficient. > > Hi Torbjorn > > Thank you for the patch an

bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)

2012-09-04 Thread Eric Blake
On 09/04/2012 10:42 AM, Jim Meyering wrote: > Jim Meyering wrote: > >> > Torbjorn Granlund wrote: > > Problem numbers are of the for N=pq, p,q prime and (p-1)/(q-1) = s, s/for/form/ -- Eric Blake ebl...@redhat.com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signat

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Linda A. Walsh
Jim Meyering wrote: These commands would evoke an invalid diagnostic: $ mkdir d && ln -s d s && env rm -r s/ rm: cannot remove 's': Too many levels of symbolic links remove.c was stripping trailing slashes from "s/" before passing the name to "rm". But a trailing slash may change the sem

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Eric Blake
On 09/04/2012 11:46 AM, Linda A. Walsh wrote: > POSIX is portability standard -- it should not > be regarded as a restrictive standard, unless not doing so would hinder > portability. In effect, they are disallowing OS's to make extensions > beyond > what they allow in the newer standards... That

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Paul Eggert
On 09/04/2012 10:46 AM, Linda A. Walsh wrote: > I would assert that the trailing "." shouldn't be stripped either. If we were designing anew, I'd be inclined to agree with you. But there are probably people expecting the standard behavior now, and there's an argument for not departing from the sta

bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so.

2012-09-04 Thread Eric Blake
On 09/03/2012 10:29 AM, Linda Walsh wrote: >> Coreutils has already implemented an exception for the root >> directory: --no-preserve-root (whatever this would be useful >> for except investigating what'd happen in a VM ...). > --- > And by doing so has violated posix, since it doesn't say that if

bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)

2012-09-04 Thread Torbjorn Granlund
Jim Meyering writes: Jim Meyering wrote: > Torbjorn Granlund wrote: >> The very old factoring code cut from an now obsolete version GMP does >> not pass proper arguments to the mpz_probab_prime_p function. It ask >> for 3 Miller-Rabin tests only, which is not sufficient. > > Hi

bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so.

2012-09-04 Thread Linda Walsh
Eric Blake wrote: POSIX does indeed say that, but it applies only when you use 'rm' in a standards-compliant invocation; the moment you add --no-preserve-root to your invocation, you are no longer using a standards-compliant invocation, so all bets are off as far as POSIX goes. -- Whic

bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)

2012-09-04 Thread Torbjorn Granlund
Pádraig Brady writes: On 09/04/2012 03:46 PM, Jim Meyering wrote: > There are 9008992 composites of the form with s=2 below 2^64. With 3 > Miller-Rabin test, one would expect about 9008992/4^64 = 140766 to be s/4^64/64/ ? For what it's worth I checked the million primes in the

bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)

2012-09-04 Thread Pádraig Brady
On 09/04/2012 07:10 PM, Torbjorn Granlund wrote: Pádraig Brady writes: On 09/04/2012 03:46 PM, Jim Meyering wrote: > There are 9008992 composites of the form with s=2 below 2^64. With 3 > Miller-Rabin test, one would expect about 9008992/4^64 = 140766 to be s/4^64/64/ ? For

bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)

2012-09-04 Thread Torbjorn Granlund
Pádraig Brady writes: Sure. I was just quantifying the performance change, for others who may be referencing or noticing patches. (Actually, I'd add a note to the commit message that, this increases calculations by about 25%). And surely mode for certain cases. We spend 25/3 or about 8

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Linda A. Walsh
Paul Eggert wrote: On 09/04/2012 10:46 AM, Linda A. Walsh wrote: I would assert that the trailing "." shouldn't be stripped either. If we were designing anew, I'd be inclined to agree with you. But there are probably people expecting the standard behavior now, i.e. expecting i

bug#12336: test bug

2012-09-04 Thread Bala Murugan
Hi Bob, thanks for u r reply. See i will explain u neatly. I am using bash shell. When I tried to do this i getting this.I am getting this error. [balamup2@cl-flor-dvvm026 ~]$ echo $SHELL */bin/bash* [balamup2@cl-flor-dvvm026 ~]$ ls *test1.txt test3.txt testdir test.txt* [balamup2@cl-flor-dvv

bug#12336: test bug

2012-09-04 Thread Bob Proulx
Please keep the mailing list in the reply. I have set Reply-To accordingly. Bala Murugan wrote: > I am using bash shell. When I tried to do this i getting this.I am getting > this error. > > [balamup2@cl-flor-dvvm026 ~]$ echo $SHELL > */bin/bash* I am sure that those '*' characters are not ther

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Paul Eggert
On 09/04/2012 04:21 PM, Linda A. Walsh wrote:> Paul Eggert wrote: > expecting it to do nothing useful other than issue an error? Sure. People might expect the utility to complain about what they consider to be obvious typos, rather than to remove files they don't expect to be removed. For examp

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Linda A. Walsh
Paul Eggert wrote: On 09/04/2012 04:21 PM, Linda A. Walsh wrote:> Paul Eggert wrote: expecting it to do nothing useful other than issue an error? Sure. People might expect the utility to complain about what they consider to be obvious typos, rather than to remove files they don't exp

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Paul Eggert
On 09/04/2012 06:55 PM, Linda A. Walsh wrote: > So how do delete all files in the directory without wild cards? Why tie your hands behind your back? Use wild cards: cd DIRECTORY && rm -fr * .[!.] .??* If you do this a lot, put it into a shell script. It's not like the need is all that commo

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Bernhard Voelker
On 09/05/2012 08:25 AM, Paul Eggert wrote: > On 09/04/2012 06:55 PM, Linda A. Walsh wrote: > >> So how do delete all files in the directory without wild cards? > > Why tie your hands behind your back? Use wild cards: > > cd DIRECTORY && rm -fr * .[!.] .??* > > If you do this a lot, put it i

bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)

2012-09-04 Thread Jim Meyering
Eric Blake wrote: > On 09/04/2012 10:42 AM, Jim Meyering wrote: >> Jim Meyering wrote: >> >>> > Torbjorn Granlund wrote: >> >> Problem numbers are of the for N=pq, p,q prime and (p-1)/(q-1) = s, > > s/for/form/ Fixed. Thanks.

bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)

2012-09-04 Thread Jim Meyering
Torbjorn Granlund wrote: > Jim Meyering writes: > > Jim Meyering wrote: > > > Torbjorn Granlund wrote: > >> The very old factoring code cut from an now obsolete version GMP does > >> not pass proper arguments to the mpz_probab_prime_p function. It ask > >> for 3 Miller-Rabin tests only,

bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir

2012-09-04 Thread Linda A. Walsh
Paul Eggert wrote: On 09/04/2012 06:55 PM, Linda A. Walsh wrote: So how do delete all files in the directory without wild cards? Why tie your hands behind your back? Use wild cards: cd DIRECTORY && rm -fr * .[!.] .??* If you do this a lot, put it into a shell script. It's not li