introduce and use bb_basename()

function                                             old     new   delta
bb_basename                                            -      26     +26
sv_main                                             1226    1225      -1
passwd_main                                         1985    1983      -2
showdirs                                             482     478      -4
sendCgi                                             1811    1807      -4
make_device                                         1354    1350      -4
handleIncoming                                      2443    2439      -4
func_name                                             82      78      -4
service_name                                        2292    2285      -7
main                                                 909     901      -8
cmp_main                                             555     547      -8
test_main                                            434     422     -12
act                                                  228     216     -12
find_pair                                            180     164     -16
rmmod_main                                           298     280     -18
find_pid_by_name                                     156     134     -22
modprobe_main                                       1606    1576     -30
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 0/16 up/down: 26/-156)         Total: -130 bytes
   text    data     bss     dec     hex filename
 734933    3028   14400  752361   b7ae9 busybox_old
 734801    3028   14400  752229   b7a65 busybox_unstripped
This commit is contained in:
Denis Vlasenko
2007-06-30 08:04:05 +00:00
parent f7d07b1723
commit dc757aa16c
14 changed files with 40 additions and 73 deletions

View File

@@ -1125,7 +1125,7 @@ static int sendCgi(const char *url,
setenv1("HTTP_REFERER", referer);
/* set execve argp[0] without path */
argp[0] = strrchr(purl, '/') + 1;
argp[0] = (char*)bb_basename(purl);
/* but script argp[0] must have absolute path and chdiring to this */
script = strrchr(fullpath, '/');
if (!script)
@@ -1713,7 +1713,7 @@ static void handleIncoming(void)
if (alarm_signaled)
break;
if (strcmp(strrchr(url, '/') + 1, httpd_conf) == 0 || ip_allowed == 0) {
if (strcmp(bb_basename(url), httpd_conf) == 0 || ip_allowed == 0) {
/* protect listing [/path]/httpd_conf or IP deny */
#if ENABLE_FEATURE_HTTPD_CGI
FORBIDDEN: /* protect listing /cgi-bin */