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

Denis Vlasenko vda.linux at googlemail.com
Mon Jul 17 14:15:41 UTC 2006


(Now that we have utoa, I can use it in the patch :) ).

Hi Rob, folks,

I need this patch in order to allow my non-root users
to be able to use Midnight Commander on Linux console.

This patch makes login check for LOGIN_PRE_SUID_SCRIPT
environment variable and if it is set, to start the
script just prior to setuid/setgid.

My script is:

#!/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 directly adding Linux-specific
/dev/vcs[a] support into the login itself.

Please apply.
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox_login_v2.patch
Type: text/x-diff
Size: 1301 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060717/e7bc88a9/attachment.bin 


More information about the busybox mailing list