[lkml]   [2009]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [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)


 \ /
  Last update: 2009-10-18 23:28    [W:0.105 / U:43.456 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site