[PATCH] Allow per-user setup script be run by login

Jason Schoon floydpink at gmail.com
Sun Jul 9 22:36:19 UTC 2006


On 7/9/06, Denis Vlasenko <vda.linux at googlemail.com> wrote:
>
> On Saturday 08 July 2006 22:04, Denis Vlasenko wrote:
> > Hi people,
> >
> > I'm using busybox login. When I log in as non-root,
> > I can use /dev/ttyNN device I am logged on (of course),
> > but cannot use /dev/vcs[a]NN devices which hold screen
> > buffer data. I need to be able to do it.
> > util-linux's login chown+chmod's those devices for me.
> >
> > Is there any solution for busybox login?
>
> Okay, maybe this patch will be deemed insufficiently ugly
> to reject. (/me crosses fingers...)
>
> With this patch I can point LOGIN_PRE_SUID_SCRIPT to
> the script like this:
>
> #!/bin/sh
> ttyname=`ttyname`
> ttybase=`echo "$ttyname" | sed 's/[0-9]*$//'`
> ttytail=${ttyname:${#ttybase}}
> if test "$ttybase" = "/dev/tty"; then
>     chown "$LOGIN_USER": "/dev/vcs$ttytail" "/dev/vcsa$ttytail"
>     chmod 0600 "/dev/vcs$ttytail" "/dev/vcsa$ttytail"
> fi
>
> This will achieve what I want, and is generic enough
> when compared to adding /dev/vcs[a] support into the login itself.
> --
> vda


I'm a bit confused, and not near the code right now.  Is this something that
happens before you would have a chance to call something like a .profile for
the user to fix this up?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20060709/f05c4098/attachment.htm 


More information about the busybox mailing list