Commit Graph

468 Commits

Author SHA1 Message Date
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
Tito Ragusa
9eb7bfd4d4 passwd,chpasswd: reset password in /etc/passwd to "x" if /etc/shadow was updated
Signed-off-by: Tito Ragusa <farmatito@tiscali.it>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-05 00:18:33 +02:00
Pere Orga
6a3e01d5a9 move help text from include/usage.src.h to debianutils/*.c e2fsprogs/*.c editors/*.c loginutils/*.c mailutils/*.c
Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-04-03 01:33:55 +02:00
Ryan Phillips
cf9074b54b login: set PAM RHOST
Signed-off-by: Ryan Phillips <ryan@trolocsis.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-22 18:27:21 +01:00
Denys Vlasenko
7d4e7a27af s/FAIL_DELAY/LOGIN_FAIL_DELAY/
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-08 21:07:05 +01:00
Denys Vlasenko
681efe20d3 use user's shell instead of hardwired "/bin/sh" (android needs this)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-08 21:00:36 +01:00
Denys Vlasenko
726ebbaa9f fix bit rot in scripts/Makefile.IMA
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-06 23:09:42 +01:00
Denys Vlasenko
bd74e3d8be libbb/login/su: do not sanitize shell name twice
function                                             old     new   delta
setup_environment                                    191     205     +14
login_main                                          1002     987     -15
su_main                                              474     458     -16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 14/-31)            Total: -17 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2011-03-06 18:49:40 +01:00