From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] find Security Considerations
Date: Tue, 10 Jul 2007 02:01:14 +0400
Message-ID: <20070709220114.GB1606@nomad.office.altlinux.org> (raw)
In-Reply-To: <46925EA8.4020402@altlinux.com>
[-- Attachment #1: Type: text/plain, Size: 1497 bytes --]
On Mon, Jul 09, 2007 at 08:13:28PM +0400, Anton Farygin wrote:
> Dmitry V. Levin wrote:
> > On Mon, Jul 09, 2007 at 01:20:34PM +0700, Slava Semushin wrote:
> >> 2007/7/9, Vitaly Kuznetsov <vitty / altlinux.org>:
> >> [...]
> >>> +rm -f `find %buildroot -type f -name perllocal.pod -o -name .packlist`
> >>> +find %buildroot -name API.bs -a -size 0 -exec rm -f {} \;
> >> Как-то нелогично. Почему бы и в первом случае не использовать find +
> >> exec? Или даже в обоиз случаях find -delete
> >
> > Это просто сборник ошибок:
> > - rm -f `find ...` это небезопасно в принципе, забудьте эту конструкцию
> > навсегда.
> > - find ... -exec rm -f {} \; это небезопасно в принципе, забудьте эту
> > конструкцию навсегда.
>
> Кстати, а что ты скажешь про конструкцию вида:
>
> find . -type f|while read line;do rm -f "$line";done
В этой конструкции много недостатков. Я не буду их перечислять, просто
рекомендую ознакомиться с соответствующей документацией,
$ info -f find security
Кстати, немного истории "find -delete":
Этот параметр ведёт свою историю с ноября 1997-го года, когда патч к
findutils-4.1 анонсировал в bugtraq'е Douglas Siebert:
http://marc.info/?l=bugtraq&m=87930069226479
Этот патч был адаптирован для Owl в сентябре 2000-го года,
у нас -- а апреле 2002-го года.
GNU findutils поддерживает параметр -delete с ноября 2004 года
(после того как GNU findutils обрёл нового мантейнера):
http://savannah.gnu.org/patch/index.php?3454
--
ldv
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2007-07-09 22:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-09 6:20 ` [devel] [git update] packages/perl-mozldap: heads/master Slava Semushin
2007-07-09 6:28 ` Vitaly Kuznetsov
2007-07-09 6:31 ` Slava Semushin
2007-07-09 7:02 ` Денис Смирнов
2007-07-09 8:40 ` [devel] rm `find` (was: [git update] packages/perl-mozldap: heads/master) Michael Shigorin
2007-07-09 9:45 ` [devel] [git update] packages/perl-mozldap: heads/master Dmitry V. Levin
2007-07-09 10:01 ` Slava Semushin
2007-07-09 16:15 ` Anton Farygin
2007-07-09 21:42 ` Dmitry V. Levin
2007-07-10 4:57 ` Anton Farygin
2007-07-10 5:01 ` Slava Semushin
2007-07-09 11:51 ` [devel] [wiki] devel/TypicalPackagingErrors/FindRm Michael Shigorin
2007-07-09 16:13 ` [devel] [git update] packages/perl-mozldap: heads/master Anton Farygin
2007-07-09 22:01 ` Dmitry V. Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070709220114.GB1606@nomad.office.altlinux.org \
--to=ldv@altlinux.org \
--cc=devel@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git