aboutsummaryrefslogtreecommitdiff
path: root/shell/cttyhack.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* regularize format of source file headers, no code changesDenys Vlasenko2017-09-181-6/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* make 17 state-changing execing applets (ex: "nice PROG ARGS") noexecDenys Vlasenko2017-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | The applets with "<applet> [opts] PROG ARGS" API very quickly exec another program, noexec is okay for them: chpst/envdir/envuidgid/softlimit/setuidgid chroot chrt ionice nice nohup setarch/linux32/linux64 taskset cttyhack "reset" and "sulogin" applets don't have this form, but also exec another program at once, thus made noexec too. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* config: deindent all help textsDenys Vlasenko2017-07-211-27/+27
| | | | | | Those two spaces after tab have no effect, and always a nuisance when editing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Update menuconfig items with approximate applet sizesDenys Vlasenko2017-07-181-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cttyhack: handle multiple consoles found in sysfsAaro Koskinen2012-02-041-3/+10
| | | | | | | | | | | | If multiple consoles are found from the sysfs file, cttyhack fails: cttyhack: can't open '/dev/tty0 ttyS0': No such file or directory In such cases take the last one as the kernel will use that one for /dev/console. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cttyhack: move /sys/class/tty/console/active check to the frontDenys Vlasenko2011-10-311-13/+18
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cttyhack: print detected ctty name when called without parametersAlexander Shishkin2011-10-311-34/+42
| | | | | | | | | | | | | Sometimes there's a need to figure out the controlling tty from a shell script, for example, to obtain a line for getty. In this case it's easier to call cttyhack than trying to repeat some of the cttyhack's logic. function old new delta cttyhack_main 283 327 +44 packed_usage 28911 28915 +4 Signed-off-by: Alexander Shishkin <virtuoso@slind.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cttyhack: trivial spelling/spacing fixesKevin Cernekee2011-08-161-1/+1
| | | | | Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cttyhack: remove the trailing newline when reading console name from sysfsKevin Cernekee2011-08-161-3/+5
| | | | | Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cttyhack: fail gracefully if the device node is missingKevin Cernekee2011-07-131-1/+3
| | | | | Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cttyhack: check sysfs for the name of the active consoleKevin Cernekee2011-07-131-31/+48
| | | | | Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mass removal of underscores from _BB_DIR_foo and _BB_SUID_fooDenys Vlasenko2011-01-181-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: make GNU licensing statement forms more regularDenys Vlasenko2010-08-161-2/+2
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cttyhack: make it survive WERROR buildDenys Vlasenko2010-07-301-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cttyhack: serial console detection is Linux-specificJeremie Koenig2010-07-301-3/+12
| | | | | Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mark Linux-specific configuration optionsJeremie Koenig2010-07-191-0/+1
| | | | | | | | PLATFORM_LINUX is used as a dependency for applets or features which require Linux-specific interfaces. Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cttyhack: move build system bits into cttyhack.c, no code changesDenys Vlasenko2010-07-161-0/+52
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: introduce and use BB_EXECVP_or_die()Pascal Bellard2010-07-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta BB_EXECVP_or_die - 47 +47 time_main 1042 1043 +1 chrt_main 371 364 -7 ionice_main 292 282 -10 setsid_main 69 56 -13 nohup_main 236 223 -13 cttyhack_main 266 253 -13 chroot_main 94 81 -13 chpst_main 746 733 -13 timeout_main 297 279 -18 taskset_main 541 522 -19 vfork_child 67 45 -22 parse 975 953 -22 lpd_main 770 748 -22 launch_helper 192 170 -22 tcpudpsvd_main 1810 1782 -28 nice_main 190 156 -34 env_main 242 206 -36 run_command 221 174 -47 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/17 up/down: 48/-352) Total: -304 bytes Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cttyhack: don't do anything if ctty is already availableDenys Vlasenko2010-05-141-17/+26
| | | | | | | function old new delta cttyhack_main 244 269 +25 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* switch_root: improve behavior on error; improve help textDenis Vlasenko2009-04-211-1/+1
| | | | | *: make "can't execute '%s'" message uniform
* *: rename ATTRIBUTE_XXX to just XXX.Denis Vlasenko2008-07-051-1/+1
|
* *: fix fallout from -Wunused-parameterDenis Vlasenko2008-03-171-1/+1
| | | | | | | | | | | | | | | | | | function old new delta bbunpack 358 366 +8 passwd_main 1070 1072 +2 handle_incoming_and_exit 2651 2653 +2 getpty 88 86 -2 script_main 975 972 -3 inetd_main 2036 2033 -3 dname_enc 377 373 -4 make_new_session 474 462 -12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/5 up/down: 12/-24) Total: -12 bytes text data bss dec hex filename 797429 658 7428 805515 c4a8b busybox_old 797417 658 7428 805503 c4a7f busybox_unstripped
* cttyhack: trivial build fixletDenis Vlasenko2007-12-221-1/+1
|
* cttyhack: add missing ';'Denis Vlasenko2007-12-101-1/+1
| | | | | init: remove pointless access() check
* init: remove superfluous forks and messing up with argv[0]Denis Vlasenko2007-12-101-9/+13
| | | | | cttyhack: add stealing of ctty
* cttyhack: new applet.Denis Vlasenko2007-05-181-0/+73