Debian Bug report logs -
#317019
findutils: find and "rm -i" does not work like as previous releases.
Toggle useless messages
Report forwarded to debian-bugs-dist@lists.debian.org, Andreas Metzler <ametzler@debian.org>:
Bug#317019; Package findutils.
(full text, mbox, link).
Acknowledgement sent to "Matias Rollan" <cygar@safesource.com.ar>:
New Bug report received and forwarded. Copy sent to Andreas Metzler <ametzler@debian.org>.
(full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: findutils
Version: 4.2.22-1
Severity: normal
With 4.1.20-6:
$ find . -type f -exec rm -i {} \;
rm: remove regular file «./httpd.conf»? y
Until here everything works ok.
With 4.2.22-1:
$ find -type f -exec rm -i {} \;
rm: remove regular file `./Muttrc'? rm: remove regular file
`./adduser.conf'? rm: remove regular file `./adjtime'? rm: remove
regular file `./aliases'? rm: remove regular file `./aliases.O'?
[ it doesn't ask me to remove it or not... just brings me the output of
the whole file find without asking me one by one as under previous
versions of findutils. ]
The same way using "xargs".
$ find -type f |xargs -i rm -i {}
rm: remove regular file `./Muttrc'? rm: remove regular file
`./adduser.conf'?
which also works under previous releases.
This only happens when I use "-i" [interactive] of rm.
I think it is not a problem of "rm" since "bash" this has happened to me
when I upgraded findutils and not "bash" package.
-- System Information:
Debian Release: 3.1
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.3-1-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages findutils depends on:
ii libc6 2.3.2.ds1-22 GNU C Library: Shared
libraries an
-- no debconf information
Message sent on to "Matias Rollan" <cygar@safesource.com.ar>:
Bug#317019.
(full text, mbox, link).
Message #8 received at 317019-submitter@bugs.debian.org (full text, mbox, reply):
URL:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=13650>
Summary: find -exec rm -i {} \; broken since 4.2.12
Project: findutils
Submitted by: ametzler
Submitted on: Mit 06.07.2005 um 08:40
Category: find
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: None
Fixed Release: None
_______________________________________________________
Details:
Starting with version 4.2.12 (i.e. 4.2.11 works) invoking interactive commands
from -exec is broken, it looks like stdin is connected to /dev/null.
Simple testcase:
touch a b
find -maxdepth 1 \( -name a -or -name b \) -exec rm -i {} \;
This was found by Matias Rollan in http://bugs.debian.org/317019
thanks, cu andreas
_______________________________________________________
Carbon-Copy List:
CC Address | Comment
------------------------------------+-----------------------------
317019-submitter@bugs.debian.org |
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=13650>
_______________________________________________
Nachricht geschickt von/durch Savannah
http://savannah.gnu.org/
Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#317019; Package findutils.
(full text, mbox, link).
Acknowledgement sent to Andreas Metzler <ametzler@debian.org>:
Extra info received and forwarded to list.
(full text, mbox, link).
Message #13 received at 317019@bugs.debian.org (full text, mbox, reply):
tags 317019 confirmed
severity 317019 important
forwarded 317019 http://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=13650
thanks
On 2005-07-05 Matias Rollan <cygar@safesource.com.ar> wrote:
> Package: findutils
> Version: 4.2.22-1
> Severity: normal
> With 4.1.20-6:
> $ find . -type f -exec rm -i {} \;
> rm: remove regular file «./httpd.conf»? y
> Until here everything works ok.
> With 4.2.22-1:
> $ find -type f -exec rm -i {} \;
> rm: remove regular file `./Muttrc'? rm: remove regular file
> `./adduser.conf'? rm: remove regular file `./adjtime'? rm: remove
> regular file `./aliases'? rm: remove regular file `./aliases.O'?
[...]
Hello,
thank you for the nice bug-report, I've confirmed it and forwarded the
report to the upstream author.
> The same way using "xargs".
> $ find -type f |xargs -i rm -i {}
> rm: remove regular file `./Muttrc'? rm: remove regular file
> `./adduser.conf'?
> which also works under previous releases.
[...]
No, xargs is different, and has not worked that way previously.
ametzler@downhill:find$ xargs --version
GNU xargs version 4.1.20
ametzler@downhill:find$ printf 'fstype.o\nparser.o\n' | xargs -i rm -i {}
rm: remove regular file `fstype.o'? rm: remove regular file `parser.o'? ametzler@downhill:find$
ametzler@downhill:find$ printf 'fstype.o\nparser.o\n' | xargs rm -i
rm: remove regular file `fstype.o'? rm: remove regular file `parser.o'? ametzler@downhill:find$
You could use "xargs -p rm", though.
cu andreas
--
"See, I told you they'd listen to Reason," [SPOILER] Svfurlr fnlf,
fuhggvat qbja gur juveyvat tha.
Neal Stephenson in "Snow Crash"
http://downhill.aus.cc/
Tags added: confirmed
Request was from Andreas Metzler <ametzler@debian.org>
to control@bugs.debian.org.
(full text, mbox, link).
Severity set to `important'.
Request was from Andreas Metzler <ametzler@debian.org>
to control@bugs.debian.org.
(full text, mbox, link).
Message sent on to "Matias Rollan" <cygar@safesource.com.ar>:
Bug#317019.
(full text, mbox, link).
Message #22 received at 317019-submitter@bugs.debian.org (full text, mbox, reply):
Update of bug #13650 (project findutils):
Item Group: None => Wrong result
Assigned to: None => jay
Release: None => 4.2.12
_______________________________________________________
Follow-up Comment #1:
Alternative test case:
touch a b
find a b -maxdepth 0 -exec rm -i {} \;
echo
ls -l a b
rm a b
The problem was introduced when find was refactored to use the same
command-builder as xargs. The xargs command needs this behaviour, but find
does not.
I have applied the attached patch, which I think should solve the problem.
_______________________________________________________
Additional Item Attachment:
File name: savannah-bug-13650-proposal.patch Size:3 KB
Proposed patch (1)
<http://savannah.gnu.org/bugs/download.php?item_id=13650&item_file_id=2661>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=13650>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Message sent on to "Matias Rollan" <cygar@safesource.com.ar>:
Bug#317019.
(full text, mbox, link).
Message #25 received at 317019-submitter@bugs.debian.org (full text, mbox, reply):
Follow-up Comment #2, bug #13650 (project findutils):
The initial patch also allows programs run via -ok to sleal the input stat
"ok" wanted to read, so this modicied patch behaves differently for -ok and
-okdir.
_______________________________________________________
Additional Item Attachment:
File name: savannah-bug-13650-proposal2.patch Size:4 KB
Second proposed patch
<http://savannah.gnu.org/bugs/download.php?item_id=13650&item_file_id=2662>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=13650>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Message sent on to "Matias Rollan" <cygar@safesource.com.ar>:
Bug#317019.
(full text, mbox, link).
Message #28 received at 317019-submitter@bugs.debian.org (full text, mbox, reply):
Follow-up Comment #3, bug #13650 (project findutils):
Consider this example:
find a b c -mtime 2 -ok prog1 {} \; -o -exec prog2 {} \;
With the (now) current code, prog2 will be able to read from stdin byt prog1
wil not. Is this really sensible?
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=13650>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Message sent on to "Matias Rollan" <cygar@safesource.com.ar>:
Bug#317019.
(full text, mbox, link).
Message #31 received at 317019-submitter@bugs.debian.org (full text, mbox, reply):
Update of bug #13650 (project findutils):
Status: None => Need Info
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=13650>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Message sent on to "Matias Rollan" <cygar@safesource.com.ar>:
Bug#317019.
(full text, mbox, link).
Message #34 received at 317019-submitter@bugs.debian.org (full text, mbox, reply):
Follow-up Comment #4, bug #13650 (project findutils):
James Youngman wrote
> find a b c -mtime 2 -ok prog1 {} \; -o -exec prog2 {} \;
>
> With the (now) current code, prog2 will be able to read from
> stdin but prog1 will not. Is this really sensible?
Well, it sure would be nicer if -ok and "-exec rm -i {} \;" worked together,
i.e. first find asks and if that is succesful rm can access stdin.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=13650>
_______________________________________________
Nachricht geschickt von/durch Savannah
http://savannah.gnu.org/
Message sent on to "Matias Rollan" <cygar@safesource.com.ar>:
Bug#317019.
(full text, mbox, link).
Message #37 received at 317019-submitter@bugs.debian.org (full text, mbox, reply):
Follow-up Comment #5, bug #13650 (project findutils):
One potential problem here is that if a prepared file is being fed to find on
stdin, the command executed by -ok can steal its input. That's why the
current findutils code runs programs for "-ok" with stdin redicrected from
/dev/nul, but still runs programs for "-exec" with stdin unchanged.
In the example you give I assume you're changing the -o in the example to
-a:
find a b c -mtime 2 -ok prog1 {} \; -a -exec rm -i {} \;
That is, if "prog1" returns 0, rm -i will be called on the file currently
being considered. That will work with the (now) current development code. If
that's what you're asking for, no problem, that's what we have right now. Or
are you asking for something else?
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=13650>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Message sent on to "Matias Rollan" <cygar@safesource.com.ar>:
Bug#317019.
(full text, mbox, link).
Message #40 received at 317019-submitter@bugs.debian.org (full text, mbox, reply):
Follow-up Comment #6, bug #13650 (project findutils):
Hello,
sorry my incoherent mail.
I was actually thinking about (the useless example)
find ... -ok rm -i {} \;
which I'd expect to ask twice: first find asks, and if that succeeded would
pass on stdin/out to rm which ask again.
cu andreas
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=13650>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Message sent on to "Matias Rollan" <cygar@safesource.com.ar>:
Bug#317019.
(full text, mbox, link).
Message #43 received at 317019-submitter@bugs.debian.org (full text, mbox, reply):
Follow-up Comment #7, bug #13650 (project findutils):
i understand, but that's not how -ok works. OK is like -exec, it doesn;t just
ask it actually runs the command. Hence the nearest thing to what you're
talking about that would actually work is
find ... -ok true {} \; -a -exec rm -i {} \;
As you point out, this would ask twice. Given the current code, the "true"
command would not be able to read from stdin, but doesn;t try, while the "rm
-i" command would be able to read from stdin. So, what you wanted already
works.
If you were doing this for real though, this is probably better, but only asks
once:
find ... -ok rm {} \;
This is neater, but asks only once, since "rm" would not be able to read from
stdin.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=13650>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Message sent on to "Matias Rollan" <cygar@safesource.com.ar>:
Bug#317019.
(full text, mbox, link).
Message #46 received at 317019-submitter@bugs.debian.org (full text, mbox, reply):
Follow-up Comment #8, bug #13650 (project findutils):
Jay wrote:
> I understand but that is not how -ok works
Yes I realized that. :-) Is it going to change or is it to difficult? (I am
sure somebody could come up with a sensible usage of -ok <interactive
program>)
If changing is out of question (for whatever reason, be it difficult or you
thinking "stupid idea") could you apply attached patch to the documentation?
thanks, cu andreas
_______________________________________________________
Additional Item Attachment:
File name: patchdocs.diff Size:1 KB
document stdin redirection from /dev/null for find -ok(dir)
<http://savannah.gnu.org/bugs/download.php?item_id=13650&item_file_id=2694>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=13650>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Message sent on to "Matias Rollan" <cygar@safesource.com.ar>:
Bug#317019.
(full text, mbox, link).
Message #49 received at 317019-submitter@bugs.debian.org (full text, mbox, reply):
Follow-up Comment #9, bug #13650 (project findutils):
Changing it certainly is not out of the question, but I am trying to bear in
mind the bug report at bug #3992.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=13650>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Message sent on to "Matias Rollan" <cygar@safesource.com.ar>:
Bug#317019.
(full text, mbox, link).
Message #52 received at 317019-submitter@bugs.debian.org (full text, mbox, reply):
Update of bug #13650 (project findutils):
Status: Need Info => Fixed
Open/Closed: Open => Closed
Fixed Release: None => 4.2.24
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=13650>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Reply sent to Andreas Metzler <ametzler@debian.org>:
You have taken responsibility.
(full text, mbox, link).
Notification sent to "Matias Rollan" <cygar@safesource.com.ar>:
Bug acknowledged by developer.
(full text, mbox, link).
Message #57 received at 317019-close@bugs.debian.org (full text, mbox, reply):
Source: findutils
Source-Version: 4.2.24-1
We believe that the bug you reported is fixed in the latest version of
findutils, which is due to be installed in the Debian FTP archive:
findutils_4.2.24-1.diff.gz
to pool/main/f/findutils/findutils_4.2.24-1.diff.gz
findutils_4.2.24-1.dsc
to pool/main/f/findutils/findutils_4.2.24-1.dsc
findutils_4.2.24-1_i386.deb
to pool/main/f/findutils/findutils_4.2.24-1_i386.deb
findutils_4.2.24.orig.tar.gz
to pool/main/f/findutils/findutils_4.2.24.orig.tar.gz
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 317019@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Andreas Metzler <ametzler@debian.org> (supplier of updated findutils package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.7
Date: Sat, 30 Jul 2005 09:14:35 +0200
Source: findutils
Binary: findutils
Architecture: source i386
Version: 4.2.24-1
Distribution: unstable
Urgency: low
Maintainer: Andreas Metzler <ametzler@debian.org>
Changed-By: Andreas Metzler <ametzler@debian.org>
Description:
findutils - utilities for finding files--find, xargs, and locate
Closes: 317019 317086 318417 319085 320378
Changes:
findutils (4.2.24-1) unstable; urgency=low
.
* standards-version 3.6.2, no changes required.
* New upstream version 4.2.24:
- "-printf %Y %y"n works correctly again (Closes: #320378).
- new option -regextype to finds for selecting more useful regex-variants
than the default GNU Emacs.
- find -exec rm -i {} \; works again. (Closes: #317019)
- xargs exits with correct exit status 123 if invoked command returned
non-zero returncode. (Closes: #319085)
- xargs -I option documented in manpage. (Closes: #317086)
- fixes to find.1 manpage (Closes: #318417)
Files:
a3328d1a5043dc1d2088161a73da8ae3 663 base required findutils_4.2.24-1.dsc
f551df975740eb01ba315e33be836454 1007589 base required findutils_4.2.24.orig.tar.gz
d5eaf1eef3a2b98aae43fe812cc4ce29 12221 base required findutils_4.2.24-1.diff.gz
44491460bd72299539dbe4c5cf0521a2 373062 base required findutils_4.2.24-1_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFC6z7YHTOcZYuNdmMRAhdFAKCCJGlv40HmNrszF0u/atfJBLVvCwCcD1Fk
TrPvQwhfh/3Lf87Bs/ZJMks=
=pb/t
-----END PGP SIGNATURE-----
Tags added: fixed-upstream
Request was from bts-link-upstream@lists.alioth.debian.org
to control@bugs.debian.org.
(full text, mbox, link).
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Sun, 24 Jun 2007 19:10:43 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Sat Dec 23 16:43:59 2023;
Machine Name:
bembo
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.