Commit Graph

31 Commits

Author SHA1 Message Date
Denys Vlasenko
8d22ca81c3 libpwdgrp: comment out more unused functions
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-31 14:43:58 +02:00
Denys Vlasenko
55301297d3 libpwdgrp: comment out functions with UNUSED_SINCE_WE_AVOID_STATIC_BUFS
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-31 12:38:17 +02:00
Denys Vlasenko
17fcd72add libpwdgrp: style cleanups
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-31 12:37:43 +02:00
Denys Vlasenko
9e59e27cdf libpwdgrp: code style fixes, no real code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-31 10:31:51 +02:00
Denys Vlasenko
57dc3c7b4c libpwdgrp: can't depend on strlen(line_buff) != 0
function                                             old     new   delta
bb__pgsreader                                        188     202     +14

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-03-31 10:24:37 +02:00
Denys Vlasenko
1f27ab0d4b *: optimize code size in strtoul calls
function                                             old     new   delta
bb_parse_mode                                        433     431      -2
rtnl_rtntype_a2n                                     202     198      -4
ParseField                                           511     498     -13
bb_init_module_24                                   4730    4675     -55
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-74)             Total: -74 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-23 17:17:53 +02:00
Denys Vlasenko
9b1b62adc4 Patches to enable FreeBSD build
platform.h: fix wrong check for endianness, fix lchown
aliasing to chown on uclibc.

Code seems to not be affected in my testing.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-05 03:34:12 +02:00
Denis Vlasenko
6826441a02 remove redundant NULL check 2008-09-27 23:39:55 +00:00
Denis Vlasenko
ee5dce3365 libpwdgrp: make it coexist with <pwd.h>, <grp.h> and <shadow.h>.
allows to get rid of hacks in libbb.h (extra declaration of setgroups -
 now it comes from grp.h as intended).
2008-09-26 10:35:55 +00:00
Denis Vlasenko
2228426512 id: fix "id <user>" case. Requires getgrouplist().
function                                             old     new   delta
getgrouplist_internal                                  -     200    +200
id_main                                              462     539     +77
bb_internal_getgrouplist                               -      67     +67
bb__parsespent                                       119     117      -2
bb_internal_initgroups                               213      58    -155
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 1/2 up/down: 344/-157)          Total: 187 bytes
2008-09-18 00:56:24 +00:00
Denis Vlasenko
5415c856ea libbb: [x]fopen_for_{read,write} introduced and used.
(by Valdimir)

function                                             old     new   delta
config_open2                                           -      41     +41
config_read                                          507     542     +35
find_pair                                            169     187     +18
fopen_for_write                                        -      14     +14
fopen_for_read                                         -      14     +14
find_main                                            406     418     +12
xfopen_for_write                                       -      10     +10
xfopen_for_read                                        -      10     +10
popstring                                            134     140      +6
parse_inittab                                        396     401      +5
next_token                                           923     928      +5
pack_gzip                                           1659    1661      +2
bb__parsespent                                       117     119      +2
fallbackSort                                        1719    1717      -2
evalvar                                             1376    1374      -2
qrealloc                                              36      33      -3
...
...
...
...
singlemount                                         4579    4569     -10
process_stdin                                        443     433     -10
patch_main                                          1111    1101     -10
ifupdown_main                                       2175    2165     -10
file_action_grep                                      90      80     -10
uuidcache_init                                       649     637     -12
hush_main                                            797     785     -12
read_config                                          230     217     -13
dpkg_main                                           3835    3820     -15
read_line_input                                     3134    3110     -24
sysctl_main                                          232     203     -29
config_open                                           40      10     -30
WARN_BAD_LINE                                         44       -     -44
login_main                                          1714    1575    -139
------------------------------------------------------------------------------
(add/remove: 5/1 grow/shrink: 8/74 up/down: 174/-737)        Total: -563 bytes
2008-07-21 23:05:26 +00:00
Denis Vlasenko
deeed59de0 libbb: introduce and use xrealloc_vector
function                                             old     new   delta
xrealloc_vector_helper                                 -      51     +51
create_list                                           84      99     +15
getopt_main                                          690     695      +5
passwd_main                                         1049    1053      +4
get_cached                                            85      89      +4
msh_main                                            1377    1380      +3
add_match                                             42      41      -1
read_lines                                           720     718      -2
grave                                               1068    1066      -2
fill_match_lines                                     143     141      -2
add_to_dirlist                                        67      65      -2
add_input_file                                        49      47      -2
act                                                  252     250      -2
fsck_main                                           2252    2246      -6
man_main                                             765     757      -8
bb_internal_initgroups                               228     220      -8
cut_main                                            1052    1041     -11
add_edge_to_node                                      55      43     -12
dpkg_main                                           3851    3835     -16
ifupdown_main                                       2202    2178     -24
sort_main                                            838     812     -26
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 5/15 up/down: 82/-124)          Total: -42 bytes
2008-07-08 05:14:36 +00:00
Denis Vlasenko
9230582315 inetd: use change_identity().
libbb: shrink our internal initgroups().
httpd: remove stray 'else' and 'index_page = "index.html"'

function                                             old     new   delta
httpd_main                                           750     743      -7
inetd_main                                          2033    2011     -22
bb_internal_initgroups                               251     228     -23
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-52)             Total: -52 bytes
2008-03-20 15:12:58 +00:00
Denis Vlasenko
6ca409e0e4 trylink: produce even more info about final link stage
trylink: explain how to modify link and drastically decrease amount
  of padding (unfortunately, needs hand editing ATM).
*: add ALIGN1 / ALIGN2 to global strings and arrays of bytes and shorts

size saving: 0.5k
2007-08-12 20:58:27 +00:00
Denis Vlasenko
b71c668c57 style fix (stray space before ';') 2007-07-21 15:08:09 +00:00
Denis Vlasenko
2c91efb7c2 libpwdgrp/pwd_grp.c: allocate local storage on first call, not in bss. -1k bss
function                                             old     new   delta
get_S                                                  -      31     +31
bb_internal_getpwnam                                  38      44      +6
bb_internal_getgrnam                                  38      44      +6
bb_internal_getgrgid                                  38      44      +6
ptr_to_statics                                         -       4      +4
static.resultbuf                                      88       -     -88
static.buffer                                       1024       -   -1024
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 3/0 up/down: 53/-1112)        Total: -1059 bytes
2007-06-18 10:08:27 +00:00
Denis Vlasenko
87468857f6 style fixes 2007-04-13 23:22:00 +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
cb04ff5c68 fixdep.c: avoit doing memcmp in most cases
uidgid_get.c: add forgotten copyright notice
pwd/grp/shadow: avoid collisions with libc names
2006-12-30 21:11:57 +00:00
Denis Vlasenko
7fa0fcafca fix build without shadow support 2006-12-28 21:33:30 +00:00
Denis Vlasenko
7d219aab70 build system overhaul 2006-10-05 10:17:08 +00:00
"Robert P. J. Day"
63fc1a9e08 Standardize on the vi editing directives being on the first line. 2006-07-02 19:47:05 +00:00
"Robert P. J. Day"
edd9ca5743 More removal of "#if 0" content. 2006-07-01 14:52:12 +00:00
Rob Landley
2b8a05a775 I broke allbareconfig with half-finished cleanups I'd forgotten weren't done.
Got both to a decent stopping point.  (There's a lot more cleanup to do on ls.c
but now is not the time...)
2006-06-20 17:43:01 +00:00
Rob Landley
ea224be6aa skip_whitespace() shouldn't claim its return value is const, it doesn't know
that and callers wind up typecasting it back.
2006-06-18 20:20:07 +00:00
Bernhard Reutner-Fischer
fa939aae81 - include proper headers. 2006-04-05 16:21:37 +00:00
Rob Landley
06ec8cff83 Typo fixes brought to you by the letters a, l, and Robert P. Day. 2006-03-03 19:02:50 +00:00
Tim Riker
c1ef7bdd8d just whitespace 2006-01-25 00:08:53 +00:00
Bernhard Reutner-Fischer
30c7de068b - move GETXXKEY_R_FUNC into an internal helper file to allow for compiling
with IMA.
2005-10-28 11:21:40 +00:00
Rob Landley
25413bfe00 Shaun Jackman pointed out that fgets_unlocked() and friends are gnu extensions
not in newlib, and also that all the _unlocked variants are kind of pointless
in this context.
2005-10-08 02:23:22 +00:00
Eric Andersen
9615a08218 Replace the old and somewhat buggy pwd_grp stuff with the shiny
new stuff mjn3 wrote for uClibc
2004-07-15 12:53:49 +00:00