lkml.org 
[lkml]   [1998]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Can I open a special file with major/minor instead of name?

Unfortuanatly, being able to do this would be a security problem.. Since
as a Unix clone, we store device permissions as permisions to a device
file.

On Sun, 14 Jun 1998, Dave Cinege wrote:

> This is the code in do_linuxrc():
>
> (void) open("/dev/tty1",O_RDWR,0);
>
> This is what I want to do:
>
> (void) open( MKDEV(TTY_MAJOR,1) ,O_RDWR,0);
>
> This is why:
> I build all of /dev from /linuxrc, thus /dev/tty1 does not yet exist.
> Right now I have a work around but this way would be cleaner.
>
>
> static int do_linuxrc(void * shell)
> {
> static char *argv[] = { "linuxrc", NULL, };
>
> close(0);close(1);close(2);
> setsid();
> (void) open("/dev/tty1",O_RDWR,0);
> (void) dup(0);
> (void) dup(0);
> return execve(shell, argv, envp_init);
> }
>
>
> --
> http://www.psychosis.com/emc/ Elite MicroComputers 732-541-4214
> http://www.psychosis.com/linux-router/ Linux Router Project
>
> SIC SEMPER SPAMMER!!
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
>


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.069 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site