[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.01.0909181407370.4950@localhost.localdomain>
Date: Fri, 18 Sep 2009 14:09:22 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
cc: Kay Sievers <kay.sievers@...y.org>, Ingo Molnar <mingo@...e.hu>,
Greg KH <greg@...ah.com>, linux-kernel@...r.kernel.org
Subject: Re: [bug] /etc/profile: line 30: /dev/null: Permission denied
On Fri, 18 Sep 2009, Eric W. Biederman wrote:
>
> As a special case you can implement this much
> more simply in devtmpfs_mount just do:
>
> int devtmpfs_mount(const char *mountpoint)
> {
> sys_mount("none", "dev", "devtmpfs", MS_SILENT, NULL);
> sys_chmod("dev/console", 0666);
> sys_chmod("dev/tty", 0666);
> sys_chmod("dev/null", 0666);
> sys_chmod("dev/zero", 0666);
> }
Yeah, I think that's the way to go.
But add some error checking for sys_mount(), so that the code in question
would _never_ try to do a chmod() on some unrelated /dev/ entries.
(Ok, so the mount isn't supposed to fail, but still - conceptually that's
a really important error to check for)
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists