From: khm@sciops.net (Kurt H Maier)
Subject: [TUHS] There is turmoil in Linux-land - When did rm first avoid going upwards?
Date: Mon, 24 Apr 2017 17:18:29 -0700 [thread overview]
Message-ID: <20170425001829.GC27654@wopr> (raw)
In-Reply-To: <05b101d2bd57$cb86f6f0$6294e4d0$@ronnatalie.com>
On Mon, Apr 24, 2017 at 08:06:28PM -0400, Ron Natalie wrote:
>
>
> > rm in V6 outsources globbing to /etc/glob, which appears to report
> > no-match if the first character is .
>
> Actually, it's the shell that calls glob. Glob then invokes the command
> (in this case rm).
>
> Anyhow, that doesn't do what you think it does. It ignores directory
> entries that begin with '.' if the search string doesn't begin with ..
>
> ".*" will indeed match ".."
>
> Of course, the calamity depends on whether you have /tmp on it's own
> filesystem. V6 didn't go .. off the top of the filesystem, the root ..
> just linked back to the inode 1 (the root itself).
>
>
Thanks for correcting my hasty conclusions. /usr/source/s2/rm.c has an
execl call in the rm() function, but I didn't dig further into the
calling mechanism.
V7's /usr/src/cmd/rm.c definitely explicitly has a check for '..' and
an error message dedicated to the task.
So I think we can conclude that unix got this protection sometime
between V6 and V7 -- in other words, sometime in the late 1970s.
And systemd is now catching up. "Those who do not study unix" etc
khm
next prev parent reply other threads:[~2017-04-25 0:18 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 22:06 Noel Chiappa
2017-04-24 22:18 ` Josh Good
2017-04-24 23:23 ` Kurt H Maier
2017-04-24 23:59 ` [TUHS] was turmoil, moving to rm -rf / Larry McVoy
2017-04-25 0:44 ` Dan Cross
2017-04-25 14:02 ` Clem Cole
2017-04-25 14:08 ` Larry McVoy
2017-04-25 14:12 ` Álvaro Jurado
2017-04-25 14:29 ` arnold
2017-04-25 14:31 ` Álvaro Jurado
2017-04-25 16:28 ` Pete Turnbull
2017-04-27 23:44 ` Steve Johnson
2017-04-27 23:54 ` Ron Natalie
2017-04-28 3:04 ` Toby Thain
2017-04-28 5:19 ` arnold
[not found] ` <mailman.198.1493337336.3780.tuhs@minnie.tuhs.org>
2017-04-28 14:48 ` John Floren
2017-04-25 14:18 ` Clem Cole
2017-04-25 15:28 ` Dan Cross
2017-04-25 17:56 ` Bakul Shah
2017-04-25 14:19 ` Corey Lindsly
2017-04-25 0:06 ` [TUHS] There is turmoil in Linux-land - When did rm first avoid going upwards? Ron Natalie
2017-04-25 0:18 ` Kurt H Maier [this message]
2017-04-25 0:22 ` ron minnich
2017-04-25 0:24 ` Kurt H Maier
2017-04-25 0:26 ` ron minnich
-- strict thread matches above, loose matches on Subject: below --
2017-04-25 1:34 Noel Chiappa
2017-04-25 0:59 Noel Chiappa
2017-04-24 21:42 Josh Good
2017-04-24 21:48 ` Alec Muffett
2017-04-24 21:59 ` Arthur Krewat
2017-04-24 22:10 ` Kurt H Maier
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=20170425001829.GC27654@wopr \
--to=khm@sciops.net \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).