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

Denis Vlasenko vda.linux at googlemail.com
Sun Jul 9 18:05:48 UTC 2006


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox_login.patch
Type: text/x-diff
Size: 1305 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060709/cefbc3a3/attachment.bin 


More information about the busybox mailing list