🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1654

Re: Beware xargs security holes

#1654
From: John R. MacMillan
Date: Mon, 29 Oct 1990 00:04
21 lines
1336 bytes
|>
|>find / -name '#*' -print | xargs patok '.*/#[^/]*' rm -f --
|>
|>where patok elimnates arguments that don't match the pattern.
|>[patok] shouldn't be too hard to write.
|
|find / -name '#*' -print | egrep -v '.*/#[^/]*' | xargs rm -f --

Of course by the time I'd realized this, Blair had already pointed it
out.  It's so much more painless when you catch your own mistakes.

Speaking of which, you probably don't want the -v to egrep unless you
want to remove only the files the nasty guy wanted you to, and the
pattern should probably have been '/#[^/]*$'.

So now that we can all safely and automatically remove files I think
we should kill this thread before I embarass myself further.
-- 
John R. MacMillan       | I'm in love with a McDonald's girl
SCO Canada, Inc.        | She's an angel in a polyester uniform.
john@sco.COM            |      -- barenaked ladies
Technical Details
Message-ID: <john.657158675@troch>
Path: arc1-ca.pugleaf.net!utzoo!attcan!ncrcan!scocan!troch!john
References: <1890@necisa.ho.necisa.oz> <1990Oct24.0100 <john.656921455@troch> <649@inews.intel.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!ncrcan!scocan!troch!john
From: john@sco.COM (John R. MacMillan)
Newsgroups: comp.unix.shell
Subject: Re: Beware xargs security holes
Message-ID: <john.657158675@troch>
Date: 29 Oct 90 00:04:35 GMT
References: <1890@necisa.ho.necisa.oz> <1990Oct24.0100 <john.656921455@troch> <649@inews.intel.com>
Sender: news@sco.com (News administration)
Organization: SCO Canada, Inc. (formerly HCR Corporation)
Lines: 21