Commit Graph

265 Commits

Author SHA1 Message Date
Denis Vlasenko
3211adc184 login: fixing my brainfart: xspawn(t_argv) <- was using argv! 2007-04-12 20:33:01 +00:00
Denis Vlasenko
0de3c55b42 login: remove setpgrp call (makes it work from shell prompt again).
login: sanitize stdio descriptors (we are suid, need to be careful!)
shrink login and set_environment by ~100 bytes.
2007-04-12 12:31:02 +00:00
Bernhard Reutner-Fischer
00c2c4868a - clean up addgroup, fix adding users to existing groups and make it optional (Tito) 2007-04-05 13:16:39 +00:00
Denis Vlasenko
53091ecd20 Attempt to get more applets compile for NOMMU.
TODO_config_nommu documents what I managed to compile so far
(yay! msh works! cool). inetd, telnetd, httpd still do not compile. TODO
Also make fork(), daemon() produce warnings on compile stage
(in addition to erros on link stage).
2007-03-26 13:35:09 +00:00
Denis Vlasenko
cad04ef4f3 add NOMMU fixme's; move move_fd from runit_lib to libbb; nuke fd_copy 2007-03-25 23:21:05 +00:00
Denis Vlasenko
c0415a9833 login: nuke nonblock() - we have it in libbb; -400 bytes bss. 2007-03-24 17:04:07 +00:00
Denis Vlasenko
7695328575 adduser: don't bomb out if shadow password file doesn't exist
(from Tito <farmatito@tiscali.it>)
2007-03-24 16:06:46 +00:00
Denis Vlasenko
5df955fce2 Do not fail password check if shadow password does not exist -
fall back to ordinary one

Reduced usage of functions returning datain static buffers.
(mostly passwd/group/shadow related):

function                                             old     new   delta
correct_password                                     143     193     +50
sulogin_main                                         490     533     +43
adduser_main                                         732     774     +42
passwd_main                                         1875    1915     +40
addgroup_main                                        330     365     +35
bb_internal_getspnam                                  38       -     -38
bb_internal_fgetpwent                                 38       -     -38
bb_internal_fgetgrent                                 38       -     -38
static.resultbuf                                     168      88     -80
static.buffer                                       1872    1104    -768
------------------------------------------------------------------------------
(add/remove: 0/3 grow/shrink: 5/2 up/down: 210/-962)         Total: -752 bytes
2007-03-13 13:01:14 +00:00
Denis Vlasenko
8e858e2700 clean up accumulated whitespace damage 2007-03-07 09:35:43 +00:00
Denis Vlasenko
1d76f439da EXEC_PREFER_APPLETS support by Gabriel L. Somlo <somlo@cmu.edu> 2007-02-06 01:20:12 +00:00
Denis Vlasenko
06af216528 suppress warnings about easch <applet>_main() having
no preceding prototype
2007-02-03 17:28:39 +00:00
Denis Vlasenko
06c0a71d23 preparatory patch for -Wwrite-strings #3 2007-01-29 22:51:44 +00:00
Denis Vlasenko
e06bed30cf use bb_sanitize_stdio() where appropriate 2007-01-27 22:21:12 +00:00
Bernhard Reutner-Fischer
bb8c7c041c - sed -i -e "/\$Id:/d;" 2007-01-22 17:04:53 +00:00
Denis Vlasenko
9af7c9d6b6 openvt,getty,vfork_daemon_rexec,mount: tighten up fd cleanup code
(will close all fd's > 2 on daemonization now)
getty: fix "getty -" support, and also do not try to chown/chmod "-"
telnetd: fix "lost ctty" bug
Yet another attempt on saner function names:
bb_sanitize_server_stdio(0/1) -> bb_sanitize_stdio() + bb_daemonize();
2007-01-19 21:19:35 +00:00
Denis Vlasenko
f7996f3b70 Trailing whitespace removal over entire tree 2007-01-11 17:20:00 +00:00
Denis Vlasenko
b5a122b6f9 fix for uclibc-without-shadow.h compilation 2006-12-30 14:46:51 +00:00
Denis Vlasenko
7fa0fcafca fix build without shadow support 2006-12-28 21:33:30 +00:00
Denis Vlasenko
9a44c4f91c bb_xget[pw/gr]nam were horribly misnamed - fixed.
uidgid_get -> get_uidgid, add additional param
(numeric_ok). Make chown use it.
chown: fix "chown user: ...."
install: fix incorrect use of bb_xget[pw/gr]nam
2006-12-28 05:44:47 +00:00
Denis Vlasenko
3ef70d43ad adduser: trivial code movement 2006-12-26 17:37:38 +00:00
Denis Vlasenko
bf0a201008 style fixes
last xcalloc replaced by xzalloc
2006-12-26 10:42:51 +00:00
Denis Vlasenko
e13a537795 su: fix typo: "argv -= optind" should be += 2006-12-23 02:59:06 +00:00
Bernhard Reutner-Fischer
359d7ca0e7 - rename SU_SYSLOG to FEATURE_SU_SYSLOG 2006-12-19 08:55:38 +00:00
Denis Vlasenko
8eb3b391ad passwd: add option to check passwords for weakness 2006-12-19 00:33:53 +00:00
Denis Vlasenko
15b213ef5a su: make /etc/shells check configurable
ash: missing ';'
2006-12-19 00:20:20 +00:00
Denis Vlasenko
9f739445cd inline strcmp(s, "-") [actually macro-ize it for now - gcc is too stupid] 2006-12-16 23:49:13 +00:00
Denis Vlasenko
16c2c700fd passwd: fix indentation 2006-12-12 18:11:58 +00:00
Denis Vlasenko
db2b52425d passwd: added comment 2006-12-12 17:14:56 +00:00
Denis Vlasenko
900406c359 passwd: shrink by ~10 bytes, use PRNG instead of usleep. 2006-12-12 14:38:03 +00:00
Denis Vlasenko
becd8c538c passwd: made smaller by ~130 bytes. size can go negative
if current trend will continue ;)
2006-12-01 21:34:20 +00:00
Denis Vlasenko
4c87d4f242 passwd: micro-optimization 2006-11-30 23:13:59 +00:00
Denis Vlasenko
002526481e passwd: small size optimization. salt generation improved
(really generated different salts even if called back-to-back).
2006-11-30 20:41:28 +00:00
Denis Vlasenko
ab24e18c7a passwd: rework:
* do not make backup copy by copying (just retain old file)
* correctly fall back to /etc/passwd if user is not in shadow
* fix bug with overlong passwd entries
* be permissive on some kinds of failures
* reduce stack usage
* code size: -500 bytes
2006-11-30 16:41:15 +00:00
Bernhard Reutner-Fischer
b8bb27c7ea - save 4 bytes
text    data     bss     dec     hex filename
    764       0      80     844     34c vlock.o.oorig
    760       0      80     840     348 vlock.o
2006-11-30 14:53:51 +00:00
Denis Vlasenko
d9e15f2068 style cleanup: return(a) -> return a, part 2 2006-11-27 16:49:55 +00:00
Denis Vlasenko
d686a045c8 safe_strtoXX interface proved to be a bit unconvenient.
Remove it, introduce saner bb_strtoXX.
Saved ~350 bytes.
2006-11-27 14:43:21 +00:00
Bernhard Reutner-Fischer
8a0a83d503 - minor shrinkage
text    data     bss     dec     hex filename
    773       0      80     853     355 vlock.o.orig
    766       0      80     846     34e vlock.o
2006-11-27 13:58:18 +00:00
Denis Vlasenko
a7b2c41e03 deluser: the same code, but a bit less obfuscated. 2006-11-27 01:04:23 +00:00
Denis Vlasenko
c9bb67787a deluser: size reduction by 60 bytes.
patch from Tito <farmatito@tiscali.it>
2006-11-27 00:54:59 +00:00
Bernhard Reutner-Fischer
7627cc1454 - fix typo 2006-11-22 18:21:08 +00:00
Denis Vlasenko
4a5cf16a36 login: use %s - we know that string is not too long there
ping[6]: use getopt32: smaller (-50 bytes) and handles -c6 correctly
(was requiring '-c 6' with mandatory space)
2006-11-20 00:48:22 +00:00
Denis Vlasenko
89f0b3486d rodata cleanup. "unable to" == "cannot". -300 bytes 2006-11-18 22:04:09 +00:00
Denis Vlasenko
6476cc1089 getty: remove ancient termio support (was using termois anyway) 2006-11-07 01:52:10 +00:00
Denis Vlasenko
9225854144 mostly style fixes 2006-11-01 10:25:35 +00:00
Denis Vlasenko
8c76487f06 login: add big fat comment about SIGINT - prevent
adding/deleting that code again and again
2006-10-31 18:30:56 +00:00
Denis Vlasenko
6ae8079e2d login: re-enable Ctrl-^C before execing shell. 2006-10-31 17:34:44 +00:00
Denis Vlasenko
ddec5af6b0 rename functions to more understandable names 2006-10-26 23:25:17 +00:00
Denis Vlasenko
703aa13ff5 watch: fix warning
getty: fix breakage; fix excessive stack usage
2006-10-23 22:43:02 +00:00
Denis Vlasenko
4e70bf4359 getty: conditionally disable handling of all-caps terminals. 2006-10-23 10:17:34 +00:00
Denis Vlasenko
50e77e1cc1 getty: cleanup part 2 2006-10-23 02:11:22 +00:00
Denis Vlasenko
dce3fde414 getty: cleanup part 1 2006-10-23 02:10:45 +00:00
Denis Vlasenko
e1a0d486e4 message string changes, mostly for consistency, also -32 bytes in .rodata 2006-10-20 13:28:22 +00:00
Denis Vlasenko
c345d8e945 sulogin: add support for $SUSHELL & $sushell 2006-10-14 11:47:02 +00:00
Denis Vlasenko
ea62077b85 add open_read_close() and similar stuff 2006-10-14 02:23:43 +00:00
Denis Vlasenko
1385899416 attempt to regularize atoi mess. 2006-10-08 12:49:22 +00:00
Denis Vlasenko
7d219aab70 build system overhaul 2006-10-05 10:17:08 +00:00
Denis Vlasenko
8f8f268cfd bb_applet_name -> applet_name 2006-10-03 21:00:43 +00:00
Denis Vlasenko
67b23e6043 getopt_ulflags -> getopt32.
It is impossible to formulate sane ABI based on
size of ulong because it can be 32-bit or 64-bit.
Basically it means that you cannot portably use
more that 32 option chars in one call anyway...
Make it explicit.
2006-10-03 21:00:06 +00:00
Denis Vlasenko
e175ff252f several fixes from openWRT project 2006-09-26 17:41:00 +00:00
Denis Vlasenko
22f6dcb47c login: fix getopt_ulflags fallout (wasn't taking username supplied by getty) 2006-09-26 16:31:01 +00:00
Denis Vlasenko
d9867320b4 vlock: make message shorter 2006-09-24 02:10:03 +00:00
Denis Vlasenko
a36a676923 correct_password: undo whitespace damage.
vlock + correct_password: fix incorrect line breaks in messages.
2006-09-23 13:11:49 +00:00
Denis Vlasenko
d78b433414 passwd: getopt_ulflags'isation 2006-09-23 12:30:03 +00:00
Rob Landley
e9a7a6212b Change license statements (and clean up headers) on some of the files that
Erik or I are primary copyright holders on.
2006-09-22 02:52:41 +00:00
Denis Vlasenko
2969c772c2 getty: oops... removing duplicate #include <syslog.h> 2006-09-19 14:47:54 +00:00
Denis Vlasenko
f70265290c getty: #include <syslog.h> 2006-09-19 13:50:55 +00:00
Denis Vlasenko
9213a9e0f2 whitespace cleanup 2006-09-17 16:28:10 +00:00
Denis Vlasenko
66fabdb631 login: apply fixes + getopt_ulflag'ification by Bernhard 2006-09-17 14:45:09 +00:00
Denis Vlasenko
7ccf5cc064 login: eliminate forward decls and #ifdefs 2006-09-14 17:03:18 +00:00
Bernhard Reutner-Fischer
7fee0c4357 - fix copy'n paste errors that got introduced when switching to the shorter boilerplate.
No object code changes.
2006-09-13 16:39:19 +00:00
Bernhard Reutner-Fischer
92582f2e11 - r16075 broke for de-selected FEATURE_UTMP; Partial fix that wants some more cleanup (see FIXME in the patch). 2006-09-13 15:42:47 +00:00
Rob Landley
20cc6d567f Remove pointless "const". Bloatcheck says 0 bytes difference. 2006-09-12 21:42:17 +00:00
Rob Landley
69674941dd Error reporting fix for sulogin, plus remove help entries for options we never
implemented.  (Plus a bit more of bbsh leaking in from my tree, but it
shouldn't hurt anything and I'm lazy...)
2006-09-11 00:34:01 +00:00
Denis Vlasenko
9852d5a1e6 sulogin: minor cleanup. 2006-09-09 14:00:58 +00:00
Denis Vlasenko
2f50aa42c5 login: use some ideas from util-linux's login.
O_NONBLOCKing output on login timeout.
fchmod instead of chmod (latter is racy).
is_my_tty() is not needed anymore after race is fixed
(is_my_tty() was racy too anyway...).
2006-09-08 17:56:52 +00:00
Denis Vlasenko
9a9edf200b login: make it saner and smaller by ~0.5k. 2006-09-08 17:29:53 +00:00
Denis Vlasenko
6bbd174593 login: small fixes like \n removal, bb_error_msg'ification, etc. 2006-09-08 17:26:20 +00:00
Denis Vlasenko
942e4291fe login: previous commit comment was wrong :)
That commit added login script support.
Now _this commit_ is a style fix. Sorry....
2006-09-08 17:25:04 +00:00
Denis Vlasenko
2e502914b0 login: style fixes 2006-09-08 17:22:45 +00:00
Rob Landley
dd93abeaff Shrinkage/cleanup from Tito. 2006-09-08 17:22:05 +00:00
Denis Vlasenko
a9801658ee getty, sulogin: convert to using bb_msg for syslog output 2006-09-07 16:20:03 +00:00
Denis Vlasenko
049d6b8c08 Add CONFIG_FEATURE_SYSLOG which controls whether
bb_xx_msg will ever try to send output to syslog.
Add "select CONFIG_FEATURE_SYSLOG" to relevant applets.
This allows to omit syslog code if we do not have
any syslog-capable applets in the build.
2006-09-07 06:02:39 +00:00
Denis Vlasenko
6d655be5df removed a lot of trailing \n in bb_msg() calls. It is added
automatically by function itself.
2006-09-06 19:02:46 +00:00
Denis Vlasenko
adff40e80d sulogin: fix bug: -tNNN didn't work 2006-09-03 17:11:34 +00:00
Rob Landley
f78ab5396d Antti Seppala (with dots over the last two a's) wants our getty to initialize
the terminal the way mingetty does instead of the way agetty does.  It's
a bit ugly for somebody else to be writing to a console sitting at a
login: prompt, but it's uglier when newline doesn't work as expected if
they do.
2006-08-24 20:00:44 +00:00
Rob Landley
d921b2ecc0 Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes...  General cleanup pass.  What I've
been doing for the last couple days.

And it conflicts!  I've removed httpd.c from this checkin due to somebody else
touching that file.  It builds for me.  I have to catch a bus.  (Now you know
why I'm looking forward to Mercurial.)
2006-08-03 15:41:12 +00:00
"Robert P. J. Day"
6dce0b6fa7 Remove apparent typo in "bool" line. 2006-08-03 11:28:36 +00:00
Rob Landley
62103757ef Bugfix from Tito to make sure /etc/group gets updated. 2006-07-16 18:58:18 +00:00
Rob Landley
afb94ecf2b Convert setuid/setgid users to xsetuid/xsetgid. 2006-07-16 08:06:34 +00:00
Rob Landley
1870737480 Comment tweak from tito. 2006-07-15 19:46:46 +00:00
"Robert P. J. Day"
801ab14013 Add one-line GPL boilerplate to numerous (but not all yet) source files. 2006-07-12 07:56:04 +00:00
Rob Landley
ab7d9be17c Patch from Tito to remove pwd_to_spwd (which we don't actually need), with
some #ifdef removal from me.
2006-07-11 16:19:17 +00:00
Rob Landley
3bfcf3cccc Patch from Tito to make syslog configurable and remove #ifdefs. Further
cleanups by me.
2006-07-10 03:05:46 +00:00
"Robert P. J. Day"
68229837ff Remove all usage of the "register" storage class specifier. 2006-07-01 13:08:46 +00:00
Rob Landley
cf7577d417 Missed one. Based on suggestions from Erik Hovland. 2006-06-25 22:59:31 +00:00
Rob Landley
290fcb4213 Undo all of the ugliness and some of the bloat from 15412. 2006-06-18 23:59:03 +00:00
Bernhard Reutner-Fischer
6d82f94681 - do away with the fwd-decls of functions. Should not contain any code changes
AFAICT.
2006-06-16 16:37:07 +00:00
Bernhard Reutner-Fischer
df798b7f58 - minor size tweak
text    data     bss     dec     hex filename
    613       0       0     613     265 loginutils/su.o.orig
    605       0       0     605     25d loginutils/su.o
2006-06-14 16:36:45 +00:00
Rob Landley
299a6b4d7b Consolidate #include <sys/time.h> so libbb.h does it. 2006-05-27 21:42:58 +00:00
Bernhard Reutner-Fischer
781e42d66c - introduce and use bb_path_wtmp_file for portability (saves 11 Bytes).
- fix last.c to also look at the double-underscore UT_ defines.
2006-05-26 14:41:40 +00:00