Commit Graph

475 Commits

Author SHA1 Message Date
Denys Vlasenko
c47917865d login: explain -h HOST option better
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-21 16:06:40 +02:00
Denys Vlasenko
95dee81a46 loginutils/*: convert to new-style "one file" applets
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-19 01:20:36 +02:00
Denys Vlasenko
550bf5b4a4 remove global "jmp_buf die_jmp" from !FEATURE_PREFER_APPLETS builds
function                                             old     new   delta
xfunc_has_died                                         -      21     +21
sleep_much                                             -      12     +12
sleep10                                                -       9      +9
die_func                                               -       4      +4
fflush_stdout_and_exit                                35      36      +1
builtin_type                                         121     119      -2
die_sleep                                              4       -      -4
xfunc_die                                             60      24     -36
hush_main                                           1128    1011    -117
die_jmp                                              156       -    -156
------------------------------------------------------------------------------
(add/remove: 4/2 grow/shrink: 1/3 up/down: 47/-315)          Total: -268 bytes
   text	   data	    bss	    dec	    hex	filename
 939992	    992	  17652	 958636	  ea0ac	busybox_old
 939880	    992	  17496	 958368	  e9fa0	busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-09 16:42:57 +02:00
Denys Vlasenko
d60752f8c9 build system: -fno-builtin-printf
Benefits are: drops reference to out-of-line putchar(), fixes a few cases
of failed string merge.

function                                             old     new   delta
i2cdump_main                                        1488    1502     +14
sha256_process_block64                               423     433     +10
sendmail_main                                       1183    1185      +2
list_table                                          1114    1116      +2
i2cdetect_main                                      1235    1237      +2
fdisk_main                                          2852    2854      +2
builtin_type                                         119     121      +2
unicode_conv_to_printable2                           325     324      -1
scan_recursive                                       380     378      -2
mkfs_minix_main                                     2687    2684      -3
buffer_fill_and_print                                178     169      -9
putchar                                              152       -    -152
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 7/4 up/down: 34/-167)          Total: -133 bytes
   text    data     bss     dec     hex filename
 937788     932   17676  956396   e97ec busybox_old
 937564     932   17676  956172   e970c busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-10-07 22:42:45 +02:00
Denys Vlasenko
c65a7596df adduser: fix help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-09-21 21:11:12 +02:00
Bernhard Reutner-Fischer
65db14ec50 adduser: Add -k /path/to/skel
function                                             old     new   delta
.rodata                                           157069  157133     +64
adduser_main                                         921     936     +15
adduser_longopts                                     103     110      +7
packed_usage                                       30230   30236      +6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 4/0 up/down: 92/0)               Total: 92 bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-09-21 21:09:18 +02:00
Sören Tempel
d862717328 login: don't print motd if .hushlogin exists in users home
function                                             old     new   delta
login_main                                           978     996     +18

Signed-off-by: Sören Tempel <soeren@soeren-tempel.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-08-24 22:16:48 +02:00
Denys Vlasenko
936c8809ca deluser: also remove user from /etc/group
function                                             old     new   delta
update_passwd                                       1270    1470    +200
deluser_main                                         310     332     +22

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-03-12 15:30:46 +01:00
Denys Vlasenko
23cfaab47d libpwdgrp: use getpwent() instead of getpwent_r()
function                                             old     new   delta
massage_data_for_non_r_func                            -      90     +90
bb_internal_getpwent                                   -      69     +69
getXXnam_r                                            94     162     +68
fill_bounds                                          131     128      -3
deluser_main                                         355     310     -45
complete_username                                    123      78     -45
getXXnam                                             163      90     -73
massage_data_for_r_func                              103       -    -103
bb_internal_getpwent_r                               121       -    -121
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 1/5 up/down: 227/-407)         Total: -163 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-02-07 21:21:02 +01:00
Denys Vlasenko
a14fa79592 deluser: implement --remove-home
function                                             old     new   delta
deluser_main                                         308     355     +47
packed_usage                                       30149   30156      +7
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 54/0)               Total: 54 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-02-05 18:35:52 +01:00
Denys Vlasenko
da9212667c libbb: code shrink by factoring out common update_utmp_DEAD_PROCESS
function                                             old     new   delta
update_utmp_DEAD_PROCESS                               -      17     +17
telnetd_main                                        1685    1674     -11
mark_terminated                                       56      45     -11
handle_sigchld                                        74      63     -11

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2015-01-05 15:37:58 +01:00
Denys Vlasenko
cf76b5ce12 getty: set tty attrs so that control chars are shown as ^c
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-10-02 13:45:21 +02:00
Denys Vlasenko
fb8d1ef2d0 addgroup: mention -S in the help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-08-15 14:29:43 +02:00
Denys Vlasenko
539e2802eb getty: explain when setsid() fails. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-05-11 00:00:52 +02:00
Romain Naour
0e3334c8d8 su: add a delay if the password is incorrect
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-03-16 11:18:19 +01:00
Bartosz Golaszewski
265a74b983 Kbuild: move CONFIG_PAM to general configuration
Currently CONFIG_PAM depends on CONFIG_LOGIN, but is used by the httpd applet too.

This patch moves said option to general configuration, thus allowing to
compile httpd with PAM support independently from login.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-02-19 18:53:25 +01:00
Tito Ragusa
891b98c9bc adduser,addgroup: introduce and use CONFIG_LAST_ID
Changes adduser.c, addgroup.c and Config.src to set and use CONFIG_LAST_ID.

function                                             old     new   delta
adduser_main                                         841     865     +24
addgroup_main                                        407     425     +18

Signed-off-by: Tito Ragusa <farmatito@tiscali.it>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-01-17 09:17:55 +01:00
Denys Vlasenko
e83e1c50f2 adduser: check whether run with no USERNAME. Closes 6728
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-12-20 20:45:02 +01:00
Denys Vlasenko
8b59b2c13e libbb: move nuke_str() from passwd into libbb
function                                             old     new   delta
nuke_str                                               -      15     +15
ask_and_check_password_extended                      215     206      -9
init_main                                            781     771     -10
nuke_str                                              27       -     -27
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/2 up/down: 15/-46)            Total: -31 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-11-19 13:36:45 +01:00
Denys Vlasenko
9c1c605b1a sulogin: use common password-checking routine.
This needed some extensions correct_passwd() function,
which got renamed ask_and_check_password() to better describe what it does.

function                                             old     new   delta
ask_and_check_password_extended                        -     215    +215
ask_and_check_password                                 -      12     +12
vlock_main                                           394     397      +3
sulogin_main                                         494     326    -168
correct_password                                     207       -    -207
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 1/1 up/down: 230/-375)         Total: -145 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-11-19 13:09:06 +01:00
Denys Vlasenko
1bf560e9c3 cryptpw: do not segfault on EOF. Closes 6350
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-06-30 21:28:55 +02:00
Rich Felker
16614e9bab *: change execl sentinels from NULL to (char*)0
Signed-off-by: Rich Felker <dalias@aerifal.cx>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-06-30 13:45:17 +02:00
Jonathan Liu
b6dc13c2d3 sulogin: allow system maintenance login if root password is empty
The current password checking is unable to distinguish between the user
entering an empty password or pressing Control-D. As a result, an empty
password always results in normal startup.

We modify bb_ask to return NULL if Control-D is pressed without entering
a password. The sulogin applet is then modified to only proceed to
normal startup if bb_ask returns NULL. This covers EOF with no password,
interrupt by timeout and ^C.

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-05-21 17:01:55 +02:00
Denys Vlasenko
9cb1e2f86b sulogin: correct lying comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-05-21 16:47:36 +02:00
Tito Ragusa
8dc6d1a813 adduser: make it accept "adduser USER GROUP" form
Signed-off-by: Tito Ragusa <farmatito@tiscali.it>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-10-08 11:18:08 +02:00
Denys Vlasenko
41f7885f06 getty: tweak style, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-09-02 13:57:49 +02:00
Denys Vlasenko
45c35e9de0 getty: add commented-out extended error diagnostic
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-08-16 13:29:25 +02:00
Denys Vlasenko
dba7094d62 login: increase login name size limit from 32 to 64
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-08-15 17:06:37 +02:00
Mike Frysinger
c5fe9f7b72 include sys/resource.h where needed
We use functions from sys/resource.h in misc applets, but don't include
the header.  This breaks building with newer glibc versions, so add the
include where needed.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-07-05 23:19:09 -04:00
Denys Vlasenko
dac8e79a19 Move several applets to different install dir:
Moved to [/usr]/sbin:
addgroup, adduser, delgroup, deluser,
arping, chat, ether-wake, fdformat, ifplugd,
ip, ipaddr, iplink, iproute, iprule, iptunnel,
killall5, readahead, rtcwake, tftpd, add-shell, remove-shell, powertop.

Moved to /bin for /usr/bin: kbd_mode.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-06-20 20:24:57 +02:00
Pascal Bellard
70fc8c17e2 su: do not change to home dir unless -l
Signed-off-by: Pascal Bellard <pascal.bellard@ads-lu.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-06-12 13:21:02 +02:00
Denys Vlasenko
eced0c78a5 getty: fix for NOCTTY killing us with SIGHUP
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-04-26 10:53:48 +02:00
Sergey Naumov
7eaa03709b login: -f should not ask for password even with PAM
Signed-off-by: Sergey Naumov <sknaumov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-01-30 12:52:56 +01:00
Denys Vlasenko
6e8861b5f1 *: better comments on termios manipulations. No code changes.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-01-15 23:00:13 +01:00
Denys Vlasenko
d45efd3a9f passwd,cryptpw: make default encryption algorithm configurable
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-01-08 16:44:37 +01:00
Denys Vlasenko
e504c245f7 getty: Hurd has no CBAUD, work around that
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-30 21:27:33 +01:00
Denys Vlasenko
e9dc354df8 getty: fix a minor problem of Ctrl-D not printing '\n'
Also removed defines for control chars which are never changed,
and added login/getty README.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-23 23:58:59 +02:00
Denys Vlasenko
ee320c6d9c getty: reset tty attrs on Ctrl-C and Ctrl-D too
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-23 18:05:58 +02:00
Denys Vlasenko
e206a4de4c getty: add O_NONBLOCK to open which is used to drop ctty
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-22 08:19:42 +02:00
Denys Vlasenko
94354154c4 getty: remove now not needed resetting of ALRM to to SIG_DFL
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-22 06:30:48 +02:00
Denys Vlasenko
7449e18190 getty,login: tighten up handling of ctty, pgrp, and tty attr restoring on timeout
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-22 06:27:41 +02:00
Denys Vlasenko
ef5a2d757a getty: shrink help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-10-22 03:16:23 +02:00
Ian Wienand
378ab68199 login: new option LOGIN_SESSION_AS_CHILD
Signed-off-by: Ian Wienand <ianw@vmware.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-14 08:41:38 +02:00
Denys Vlasenko
d2fe2ba08d chpasswd: fix possible free() or non-allocated string. +8 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-09-11 12:25:59 +02:00
Denys Vlasenko
66426760be *: remove "Options:" string from help texts
function                                             old     new   delta
packed_usage                                       28706   28623     -83

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-06-05 03:58:28 +02:00
Denys Vlasenko
9b90d9b503 adduser: better logic for choosing addgroup -g/--gid
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-21 21:32:40 +02:00
Denys Vlasenko
569e930768 adduser: prefer to call addgroup --gid, not non-std addgroup -g
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-21 19:57:58 +02:00
Denys Vlasenko
3a240212d9 passwd: shorter help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-13 03:31:45 +02:00
Denys Vlasenko
12a432715f adduser: safe username passing to passwd/addgroup
passwd: support creating SHA passwords
random code shrink

function                                             old     new   delta
crypt_make_pw_salt                                     -      87     +87
adduser_main                                         883     904     +21
...
crypt_make_salt                                       99      89     -10
chpasswd_main                                        329     312     -17
packed_usage                                       28731   28691     -40
passwd_main                                         1070    1000     -70
cryptpw_main                                         310     224     -86
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 4/12 up/down: 154/-288)        Total: -134 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-13 03:19:01 +02:00
Denys Vlasenko
0a8971d112 trim help text
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-05-12 03:14:12 +02:00