Changeset 171
- Timestamp:
- Jul 8, 2008, 11:16:14 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/COPYING
r30 r171 265 265 * distribution. 266 266 267 (xi) The dnmalloc library used by samhain is Copyright (C) 2005, Yves Younan, 268 Wouter Joosen and Frank Piessens, and licensed under the LGPL: 269 270 * This library is free software; you can redistribute it and/or 271 * modify it under the terms of the GNU Lesser General Public 272 * License as published by the Free Software Foundation; either 273 * version 2.1 of the License, or (at your option) any later version. 274 * 275 * This library is distributed in the hope that it will be useful, 276 * but WITHOUT ANY WARRANTY; without even the implied warranty of 277 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 278 * Lesser General Public License for more details. 279 * 280 * You should have received a copy of the GNU Lesser General Public 281 * License along with this library; if not, write to the Free Software 282 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 283 267 284 268 285 Other -
trunk/Makefile.in
r170 r171 152 152 $(srcsrc)/sh_portcheck.c \ 153 153 $(srcsrc)/sh_processcheck.c $(srcsrc)/sh_prelude_old.c \ 154 $(srcsrc)/sh_pthread.c $(srcsrc)/sh_string.c 154 $(srcsrc)/sh_pthread.c $(srcsrc)/sh_string.c \ 155 $(srcsrc)/dnmalloc.c \ 156 $(srcsrc)/t-test1.c 155 157 156 158 OBJECTS = sh_files.o sh_tiger0.o sh_tiger2.o sh_tiger2_64.o \ … … 166 168 sh_mounts.o sh_userfiles.o sh_prelink.o sh_static.o \ 167 169 sh_processcheck.o sh_portcheck.o sh_prelude_old.o \ 168 sh_pthread.o sh_string.o 170 sh_pthread.o sh_string.o dnmalloc.o 169 171 170 172 KERN = kern_head.h kern_head.c … … 354 356 TESTCLEANFILES = samhain.build samhain.new yule.html \ 355 357 test_ext test_ext.c test_ext.res testhash.tmp \ 356 testrc1.signed testrc_1ext testrc_2 testrc_2.signed 358 testrc1.signed testrc_1ext testrc_2 testrc_2.signed \ 359 test_dnmalloc 357 360 358 361 distclean: clean … … 425 428 chmod +x test/test.sh; \ 426 429 fi 430 431 test_dnmalloc: $(srcsrc)/t-test1.c dnmalloc.o 432 $(COMPILE) $(VFLAG) -o t-test1.o -c $(srcsrc)/t-test1.c; \ 433 $(LINK) t-test1.o dnmalloc.o $(LIBS_TRY) 434 427 435 428 436 #---------------------------------------------------------- … … 1179 1187 test -f ./intcutest && mv ./intcutest ./cutest; \ 1180 1188 ./cutest 1189 1190 runcutest: 1191 gdb ./cutest 1181 1192 1182 1193 samhain_hide.o: $(srcsrc)/samhain_hide.c samhain_erase.o … … 1701 1712 sh_pthread.o: $(srcsrc)/sh_pthread.c Makefile config_xor.h $(srcinc)/sh_pthread.h $(srcinc)/sh_calls.h $(srcinc)/sh_modules.h 1702 1713 sh_string.o: $(srcsrc)/sh_string.c Makefile config_xor.h $(srcinc)/sh_string.h $(srcinc)/sh_mem.h $(srcinc)/CuTest.h 1714 dnmalloc.o: $(srcsrc)/dnmalloc.c Makefile config.h 1715 t-test1.o: $(srcsrc)/t-test1.c Makefile config.h $(srcinc)/malloc.h -
trunk/aclocal.m4
r170 r171 409 409 x_libraries=NONE 410 410 DESTDIR= 411 SH_ENABLE_OPTS="db-reload xml-log message-queue login-watch process-check port-check mounts-check userfiles debug ptrace static network udp nocl stealth micro-stealth install-name identity khide suidcheck base largefile mail external-scripts encrypt srp "411 SH_ENABLE_OPTS="db-reload xml-log message-queue login-watch process-check port-check mounts-check userfiles debug ptrace static network udp nocl stealth micro-stealth install-name identity khide suidcheck base largefile mail external-scripts encrypt srp dnmalloc" 412 412 SH_WITH_OPTS="prelude libprelude-prefix database libwrap cflags libs console altconsole timeserver alttimeserver rnd egd-socket port logserver altlogserver kcheck gpg checksum fp recipient sender trusted tmp-dir config-file log-file pid-file state-dir data-file html-file" 413 413 … … 1183 1183 1184 1184 1185 AC_DEFUN([GCC_PIE_CC],[ 1186 AC_LANG_ASSERT(C) 1187 if test "X$CC" != "X"; then 1188 AC_CACHE_CHECK([whether ${CC} accepts -pie -fPIE], 1189 pie_cv_cc, 1190 [pie_old_cflags="$CFLAGS" 1191 CFLAGS="$CFLAGS -pie -fPIE" 1192 AC_TRY_COMPILE(,, pie_cv_cc=yes, pie_cv_cc=no) 1193 CFLAGS="$pie_old_cflags" 1194 ]) 1195 if test $pie_cv_cc = yes; then 1196 PIE_CFLAGS="-fPIE" 1197 PIE_LDFLAGS="-pie" 1198 fi 1199 fi 1200 ]) 1185 1201 1186 1202 AC_DEFUN([SAMHAIN_POSIX],[ … … 1844 1860 fi 1845 1861 1862 if test x"$acx_pthread_ok" = xyes; then 1863 PTHREAD_CFLAGS="${PTHREAD_CFLAGS} -DUSE_MALLOC_LOCK=1" 1864 fi 1865 1846 1866 AC_SUBST(PTHREAD_LIBS) 1847 1867 AC_SUBST(PTHREAD_CFLAGS) … … 1905 1925 AC_MSG_CHECKING([zlib in ${ZLIB_HOME}]) 1906 1926 AC_MSG_RESULT(ok) 1927 AC_CHECK_FUNCS([compressBound]) 1907 1928 zlib_found=yes 1908 1929 else … … 1919 1940 ]) 1920 1941 1942 # SH_PROG_LD 1943 # ---------- 1944 # find the pathname to the GNU or non-GNU linker 1945 AC_DEFUN([SH_PROG_LD], 1946 [ 1947 AC_REQUIRE([AC_PROG_CC])dnl 1948 AC_REQUIRE([AC_CANONICAL_HOST])dnl 1949 AC_REQUIRE([AC_CANONICAL_BUILD])dnl 1950 ac_prog=ld 1951 if test "$GCC" = yes; then 1952 # Check if gcc -print-prog-name=ld gives a path. 1953 AC_MSG_CHECKING([for ld used by $CC]) 1954 case $host in 1955 *-*-mingw*) 1956 # gcc leaves a trailing carriage return which upsets mingw 1957 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; 1958 *) 1959 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; 1960 esac 1961 case $ac_prog in 1962 # Accept absolute paths. 1963 [[\\/]]* | ?:[[\\/]]*) 1964 re_direlt='/[[^/]][[^/]]*/\.\./' 1965 # Canonicalize the pathname of ld 1966 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` 1967 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do 1968 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` 1969 done 1970 test -z "$LD" && LD="$ac_prog" 1971 ;; 1972 "") 1973 # If it fails, then pretend we aren't using GCC. 1974 ac_prog=ld 1975 ;; 1976 *) 1977 # If it is relative, then search for the first ld in PATH. 1978 with_gnu_ld=unknown 1979 ;; 1980 esac 1981 else 1982 AC_MSG_CHECKING([for ld]) 1983 fi 1984 AC_CACHE_VAL(lt_cv_path_LD, 1985 [if test -z "$LD"; then 1986 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR 1987 for ac_dir in $PATH; do 1988 IFS="$lt_save_ifs" 1989 test -z "$ac_dir" && ac_dir=. 1990 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then 1991 lt_cv_path_LD="$ac_dir/$ac_prog" 1992 # Check to see if the program is GNU ld. I'd rather use --version, 1993 # but apparently some variants of GNU ld only accept -v. 1994 # Break only if it was the GNU/non-GNU ld that we prefer. 1995 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in 1996 *GNU* | *'with BFD'*) 1997 with_gnu_ld=yes 1998 ;; 1999 *) 2000 with_gnu_ld=no 2001 ;; 2002 esac 2003 fi 2004 done 2005 IFS="$lt_save_ifs" 2006 else 2007 lt_cv_path_LD="$LD" # Let the user override the test with a path. 2008 fi]) 2009 LD="$lt_cv_path_LD" 2010 if test -n "$LD"; then 2011 AC_MSG_RESULT($LD) 2012 else 2013 AC_MSG_RESULT(no) 2014 fi 2015 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) 2016 AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, 2017 [# I'd rather use --version here, but apparently some GNU lds only accept -v. 2018 case `$LD -v 2>&1 </dev/null` in 2019 *GNU* | *'with BFD'*) 2020 lt_cv_prog_gnu_ld=yes 2021 ;; 2022 *) 2023 lt_cv_prog_gnu_ld=no 2024 ;; 2025 esac]) 2026 with_gnu_ld=$lt_cv_prog_gnu_ld 2027 ])# AC_PROG_LD_GNU 1921 2028 1922 2029 dnl *-*wedit:notab*-* Please keep this as the last line. -
trunk/configure.ac
r170 r171 13 13 dnl start 14 14 dnl 15 AM_INIT_AUTOMAKE(samhain, 2.4.4) 15 AM_INIT_AUTOMAKE(samhain, 2.4.5) 16 AC_DEFINE([SAMHAIN], 1, [Application is samhain]) 16 17 AC_CANONICAL_HOST 17 18 … … 30 31 AC_PROG_LN_S 31 32 AC_PROG_AWK 33 SH_PROG_LD 32 34 AC_PATH_PROG(cmd_hostname,hostname) 33 35 AC_SUBST(cmd_hostname) … … 37 39 GCC_STACK_PROTECT_LIB 38 40 GCC_STACK_PROTECT_CC 41 GCC_PIE_CC 39 42 fi 40 43 … … 54 57 mynetbsd=no 55 58 sh_use_lcaps="undef" 59 dnmalloc_ok=yes 56 60 57 61 case "$host_os" in … … 102 106 AC_DEFINE([HOST_IS_OPENBSD], 1, [Define if host OS is OPENBSD]) 103 107 selectconfig=freebsd 104 AC_MSG_RESULT(none) 108 dnmalloc_ok=no 109 AC_MSG_RESULT(OpenBSD dnmalloc does not work with pthreads) 105 110 ;; 106 111 … … 165 170 166 171 *hpux*) 167 AC_MSG_RESULT(HPUX has not always h_errno defined)172 AC_MSG_RESULT(HPUX need _XOPEN_SOURCE_EXTENDED for h_errno) 168 173 AC_DEFINE(HOST_IS_HPUX) 169 174 if test "x$GCC" != "xyes"; then … … 204 209 AC_DECL_SYS_SIGLIST 205 210 206 AC_CHECK_HEADERS(stddef.h libgen.h sched.h \ 211 AC_CHECK_HEADERS(stddef.h libgen.h sched.h malloc.h sys/uio.h \ 212 sys/mman.h sys/param.h \ 207 213 sys/vfs.h mntent.h \ 208 214 sys/select.h sys/socket.h netinet/in.h \ … … 275 281 inet_aton gethostbyname setutent setrlimit gethostname uname \ 276 282 initgroups getpagesize \ 277 ttyname fchmod \283 ttyname fchmod writev mmap \ 278 284 getsid getpriority getpgid statvfs \ 279 strerror_r \280 g etgrgid_r getpwnam_r getpwuid_r gmtime_r localtime_r rand_r readdir_r strtok_r285 strerror_r getgrgid_r getpwnam_r getpwuid_r \ 286 gmtime_r localtime_r rand_r readdir_r strtok_r 281 287 ) 282 288 AC_CHECK_FUNC(statfs, AC_DEFINE(HAVE_STATFS) statfs="yes", statfs="no") … … 827 833 AC_SUBST(clmytclient) 828 834 835 sh_no_gcc_static=no 836 829 837 AC_ARG_ENABLE(static, 830 838 [ --enable-static enable static linking [[no]]], … … 838 846 AC_DEFINE(SH_COMPILE_STATIC, 1, [Define if compiling static]) 839 847 if test "x$GCC" = "xyes"; then 848 sh_no_gcc_static=no 840 849 LDFLAGS="$LDFLAGS -static" 841 850 else 851 sh_no_gcc_static=yes 842 852 case "$host_os" in 843 853 … … 887 897 ] 888 898 ) 899 900 if test x$enable_static = xyes; then 901 : 902 else 903 LDFLAGS="$LDFLAGS $PIE_LDFLAGS" 904 CFLAGS="$CFLAGS $PIE_CFLAGS" 905 fi 889 906 890 907 if test x"${mytclient}" = x-DSH_STANDALONE -o x"${mytclient}" = x-DSH_WITH_CLIENT; … … 1386 1403 AC_DEFINE(WITH_TPT) 1387 1404 AC_DEFINE(SL_DEBUG) 1405 AC_DEFINE(DNMALLOC_CHECKS, 1, [Debug dnmalloc]) 1406 AC_DEFINE(PARANOIA, 0, [Paranoia level for dnmalloc]) 1388 1407 AC_DEFINE(SL_FAIL_ON_ERROR) 1389 1408 if test "x${myneedg3}" = "xyes"; then … … 1397 1416 ) 1398 1417 AC_SUBST(mydebugdef) 1418 1419 if test "x${dnmalloc_ok}" = "xyes"; then 1420 sh_dnmalloc_enabled=yes 1421 else 1422 sh_dnmalloc_enabled=no 1423 fi 1424 1425 AC_ARG_ENABLE(dnmalloc, 1426 [ --disable-dnmalloc disable dnmalloc], 1427 [ 1428 if test "x${enable_dnmalloc}" = xno; then 1429 sh_dnmalloc_enabled=no 1430 else 1431 sh_dnmalloc_enabled=yes 1432 fi 1433 ] 1434 ) 1435 1436 dnl Handle the problem that static linking against libc.a on Linux 1437 dnl produces the error "multiple definitions of malloc" 1438 dnl 1439 if test "x$sh_dnmalloc_enabled" = "xyes"; then 1440 if test x$enable_static = xyes; then 1441 if test "x$sh_no_gcc_static" = "xyes"; then 1442 sh_dnmalloc_enabled=no 1443 else 1444 if test "x$with_gnu_ld" = "xyes"; then 1445 LDFLAGS="$LDFLAGS -Wl,--allow-multiple-definition" 1446 else 1447 sh_dnmalloc_enabled=no 1448 fi 1449 fi 1450 fi 1451 fi 1452 1453 if test "x${sh_dnmalloc_enabled}" = xno; then 1454 AC_DEFINE(USE_SYSTEM_MALLOC,1,[Define if you want to use the system malloc]) 1455 fi 1399 1456 1400 1457 AC_ARG_ENABLE(ptrace, -
trunk/depend.dep
r169 r171 64 64 kern_head.o: $(srcsrc)/kern_head.c Makefile config.h $(srcinc)/kern_head.h $(srcinc)/kern_head.h 65 65 sh_string.o: $(srcsrc)/sh_string.c Makefile config_xor.h $(srcinc)/sh_string.h $(srcinc)/sh_mem.h $(srcinc)/CuTest.h 66 dnmalloc-1.0.beta5-rw.o: $(srcsrc)/dnmalloc-1.0.beta5-rw.c Makefile 67 t-test1.o: $(srcsrc)/t-test1.c Makefile config.h $(srcinc)/malloc.h 68 dnmalloc-portable.o: $(srcsrc)/dnmalloc-portable.c Makefile config.h -
trunk/depend.sum
r169 r171 1 38053942391 1541929809 -
trunk/docs/Changelog
r170 r171 1 2.4.4: 1 2.4.5: 2 * handle EINPROGRESS error (Windows/cygwin issue) 3 * make sure every function uses less than one page of stack 4 (proactive security against gap jumping, Gael Delalleau) 5 * use dnmalloc instead of system malloc 6 * fix dnmalloc bugs and portability problems 7 * check for compressBound, since older zlibs don't have it 8 9 2.4.4 (30-04-2008): 2 10 * sh_database.c: fix maximum size of sql query string, maximum 3 11 size of strings in struct dbins_ -
trunk/docs/TODO
r170 r171 1 gcc -g -DDNMALLOC_DEBUG=1 -DUSE_MALLOC_LOCK=1 -Wall -O2 -o dnmalloc-1.0.beta5-rw.o -c src/dnmalloc-1.0.beta5-rw.c 1 2 2 check reported problem with rpmbuild (samhain_setpwd) 3 gcc -g -Wall -O2 -o t-test.o -c src/t-test1.c 4 gcc -g -DUSE_MALLOC_LOCK=1 -Wall -O2 -o dnmalloc-1.0.beta5-rw.o -c src/dnmalloc-1.0.beta5-rw.c 5 gcc -g -lpthread -o t-test t-test.o dnmalloc-1.0.beta5-rw.o 6 ./t-test 7 -
trunk/src/cutest_sh_unix.c
r30 r171 7 7 #include "sh_unix.h" 8 8 9 int malloc_count = 0; 10 11 void Test_dnmalloc (CuTest *tc) { 12 13 const int nalloc = 64 /* original dnmalloc 1.0-beta5 fails fo >= 45 */; 14 int j, i; 15 int sum; 16 int i_malloc = malloc_count; 17 18 char * buf; 19 char * area[256]; 20 21 /* test reuse of last freed chunk */ 22 buf = malloc(1024); 23 CuAssertPtrNotNull(tc, buf); 24 free(buf); 25 area[0] = malloc(1024); 26 CuAssertTrue(tc, buf == area[0]); 27 free(area[0]); 28 29 /* test realloc */ 30 buf = malloc(16); 31 CuAssertPtrNotNull(tc, buf); 32 strcpy(buf, "testing realloc"); 33 buf = realloc(buf, 32); 34 strcat(buf, "testing realloc"); 35 CuAssertStrEquals(tc, "testing realloctesting realloc", buf); 36 37 i_malloc = malloc_count; 38 39 for (j = 0; j < 64; ++j) 40 { 41 buf = malloc((j+1) * 1024); 42 CuAssertPtrNotNull(tc, buf); 43 #ifndef USE_SYSTEM_MALLOC 44 CuAssertIntEquals (tc, malloc_count, (i_malloc + 1)); 45 #endif 46 free(buf); 47 #ifndef USE_SYSTEM_MALLOC 48 CuAssertIntEquals (tc, malloc_count, i_malloc); 49 #endif 50 } 51 52 /* test realloc */ 53 buf = malloc(16); 54 CuAssertPtrNotNull(tc, buf); 55 strcpy(buf, "testing realloc"); 56 buf = realloc(buf, 32); 57 strcat(buf, "testing realloc"); 58 CuAssertStrEquals(tc, "testing realloctesting realloc", buf); 59 60 i_malloc = malloc_count; 61 62 for (j = 0; j < 64; ++j) 63 { 64 buf = calloc(1, (j+1) * 1024); 65 CuAssertPtrNotNull(tc, buf); 66 #ifndef USE_SYSTEM_MALLOC 67 CuAssertIntEquals (tc, malloc_count, (i_malloc + 1)); 68 #endif 69 sum = 0; 70 for (i = 0; i < ((j+1) * 1024); ++i) 71 sum += buf[i]; 72 CuAssertIntEquals (tc, 0, sum); 73 free(buf); 74 #ifndef USE_SYSTEM_MALLOC 75 CuAssertIntEquals (tc, malloc_count, i_malloc); 76 #endif 77 } 78 79 /* test realloc */ 80 buf = malloc(16); 81 CuAssertPtrNotNull(tc, buf); 82 strcpy(buf, "testing realloc"); 83 buf = realloc(buf, 32); 84 strcat(buf, "testing realloc"); 85 CuAssertStrEquals(tc, "testing realloctesting realloc", buf); 86 87 for (j = 0; j < nalloc; ++j) 88 { 89 area[j] = malloc((j+1) * 1024); 90 CuAssertPtrNotNull(tc, area[j]); 91 #ifndef USE_SYSTEM_MALLOC 92 // CuAssertIntEquals (tc, malloc_count, (i_malloc + (j+1))); 93 #endif 94 memset(area[j], (unsigned char) ('a'+1), (j+1) * 1024); 95 } 96 97 i_malloc = malloc_count; 98 99 for (j = 0; j < nalloc; ++j) 100 { 101 sum = 0; 102 for (i = 0; i < ((j+1) * 1024); ++i) 103 sum += area[j][i]; 104 CuAssertIntEquals (tc, sum, ((j+1) * 1024 * ((unsigned char) ('a'+1)))); 105 free(area[j]); 106 #ifndef USE_SYSTEM_MALLOC 107 CuAssertIntEquals (tc, malloc_count, i_malloc - (j+1)); 108 #endif 109 } 110 111 /* test realloc */ 112 buf = malloc(16); 113 CuAssertPtrNotNull(tc, buf); 114 strcpy(buf, "testing realloc"); 115 buf = realloc(buf, 32); 116 strcat(buf, "testing realloc"); 117 CuAssertStrEquals(tc, "testing realloctesting realloc", buf); 118 119 120 for (j = 0; j < 32; ++j) 121 { 122 i_malloc = malloc_count; 123 buf = malloc((j+1) * 1024 * 1024); 124 CuAssertPtrNotNull(tc, buf); 125 for (i = 0; i < 32; ++i) 126 { 127 area[i] = malloc((i+1) * 1024); 128 CuAssertPtrNotNull(tc, area[i]); 129 } 130 free(buf); 131 for (i = 0; i < 32; ++i) 132 { 133 free(area[i]); 134 } 135 #ifndef USE_SYSTEM_MALLOC 136 CuAssertIntEquals (tc, malloc_count, i_malloc); 137 #endif 138 } 139 140 /* test realloc */ 141 buf = malloc(16); 142 CuAssertPtrNotNull(tc, buf); 143 strcpy(buf, "testing realloc"); 144 buf = realloc(buf, 32); 145 strcat(buf, "testing realloc"); 146 CuAssertStrEquals(tc, "testing realloctesting realloc", buf); 147 } 148 149 9 150 void Test_sh_unix_lookup_page (CuTest *tc) { 10 151 -
trunk/src/make-tests.sh
r29 r171 57 57 int main(void) 58 58 { 59 #if !defined(USE_SYSTEM_MALLOC) && defined(USE_MALLOC_LOCK) 60 extern int dnmalloc_pthread_init(void); 61 dnmalloc_pthread_init(); 62 #endif 59 63 int retval; 60 64 retval = RunAllTests(); -
trunk/src/samhain.c
r170 r171 169 169 void sh_g_init(void) 170 170 { 171 #if !defined(USE_SYSTEM_MALLOC) && defined(USE_MALLOC_LOCK) 172 extern int dnmalloc_pthread_init(void); 173 dnmalloc_pthread_init(); 174 #endif 175 171 176 if (0 != pthread_key_create(&g_key, sh_g_destroy)) 172 177 { … … 2152 2157 #endif 2153 2158 2159 #if 0 2160 { 2161 char command[128]; 2162 sprintf(command, "/bin/cat /proc/%d/status", (int) getpid()); 2163 system(command); /* flawfinder: ignore *//* debug code */ 2164 malloc_stats(); 2165 } 2166 #endif 2167 2154 2168 aud_exit (FIL__, __LINE__, EXIT_SUCCESS); 2155 2169 SL_RETURN(0, _("main")); -
trunk/src/samhain_setpwd.c
r170 r171 8 8 #include <unistd.h> 9 9 #include <sys/types.h> 10 #include <signal.h> 10 11 #include <sys/wait.h> 11 12 #include <sys/stat.h> … … 70 71 } 71 72 72 while (nbytes){73 do { 73 74 count = read(fd, &buf[where], nbytes); 74 75 if (count == -1 && errno == EINTR) … … 76 77 where += count; 77 78 nbytes -= count; 78 } while ( count == -1 && errno == EINTR);79 } while (nbytes); 79 80 80 81 close(fd); -
trunk/src/sh_calls.c
r170 r171 183 183 val_retry = 184 184 /*@-unrecog@*/connect(sockfd, serv_addr, addrlen)/*@+unrecog@*/; 185 } while (val_retry < 0 && errno == EINTR);185 } while (val_retry < 0 && (errno == EINTR || errno == EINPROGRESS)); 186 186 } 187 187 -
trunk/src/sh_entropy.c
r170 r171 147 147 struct sockaddr_un addr; 148 148 int addr_len; 149 int retval; 149 150 150 151 #ifdef EGD_SOCKET_NAME … … 184 185 SL_RETURN( -1, _("sh_entropy") ); 185 186 } 186 if( connect( fd, (struct sockaddr*)&addr, addr_len) == -1 ) 187 do { 188 retval = connect(fd, (struct sockaddr *) &sinr, sizeof(sinr)); 189 } while (retval < 0 && (errno == EINTR || errno == EINPROGRESS)); 190 if( retval == -1 ) 187 191 { 188 192 myerror = errno; … … 682 686 status = -1; 683 687 } 688 #if !defined(USE_UNO) 684 689 else if (WIFSIGNALED(status)) 685 690 { … … 692 697 status = -1; 693 698 } 699 #endif 694 700 695 701 source->pipe = NULL; -
trunk/src/sh_files.c
r170 r171 2254 2254 int sh_files_test_double (zAVLTree * firstList, zAVLTree * secondList) 2255 2255 { 2256 int count;2257 2256 int retval = 0; 2258 2259 2257 zAVLCursor cursor; 2260 2261 2258 dirstack_t * first; 2262 2259 … … 2267 2264 if (NULL != zAVLSearch(secondList, first->name)) 2268 2265 { 2269 ++count;2270 2266 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_FI_DOUBLE, 2271 2267 first->name); -
trunk/src/sh_forward.c
r170 r171 2644 2644 sizeof(addr_peer.sin_addr))) 2645 2645 break; 2646 ++i;2647 2646 } 2648 2647 } … … 4916 4915 struct sigaction new_act; 4917 4916 struct sigaction old_act; 4917 4918 int setsize_fd; 4918 4919 4919 4920 SL_ENTER(_("sh_receive")); … … 4946 4947 * The POSIX lower limit on open files seems to be eight. 4947 4948 */ 4948 maxconn = get_open_max() - 6; 4949 maxconn = (((int)FD_SETSIZE) < maxconn) ? FD_SETSIZE : maxconn; 4949 maxconn = get_open_max() - 6; 4950 /* ugly fix for FreeBSD compiler warning; casting FD_SETSIZE in the 4951 * conditional expression does not suppress the warning... */ 4952 setsize_fd = (int)FD_SETSIZE; 4953 maxconn = (setsize_fd < maxconn) ? setsize_fd : maxconn; 4950 4954 4951 4955 if (maxconn < 0 || !sl_ok_muls(maxconn, sizeof(sh_conn_t))) -
trunk/src/sh_getopt.c
r170 r171 315 315 static void sh_getopt_print_log_facilities (void) 316 316 { 317 fputs (_("Compiled-in log facilities:"), stdout); 317 int num = 0; 318 319 fputs (_("Compiled-in log facilities:\n"), stdout); 318 320 319 321 #ifndef DEFAULT_CONSOLE 320 printf (_(" console (/dev/console)")); 322 if (num > 0) fputc ('\n', stdout); 323 printf (_(" console (/dev/console)")); ++num; 321 324 #else 325 if (num > 0) fputc ('\n', stdout); 322 326 if (0 == strcmp (DEFAULT_CONSOLE, _("NULL"))) 323 printf (_(" console (/dev/console)"));327 { printf (_("console (/dev/console)")); ++num; } 324 328 else 325 printf (_(" console (%s)"), DEFAULT_CONSOLE); 326 #endif 327 fputs (_(", syslog"), stdout); 328 printf (_(", logfile (%s)"), DEFAULT_ERRFILE); 329 { printf (_("console (%s)"), DEFAULT_CONSOLE); ++num; } 330 #endif 331 if (num > 0) fputc ('\n', stdout); 332 fputs (_(" syslog"), stdout); ++num; 333 if (num > 0) fputc ('\n', stdout); 334 printf (_(" logfile (%s)"), DEFAULT_ERRFILE); ++num; 329 335 330 336 #if defined(WITH_EXTERNAL) 331 fputs (_(", external program"), stdout); 337 if (num > 0) fputc ('\n', stdout); 338 fputs (_(" external program"), stdout); ++num; 332 339 #endif 333 340 334 341 #if defined(WITH_MESSAGE_QUEUE) 335 fputs (_(", message queue"), stdout); 342 if (num > 0) fputc ('\n', stdout); 343 fputs (_(" message queue"), stdout); ++num; 336 344 #endif 337 345 338 346 #if defined(WITH_DATABASE) 339 fputs (_(", database"), stdout); 347 if (num > 0) fputc ('\n', stdout); 348 fputs (_(" database"), stdout); ++num; 340 349 #ifdef WITH_ODBC 341 350 fputs (_(" (odbc)"), stdout); … … 353 362 354 363 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 355 fputs (_(", server"), stdout); 364 if (num > 0) fputc ('\n', stdout); 365 fputs (_(" server"), stdout); ++num; 356 366 #endif 357 367 358 368 #if defined(SH_WITH_MAIL) 359 fputs (_(", email"), stdout); 369 if (num > 0) fputc ('\n', stdout); 370 fputs (_(" email"), stdout); ++num; 360 371 #endif 361 372 362 373 #ifdef HAVE_LIBPRELUDE 374 if (num > 0) fputc ('\n', stdout); ++num; 363 375 #ifdef HAVE_LIBPRELUDE_8 364 fputs (_(" ,prelude (0.8)"), stdout);376 fputs (_(" prelude (0.8)"), stdout); 365 377 #else 366 fputs (_(", prelude (0.9+)"), stdout); 367 #endif 368 #endif 369 370 fputc ('\n', stdout); 371 return; 372 } 373 374 static void sh_getopt_print_options (void) 375 { 376 int num = 0; 377 378 379 #if defined(SH_STANDALONE) 380 if (num > 0) fputc ('\n', stdout); 381 fputs (_("Standalone executable"), stdout); ++num; 382 #endif 383 #if defined(SH_WITH_CLIENT) 384 if (num > 0) fputc ('\n', stdout); 385 printf (_("Client executable (port %d)"), SH_DEFAULT_PORT); ++num; 386 #endif 387 #if defined(SH_WITH_CLIENT) 388 if (num > 0) fputc ('\n', stdout); 389 printf (_("Server executable (port %d, user %s)"), 390 SH_DEFAULT_PORT, DEFAULT_IDENT); 391 ++num; 392 #endif 393 394 fputs (_(", compiled-in options:"), stdout); 395 396 #if defined(HAVE_EGD_RANDOM) 397 if (num > 0) fputc ('\n', stdout); 398 printf (_(" use entropy gathering daemon (%s)"), EGD_SOCKET_NAME); ++num; 399 #endif 400 #if defined(HAVE_UNIX_RANDOM) 401 if (num > 0) fputc ('\n', stdout); 402 fputs (_(" use unix entropy gatherer"), stdout); ++num; 403 #endif 404 #if defined(HAVE_URANDOM) 405 if (num > 0) fputc ('\n', stdout); 406 printf (_(" use entropy device (%s)"), NAME_OF_DEV_RANDOM); ++num; 407 #endif 408 409 #ifdef WITH_GPG 410 if (num > 0) fputc ('\n', stdout); 411 printf (_(" GnuPG signatures (%s)"), DEFAULT_GPG_PATH); ++num; 412 #ifdef HAVE_GPG_CHECKSUM 413 if (num > 0) fputc ('\n', stdout); 414 printf (_(" -- GnuPG checksum: %s"), GPG_HASH); ++num; 415 #endif 416 #ifdef USE_FINGERPRINT 417 if (num > 0) fputc ('\n', stdout); 418 printf (_(" -- Key fingerprint: %s"), SH_GPG_FP); ++num; 419 #endif 420 #endif 421 422 #if defined(SL_DEBUG) 423 if (num > 0) fputc ('\n', stdout); 424 fputs (_(" debug build (don't use for production)"), stdout); ++num; 425 #endif 426 #if defined(SCREW_IT_UP) 427 if (num > 0) fputc ('\n', stdout); 428 fputs (_(" anti-debugger"), stdout); ++num; 429 #endif 430 #if defined(SH_USE_XML) 431 if (num > 0) fputc ('\n', stdout); 432 fputs (_(" xml log format"), stdout); ++num; 433 #endif 434 #if defined(HAVE_NTIME) 435 if (num > 0) fputc ('\n', stdout); 436 fputs (_(" use time server"), stdout); ++num; 437 #endif 438 439 #if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE) 440 #if defined(HAVE_LIBZ) 441 if (num > 0) fputc ('\n', stdout); 442 fputs (_(" optionally store full text for files"), stdout); ++num; 443 #endif 444 #if defined(USE_XATTR) 445 if (num > 0) fputc ('\n', stdout); 446 fputs (_(" check SELinux attributes"), stdout); ++num; 447 #endif 448 #if defined(USE_ACL) 449 if (num > 0) fputc ('\n', stdout); 450 fputs (_(" check Posix ACLs"), stdout); ++num; 451 #endif 452 #if defined(RELOAD_DATABASE) 453 if (num > 0) fputc ('\n', stdout); 454 fputs (_(" fetch database on reload"), stdout); ++num; 455 #endif 456 #endif 457 458 #if defined(SH_WITH_SERVER) 459 460 #if !defined(HAVE_GETPEEREID) && !defined(SO_PEERCRED) && !defined(HAVE_STRUCT_CMSGCRED) && !defined(HAVE_STRUCT_FCRED) && !(defined(HAVE_STRUCT_SOCKCRED) && defined(LOCAL_CREDS)) 461 if (num > 0) fputc ('\n', stdout); 462 fputs (_(" command socket authentication: use SetSocketPassword"), stdout); 463 ++num; 464 #else 465 if (num > 0) fputc ('\n', stdout); 466 fputs (_(" command socket authentication: use SetSocketAllowUID"), stdout); 467 ++num; 468 #endif 469 470 #if defined(SH_USE_LIBWRAP) 471 if (num > 0) fputc ('\n', stdout); 472 fputs (_(" support tcp wrapper"), stdout); ++num; 473 #endif 474 #if defined(INET_SYSLOG) 475 if (num > 0) fputc ('\n', stdout); 476 fputs (_(" support listening on 514/udp (syslog)"), stdout); ++num; 378 fputs (_(" prelude (0.9+)"), stdout); 477 379 #endif 478 380 #endif … … 484 386 } 485 387 388 static void sh_getopt_print_options (void) 389 { 390 int num = 0; 391 392 393 #if defined(SH_STANDALONE) 394 if (num > 0) fputc ('\n', stdout); 395 fputs (_("Standalone executable"), stdout); ++num; 396 #endif 397 #if defined(SH_WITH_CLIENT) 398 if (num > 0) fputc ('\n', stdout); 399 printf (_("Client executable (port %d)"), SH_DEFAULT_PORT); ++num; 400 #endif 401 #if defined(SH_WITH_CLIENT) 402 if (num > 0) fputc ('\n', stdout); 403 printf (_("Server executable (port %d, user %s)"), 404 SH_DEFAULT_PORT, DEFAULT_IDENT); 405 ++num; 406 #endif 407 408 fputs (_(", compiled-in options:"), stdout); 409 410 #if defined(USE_DL_PREFIX) 411 if (num > 0) fputc ('\n', stdout); 412 printf (_(" using system malloc")); ++num; 413 #else 414 if (num > 0) fputc ('\n', stdout); 415 printf (_(" using dnmalloc")); ++num; 416 #endif 417 418 #if defined(HAVE_EGD_RANDOM) 419 if (num > 0) fputc ('\n', stdout); 420 printf (_(" using entropy gathering daemon (%s)"), EGD_SOCKET_NAME); ++num; 421 #endif 422 #if defined(HAVE_UNIX_RANDOM) 423 if (num > 0) fputc ('\n', stdout); 424 fputs (_(" using unix entropy gatherer"), stdout); ++num; 425 #endif 426 #if defined(HAVE_URANDOM) 427 if (num > 0) fputc ('\n', stdout); 428 printf (_(" using entropy device (%s)"), NAME_OF_DEV_RANDOM); ++num; 429 #endif 430 431 #ifdef WITH_GPG 432 if (num > 0) fputc ('\n', stdout); 433 printf (_(" GnuPG signatures (%s)"), DEFAULT_GPG_PATH); ++num; 434 #ifdef HAVE_GPG_CHECKSUM 435 if (num > 0) fputc ('\n', stdout); 436 printf (_(" -- GnuPG checksum: %s"), GPG_HASH); ++num; 437 #endif 438 #ifdef USE_FINGERPRINT 439 if (num > 0) fputc ('\n', stdout); 440 printf (_(" -- Key fingerprint: %s"), SH_GPG_FP); ++num; 441 #endif 442 #endif 443 444 #if defined(SL_DEBUG) 445 if (num > 0) fputc ('\n', stdout); 446 fputs (_(" debug build (do not use for production)"), stdout); ++num; 447 #endif 448 #if defined(SCREW_IT_UP) 449 if (num > 0) fputc ('\n', stdout); 450 fputs (_(" anti-debugger"), stdout); ++num; 451 #endif 452 #if defined(SH_USE_XML) 453 if (num > 0) fputc ('\n', stdout); 454 fputs (_(" xml log format"), stdout); ++num; 455 #endif 456 #if defined(HAVE_NTIME) 457 if (num > 0) fputc ('\n', stdout); 458 fputs (_(" using time server"), stdout); ++num; 459 #endif 460 461 #if defined(SH_WITH_CLIENT) || defined(SH_STANDALONE) 462 #if defined(HAVE_LIBZ) 463 if (num > 0) fputc ('\n', stdout); 464 fputs (_(" optionally store full text for files"), stdout); ++num; 465 #endif 466 #if defined(USE_XATTR) 467 if (num > 0) fputc ('\n', stdout); 468 fputs (_(" check SELinux attributes"), stdout); ++num; 469 #endif 470 #if defined(USE_ACL) 471 if (num > 0) fputc ('\n', stdout); 472 fputs (_(" check Posix ACLs"), stdout); ++num; 473 #endif 474 #if defined(RELOAD_DATABASE) 475 if (num > 0) fputc ('\n', stdout); 476 fputs (_(" fetch database on reload"), stdout); ++num; 477 #endif 478 #endif 479 480 #if defined(SH_WITH_SERVER) 481 482 #if !defined(HAVE_GETPEEREID) && !defined(SO_PEERCRED) && !defined(HAVE_STRUCT_CMSGCRED) && !defined(HAVE_STRUCT_FCRED) && !(defined(HAVE_STRUCT_SOCKCRED) && defined(LOCAL_CREDS)) 483 if (num > 0) fputc ('\n', stdout); 484 fputs (_(" command socket authentication: use SetSocketPassword"), stdout); 485 ++num; 486 #else 487 if (num > 0) fputc ('\n', stdout); 488 fputs (_(" command socket authentication: use SetSocketAllowUID"), stdout); 489 ++num; 490 #endif 491 492 #if defined(SH_USE_LIBWRAP) 493 if (num > 0) fputc ('\n', stdout); 494 fputs (_(" support tcp wrapper"), stdout); ++num; 495 #endif 496 #if defined(INET_SYSLOG) 497 if (num > 0) fputc ('\n', stdout); 498 fputs (_(" support listening on 514/udp (syslog)"), stdout); ++num; 499 #endif 500 #endif 501 502 if (num == 0) 503 fputs (_(" none"), stdout); 504 fputc ('\n', stdout); 505 return; 506 } 507 486 508 static void sh_getopt_print_modules (void) 487 509 { … … 489 511 int num = 0; 490 512 491 fputs (_("Compiled-in modules: "), stdout);513 fputs (_("Compiled-in modules:\n"), stdout); 492 514 #ifdef SH_USE_UTMP 493 515 if (num > 0) fputc (',', stdout); -
trunk/src/sh_hash.c
r170 r171 1585 1585 { 1586 1586 sl_strlcpy(fullpath, buf->fullpath, MAX_PATH_STORE+1); 1587 /*1588 if (sl_strlen(buf->fullpath) < (MAX_PATH_STORE-3))1589 {1590 fullpath[MAX_PATH_STORE-2] = '\0';1591 fullpath[MAX_PATH_STORE-1] = '\n';1592 }1593 */1594 1587 } 1595 1588 else -
trunk/src/sh_mail.c
r170 r171 1883 1883 } querybuf; 1884 1884 1885 querybuf reply;1885 querybuf * reply; 1886 1886 char expanded[1024]; 1887 1887 unsigned char * comp_dn, * eom; … … 1896 1896 SL_RETURN (NULL, _("get_mx")); 1897 1897 1898 reply = SH_ALLOC(sizeof(querybuf)); 1899 1898 1900 errno = 0; 1899 1901 length = res_query (hostname, C_IN, T_MX, 1900 (unsigned char *) &reply, 4095);1902 (unsigned char *) reply, 4095); 1901 1903 if (length < 1) 1902 1904 { … … 1925 1927 #endif 1926 1928 } 1929 SH_FREE(reply); 1927 1930 SL_RETURN (NULL, _("get_mx")); 1928 1931 } 1929 1932 1930 1933 ret = 0; 1931 header = (HEADER *) &reply;1934 header = (HEADER *) reply; 1932 1935 1933 1936 /* start of data section 1934 1937 */ 1935 comp_dn = (unsigned char *) &reply + HFIXEDSZ;1938 comp_dn = (unsigned char *) reply + HFIXEDSZ; 1936 1939 1937 1940 /* end-of-message 1938 1941 */ 1939 eom = (unsigned char *) &reply + length;1942 eom = (unsigned char *) reply + length; 1940 1943 1941 1944 /* HEADER NAME -- must be skipped or decompressed … … 1958 1961 comp_dn += ret + QFIXEDSZ; 1959 1962 if (ret < 1 || comp_dn >= eom) 1960 SL_RETURN (NULL, _("get_mx")); 1963 { 1964 SH_FREE(reply); 1965 SL_RETURN (NULL, _("get_mx")); 1966 } 1961 1967 } 1962 1968 count = ntohs (header->ancount); 1963 1969 if (count < 1) 1964 SL_RETURN (NULL, _("get_mx")); 1970 { 1971 SH_FREE(reply); 1972 SL_RETURN (NULL, _("get_mx")); 1973 } 1965 1974 1966 1975 retval = SH_ALLOC (sizeof (dnsrep)); 1967 1976 if (!retval) 1968 SL_RETURN (NULL, _("get_mx")); 1977 { 1978 SH_FREE(reply); 1979 SL_RETURN (NULL, _("get_mx")); 1980 } 1981 1969 1982 retval->count = count; 1970 1983 … … 1973 1986 if (!sl_ok_muls(count, sizeof (mx))) 1974 1987 { 1988 SH_FREE(reply); 1975 1989 SH_FREE (retval); 1976 1990 SL_RETURN (NULL, _("get_mx")); … … 1981 1995 if (!result) 1982 1996 { 1997 SH_FREE(reply); 1983 1998 SH_FREE (retval); 1984 1999 SL_RETURN (NULL, _("get_mx")); … … 1995 2010 if (ret < 1 || comp_dn >= eom) 1996 2011 { 2012 SH_FREE(reply); 1997 2013 SH_FREE (result); 1998 2014 SH_FREE (retval); … … 2006 2022 if (type != T_MX || comp_dn >= eom) 2007 2023 { 2024 SH_FREE(reply); 2008 2025 SH_FREE (result); 2009 2026 SH_FREE (retval); … … 2017 2034 if (comp_dn >= eom) 2018 2035 { 2036 SH_FREE(reply); 2019 2037 SH_FREE (result); 2020 2038 SH_FREE (retval); … … 2027 2045 if (comp_dn >= eom) 2028 2046 { 2047 SH_FREE(reply); 2029 2048 SH_FREE (result); 2030 2049 SH_FREE (retval); … … 2038 2057 if (rdlength < 1 || comp_dn >= eom) 2039 2058 { 2059 SH_FREE(reply); 2040 2060 SH_FREE (result); 2041 2061 SH_FREE (retval); … … 2049 2069 if (comp_dn >= eom) 2050 2070 { 2071 SH_FREE(reply); 2051 2072 SH_FREE (result); 2052 2073 SH_FREE (retval); … … 2059 2080 if (ret < 1) 2060 2081 { 2082 SH_FREE(reply); 2061 2083 SH_FREE (result); 2062 2084 SH_FREE (retval); … … 2074 2096 while (ret > 0 && comp_dn < eom && count); 2075 2097 2098 SH_FREE(reply); 2076 2099 SL_RETURN (retval, _("get_mx")); 2077 2100 } -
trunk/src/sh_portcheck.c
r170 r171 687 687 do { 688 688 retval = connect(fd, (struct sockaddr *) &sinr, sizeof(sinr)); 689 } while (retval < 0 && errno == EINTR);689 } while (retval < 0 && (errno == EINTR || errno == EINPROGRESS)); 690 690 691 691 if (retval == -1) … … 775 775 do { 776 776 retval = connect(fd, (struct sockaddr *) &sinr, sizeof(sinr)); 777 } while (retval < 0 && errno == EINTR);777 } while (retval < 0 && (errno == EINTR || errno == EINPROGRESS)); 778 778 779 779 if (retval == -1 && errno == ECONNREFUSED) -
trunk/src/sh_string.c
r169 r171 4 4 #include <string.h> 5 5 #include <stdio.h> 6 #include <sys/types.h> 6 7 7 8 #include "sh_string.h" … … 40 41 /* skip leading WS 41 42 */ 42 for (s=e; *s && isspace( *s); ++s) /* nothing */;43 for (s=e; *s && isspace((int)*s); ++s) /* nothing */; 43 44 44 45 if (*s) … … 65 66 if (a != line) 66 67 { 67 /* chop off trailing WS 68 */ 69 for (a--; isspace(*a) && a > s; a--) /* do nothing */; 70 71 /* terminate string 72 */ 73 ++a; *a = '\0'; 74 } 68 if (i < (maxfields -1)) 69 { 70 71 /* chop off trailing WS 72 */ 73 for (a--; isspace((int)*a) && a > s; a--) /* do nothing */; 74 75 /* terminate string 76 */ 77 ++a; *a = '\0'; 78 } 79 else 80 { 81 /* If nfields < actual fields, last string 82 * will be remainder, therefore skip to end. 83 */ 84 if ( *a ) 85 { 86 do { 87 a++; 88 } while ( *a ); 89 } 90 } 91 } 75 92 else 76 93 { … … 127 144 /* skip leading WS 128 145 */ 129 if ( *s && isspace( *s) )146 if ( *s && isspace((int)*s) ) 130 147 { 131 148 do { 132 149 ++s; 133 } while ( *s && isspace( *s) );150 } while ( *s && isspace((int)*s) ); 134 151 } 135 152 … … 142 159 do { 143 160 a++; 144 } while ( *a && (!isspace( *a)) );161 } while ( *a && (!isspace((int)*a)) ); 145 162 146 163 /* next token, *a is either ws or '\0' … … 152 169 if (i < (maxfields-1)) 153 170 { 154 *a = '\0'; 171 *a = '\0'; 155 172 } 156 173 else … … 275 292 } 276 293 memcpy(s->str, str, (len+1)); 294 s->len = len; 277 295 return s; 278 296 } … … 397 415 sh_string * r = NULL; 398 416 char * p; 417 long tlen; 399 418 size_t len; 400 419 int end = 0; … … 403 422 size_t newlen = 0; 404 423 long diff; 405 int i ;424 int i, curr, last; 406 425 407 426 … … 443 462 } 444 463 445 if (r && ovecnum > 0) 464 465 curr = -1; 466 last = -1; 467 468 for (i = 0; i < ovecnum; ++i) 469 { 470 if (ovector[2*i] >= 0) 471 { 472 curr = i; 473 break; 474 } 475 } 476 477 if (r && ovecnum > 0 && ovector[curr] >= 0) 446 478 { 447 479 r->len = 0; r->str[0] = '\0'; p = r->str; … … 449 481 /* First part, until start of first replacement 450 482 */ 451 memcpy(p, s->str, ovector[0]); p += ovector[0]; 452 memcpy(p, replacement, rlen); p += rlen; 453 *p = '\0'; r->len += (ovector[0] + rlen); 483 memcpy(p, s->str, (size_t)ovector[curr]); p += ovector[curr]; 484 memcpy(p, replacement, rlen); p += rlen; 485 *p = '\0'; r->len += (ovector[curr] + rlen); 486 487 last = curr + 1; 454 488 455 489 for (i = 1; i < ovecnum; ++i) 456 490 { 491 if (ovector[2*i] < 0) 492 continue; 493 494 curr = 2*i; 495 457 496 /* From end of last replacement to start of this */ 458 len = ovector[2*i] - ovector[2*i -1]; 459 memcpy(p, &(s->str[ovector[2*i -1]]), len); 460 p += len; 461 462 /* The replacement */ 463 memcpy(p, replacement, rlen); 464 p += rlen; 465 466 /* null terminate */ 467 *p = '\0'; r->len += (len + rlen); 468 } 497 tlen = (long)(ovector[curr] - ovector[last]); 498 if (tlen >= 0) 499 { 500 len = (size_t) tlen; 501 502 if (tlen > 0) 503 { 504 memcpy(p, &(s->str[ovector[last]]), (size_t)len); 505 p += len; 506 } 507 508 /* The replacement */ 509 memcpy(p, replacement, rlen); 510 p += rlen; 511 512 /* null terminate */ 513 *p = '\0'; r->len += (len + rlen); 514 515 last = curr + 1; 516 } 517 } 469 518 470 519 /* Last part, after last replacement; includes terminating null 471 520 */ 472 len = (s->len + 1) - ovector[2*i -1]; 473 memcpy(p, &(s->str[ovector[2*i -1]]), len); 474 p += len; *p = '\0'; r->len += (len - 1); 475 } 521 if (last > 0) 522 { 523 /* If not, nothing has been replaced, and r is still a copy of s 524 */ 525 tlen = (long)((s->len + 1) - ovector[last]); 526 if (tlen > 0) 527 { 528 len = (size_t)tlen; 529 memcpy(p, &(s->str[ovector[2*i -1]]), (size_t)len); 530 p += len; *p = '\0'; r->len += (len - 1); 531 } 532 } 533 534 } 535 476 536 return r; 477 537 } … … 785 845 t = sh_string_replace(s, ovector, ovecnum, 786 846 "___", 3); 847 CuAssertPtrNotNull(tc, t); 787 848 CuAssertStrEquals(tc, "___c ___ ", t->str); 788 849 CuAssertIntEquals(tc, 9, (int)t->len); … … 792 853 t = sh_string_replace(s, ovector, ovecnum, 793 854 "___", 3); 855 CuAssertPtrNotNull(tc, t); 794 856 CuAssertStrEquals(tc, "___c ___", t->str); 795 857 CuAssertIntEquals(tc, 8, (int)t->len); … … 806 868 "___", 3); 807 869 870 CuAssertPtrNotNull(tc, t); 808 871 CuAssertStrEquals(tc, "______f ghi ", t->str); 809 872 CuAssertIntEquals(tc, 12, (int)t->len); … … 813 876 t = sh_string_replace(s, ovector, ovecnum, 814 877 "___", 3); 878 CuAssertPtrNotNull(tc, t); 815 879 CuAssertStrEquals(tc, "abc ___ef ghi___", t->str); 816 880 CuAssertIntEquals(tc, 16, (int)t->len); … … 818 882 t = sh_string_replace(s, ovector, 0, 819 883 "___", 3); 884 CuAssertPtrNotNull(tc, t); 820 885 CuAssertStrEquals(tc, s->str, t->str); 821 886 CuAssertIntEquals(tc, (int)s->len, (int)t->len); -
trunk/src/sh_tiger0.c
r170 r171 843 843 static const int BLOCKSIZE = 8192; 844 844 struct md5_ctx ctx; 845 char buffer[8264]; /* BLOCKSIZE + 72 AIX compiler chokes */845 char * buffer = SH_ALLOC(8264); /* BLOCKSIZE + 72 AIX compiler chokes */ 846 846 size_t sum; 847 847 … … 870 870 SH_FREE(tmp); 871 871 *Length = 0; 872 SH_FREE(buffer); 872 873 return -1; 873 874 } … … 878 879 879 880 /* Iterate over full file contents. */ 880 while (1 == 1) {881 while (1) { 881 882 /* We read the file in blocks of BLOCKSIZE bytes. One call of the 882 883 computation function processes the whole buffer so that with the … … 894 895 { 895 896 if (sig_termfast == 1) 896 return -1; 897 { 898 SH_FREE(buffer); 899 return -1; 900 } 897 901 TPT((0, FIL__ , __LINE__ , _("msg=<SL_ISERROR (%ld)>\n"), n)); 898 902 tmp = sh_util_safe_name (filename); … … 909 913 SH_FREE(tmp); 910 914 *Length = 0; 915 SH_FREE(buffer); 911 916 return -1; 912 917 } … … 953 958 { 954 959 *Length = 0; 960 SH_FREE(buffer); 955 961 return -1; 956 962 } … … 969 975 970 976 *Length = bcount; 977 SH_FREE(buffer); 971 978 return 0; 972 979 } … … 1367 1374 static const int BLOCKSIZE = 4096; 1368 1375 struct sha_ctx ctx; 1369 char buffer[4168]; /* BLOCKSIZE + 72 AIX compiler chokes */1376 char * buffer = SH_ALLOC(4168); /* BLOCKSIZE + 72 AIX compiler chokes */ 1370 1377 off_t sum = 0; 1371 1378 char * tmp; … … 1393 1400 SH_FREE(tmp); 1394 1401 *Length = 0; 1402 SH_FREE(buffer); 1395 1403 return -1; 1396 1404 } … … 1417 1425 { 1418 1426 if (sig_termfast == 1) 1419 return -1; 1427 { 1428 SH_FREE(buffer); 1429 return -1; 1430 } 1420 1431 1421 1432 TPT((0, FIL__ , __LINE__ , _("msg=<SL_ISERROR (%ld)>\n"), n)); … … 1435 1446 SH_FREE(tmp); 1436 1447 *Length = 0; 1448 SH_FREE(buffer); 1437 1449 return -1; 1438 1450 } … … 1479 1491 { 1480 1492 *Length = 0; 1493 SH_FREE(buffer); 1481 1494 return -1; 1482 1495 } … … 1497 1510 sha_digest (&ctx, resblock); 1498 1511 *Length = bcount; 1512 SH_FREE(buffer); 1499 1513 return 0; 1500 1514 } … … 1505 1519 char * out, size_t len) 1506 1520 { 1507 int cnt = (int) Length; /* fix compiler warning */1521 int cnt; 1508 1522 char outbuf[KEY_LEN+1]; 1509 1523 unsigned char sha1buffer[20]; -
trunk/src/sh_tiger1_64.c
r170 r171 371 371 } 372 372 373 void tiger_compress( word64 *str, word64 state[3])373 void tiger_compress(const word64 *str, word64 state[3]) 374 374 { 375 375 tiger_compress_macro(((word64*)str), ((word64*)state)); 376 376 } 377 377 378 void tiger_t( word64 *str, word64 length, word64 res[3])378 void tiger_t(const word64 *str, word64 length, word64 res[3]) 379 379 { 380 380 register word64 i; -
trunk/src/sh_tools.c
r170 r171 725 725 struct sigaction new_act; 726 726 struct sigaction old_act; 727 #if defined(WITH_TPT)728 727 char errbuf[SH_ERRBUF_SIZE]; 729 #endif730 728 731 729 SL_ENTER(_("sh_write_select")); … … 762 760 continue; 763 761 } 764 if ( errno == EINTR ) /* try again */762 if ( errno == EINTR || errno == EINPROGRESS ) /* try again */ 765 763 continue; 766 764 *w_error = errno; 767 TPT(( 0, FIL__, __LINE__, _("msg=<select: %s>\n"),768 sh_error_message(*w_error, errbuf, sizeof(errbuf))));769 765 sigaction (SIGPIPE, &old_act, NULL); 766 sh_error_message(*w_error, errbuf, sizeof(errbuf)); 767 sh_error_handle (SH_ERR_INFO, FIL__, __LINE__, errno, MSG_E_SUBGEN, 768 errbuf, 769 _("sh_write_select (ws)") ); 770 TPT(( 0, FIL__, __LINE__, _("msg=<select: %s>\n"), errbuf )); 770 771 SL_RETURN( countbytes, _("sh_write_select")); 771 772 } … … 780 781 continue; 781 782 } 782 if ( errno == EINTR ) /* try again */783 if ( errno == EINTR || errno == EINPROGRESS ) /* try again */ 783 784 continue; 784 785 *w_error = errno; 785 TPT(( 0, FIL__, __LINE__, _("msg=<select: %s>\n"),786 sh_error_message(*w_error, errbuf, sizeof(errbuf))));787 786 sigaction (SIGPIPE, &old_act, NULL); 787 sh_error_message(*w_error, errbuf, sizeof(errbuf)); 788 sh_error_handle (SH_ERR_INFO, FIL__, __LINE__, errno, MSG_E_SUBGEN, 789 errbuf, 790 _("sh_write_select (rs)") ); 791 TPT(( 0, FIL__, __LINE__, _("msg=<select: %s>\n"), errbuf )); 788 792 SL_RETURN( countbytes, _("sh_write_select")); 789 793 } … … 836 840 *w_error = errno; 837 841 sigaction (SIGPIPE, &old_act, NULL); 842 sh_error_message(*w_error, errbuf, sizeof(errbuf)); 843 sh_error_handle (SH_ERR_INFO, FIL__, __LINE__, errno, MSG_E_SUBGEN, 844 errbuf, 845 (type == SH_DO_WRITE) ? 846 _("sh_write_select (w)") : _("sh_write_select (r)")); 838 847 TPT(( 0, FIL__, __LINE__, _("msg=<count < 0>\n"))); 839 848 SL_RETURN( countbytes, _("sh_write_select")); -
trunk/src/sh_unix.c
r170 r171 3773 3773 { 3774 3774 #ifdef HAVE_LIBZ 3775 unsigned long clen = compressBound(sh_string_len(content)); 3776 unsigned char * compressed = SH_ALLOC(clen); 3775 unsigned long clen; 3776 unsigned char * compressed; 3777 #ifdef HAVE_COMPRESSBOUND 3778 clen = compressBound(sh_string_len(content)); 3779 #else 3780 if (sh_string_len(content) > 10*SH_TXT_MAX) 3781 clen = SH_TXT_MAX; 3782 else 3783 clen = 13 + (int)(1.0001*sh_string_len(content)); 3784 #endif 3785 compressed = SH_ALLOC(clen); 3777 3786 if (Z_OK == compress(compressed, &clen, 3778 3787 (unsigned char *) sh_string_str(content), -
trunk/src/trustfile.c
r170 r171 782 782 register int i; /* trustworthy or not? */ 783 783 const char * t_const; 784 char *end; 784 785 785 786 /* … … 810 811 if (csym[0] != '/') 811 812 { 813 /* pointer to one above last element 814 */ 815 end = &full[MAXFILENAME-1]; ++end; 816 812 817 /* initialize pointers 813 818 */ … … 817 822 */ 818 823 t = fexp; 819 while(*t && b < &full[MAXFILENAME])824 while(*t && b < end) 820 825 *b++ = *t++; 821 826 … … 823 828 */ 824 829 t_const = "/../"; 825 while(*t && b < &full[MAXFILENAME])830 while(*t && b < end) 826 831 *b++ = *t_const++; 827 832 … … 829 834 */ 830 835 t = csym; 831 while(*t && b < &full[MAXFILENAME])836 while(*t && b < end) 832 837 *b++ = *t++; 833 838 834 839 /* see if we're too big 835 840 */ 836 if (*t || b == &full[MAXFILENAME])841 if (*t || b == end) 837 842 { 838 843 /* yes -- error -
trunk/test/test.sh
r170 r171 363 363 len=`echo "$msg" | awk '/1;30m/ { print length()-10; }; !/1;30m/ { print length();}'` 364 364 let "cols = cols - len" >/dev/null 365 moveto='['$cols'C' 366 echo "${msg}${moveto}${ccode}[${3}]${E}" 365 if [ $cols -ge 0 ]; then 366 moveto='['$cols'C' 367 echo "${msg}${moveto}${ccode}[${3}]${E}" 368 else 369 echo "${msg}${ccode}[${3}]${E}" 370 fi 367 371 fi 368 372 } … … 440 444 rm -f yule.html 441 445 rm -f yule.html2 446 rm -f test_dnmalloc 442 447 } 443 448 -
trunk/test/testcompile.sh
r170 r171 20 20 # 21 21 22 MAXTEST=71; export MAXTEST 22 # dnmalloc + flawfinder + (35 * 3) 23 MAXTEST=107; export MAXTEST 24 25 run_dnmalloc () 26 { 27 fail=0 28 if test x$1 = x0; then 29 [ -z "$verbose" ] || log_msg_ok "configure..."; 30 $MAKE clean > /dev/null 2>> test_log 31 $MAKE test_dnmalloc > /dev/null 2>> test_log 32 if test x$? = x0; then 33 [ -z "$verbose" ] || log_msg_ok "make test_dnmalloc..."; 34 else 35 [ -z "$quiet" ] && log_msg_fail "make test_dnmalloc..."; 36 fail=1 37 fi 38 else 39 [ -z "$quiet" ] && log_msg_fail "configure..."; 40 if [ x"$3" = xskip ]; then 41 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "test dnmalloc"; 42 fi 43 fail=1 44 fi 45 if [ $fail -eq 1 ]; then 46 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "test dnmalloc"; 47 return 1 48 fi 49 # 50 fail=0 51 ./test_dnmalloc >/dev/null 52 if test x$? = x0; then 53 [ -z "$verbose" ] || log_msg_ok "run 1 completed..."; 54 ./test_dnmalloc 300 12 3000 150000 400 >/dev/null 55 if test x$? = x0; then 56 [ -z "$verbose" ] || log_msg_ok "run 2 completed..."; 57 ./test_dnmalloc 1 1 4000 10000000 1000 >/dev/null 58 if test x$? = x0; then 59 [ -z "$verbose" ] || log_msg_ok "run 3 completed..."; 60 ./test_dnmalloc 1 1 4000 10000000 1000 >/dev/null 61 if test x$? = x0; then 62 [ -z "$verbose" ] || log_msg_ok "run 4 completed..."; 63 else 64 fail=1 65 fi 66 else 67 fail=1 68 fi 69 else 70 fail=1 71 fi 72 else 73 fail=1 74 fi 75 # 76 if test x$fail = x0; then 77 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "test dnmalloc"; 78 return 0 79 else 80 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "test dnmalloc"; 81 return 1 82 fi 83 } 84 85 run_uno () 86 { 87 if [ -z "$doall" ]; then 88 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (uno)"; 89 return 0 90 fi 91 # 92 UNO=`find_path uno` 93 # 94 if [ -z "$UNO" ]; then 95 log_skip $num $MAXTEST 'check w/uno (not in PATH)' 96 return 0 97 fi 98 # 99 cd src/ 100 stat=`uno -DUSE_UNO=1 -t -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc-portable.c zAVLTree.c trustfile.c rijndael-*.c bignum.c 2>&1 | wc -l` 101 if [ $stat -ne 1 ]; then 102 uno -DSH_WITH_CLIENT -DSH_WITH_SERVER -DUSE_UNO=1 -t -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc-portable.c zAVLTree.c trustfile.c rijndael-*.c bignum.c >>../test_log 2>&1 103 retval=1 104 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "$TEST (uno)"; 105 else 106 retval=0 107 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "$TEST (uno)"; 108 fi 109 cd .. 110 return $retval 111 } 23 112 24 113 run_flawfinder () … … 45 134 46 135 if [ ! -f "./x_samhain.c.sm" ]; then 47 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (skip sm atch)";136 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "$TEST (skip sm)"; 48 137 return 0 49 138 fi … … 142 231 log_start "COMPILE" 143 232 144 if [ -f /usr/local/gcc-smatch/bin/gcc ]; then 145 SAVE_CC="${CC}" 146 SMATCH="DBGDEF=--smatch"; export SMATCH 147 SAVE_SMATCH="${SMATCH}"; export SAVE_SMATCH 148 CC="/usr/local/gcc-smatch/bin/gcc"; export CC 149 SMATCH_CC="${CC}" 233 if [ "x$doall" = xon ]; then 234 if [ -f /usr/local/gcc-smatch/bin/gcc ]; then # FIXME 235 SAVE_CC="${CC}" 236 SMATCH="DBGDEF=--smatch"; export SMATCH 237 SAVE_SMATCH="${SMATCH}"; export SAVE_SMATCH 238 CC="/usr/local/gcc-smatch/bin/gcc"; export CC 239 SMATCH_CC="${CC}" 240 fi 150 241 fi 151 242 152 243 num=0 153 244 numfail=0 245 246 # 247 # test dnmalloc 248 # 249 TEST="${S}check dnmalloc${E}" 250 # 251 ${TOP_SRCDIR}/configure --quiet > /dev/null 2>> test_log 252 # 253 let "num = num + 1" >/dev/null 254 # 255 run_dnmalloc 0 $num || let "numfail = numfail + 1" >/dev/null 256 # 154 257 155 258 # … … 184 287 let "num = num + 1" >/dev/null 185 288 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 289 let "num = num + 1" >/dev/null 290 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 186 291 187 292 # … … 202 307 let "num = num + 1" >/dev/null 203 308 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 309 let "num = num + 1" >/dev/null 310 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 204 311 # 205 312 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; } … … 219 326 let "num = num + 1" >/dev/null 220 327 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 328 let "num = num + 1" >/dev/null 329 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 221 330 222 331 # … … 235 344 let "num = num + 1" >/dev/null 236 345 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 346 let "num = num + 1" >/dev/null 347 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 237 348 238 349 # … … 251 362 let "num = num + 1" >/dev/null 252 363 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 364 let "num = num + 1" >/dev/null 365 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 253 366 254 367 … … 268 381 let "num = num + 1" >/dev/null 269 382 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 383 let "num = num + 1" >/dev/null 384 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 270 385 271 386 # … … 284 399 let "num = num + 1" >/dev/null 285 400 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 401 let "num = num + 1" >/dev/null 402 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 286 403 287 404 # … … 300 417 let "num = num + 1" >/dev/null 301 418 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null 419 let "num = num + 1" >/dev/null 420 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 302 421 303 422 # … … 323 442 let "num = num + 1" >/dev/null 324 443 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 444 let "num = num + 1" >/dev/null 445 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 325 446 fi 326 447 … … 340 461 let "num = num + 1" >/dev/null 341 462 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 463 let "num = num + 1" >/dev/null 464 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 342 465 343 466 # … … 356 479 let "num = num + 1" >/dev/null 357 480 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 481 let "num = num + 1" >/dev/null 482 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 358 483 359 484 # … … 372 497 let "num = num + 1" >/dev/null 373 498 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 499 let "num = num + 1" >/dev/null 500 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 374 501 375 502 # … … 388 515 let "num = num + 1" >/dev/null 389 516 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 517 let "num = num + 1" >/dev/null 518 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 390 519 391 520 # … … 404 533 let "num = num + 1" >/dev/null 405 534 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 535 let "num = num + 1" >/dev/null 536 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 406 537 407 538 # … … 420 551 let "num = num + 1" >/dev/null 421 552 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 553 let "num = num + 1" >/dev/null 554 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 422 555 423 556 # … … 436 569 let "num = num + 1" >/dev/null 437 570 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 571 let "num = num + 1" >/dev/null 572 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 438 573 439 574 # … … 452 587 let "num = num + 1" >/dev/null 453 588 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 589 let "num = num + 1" >/dev/null 590 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 454 591 455 592 # echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo; … … 470 607 let "num = num + 1" >/dev/null 471 608 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 609 let "num = num + 1" >/dev/null 610 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 472 611 473 612 if test -r "Makefile"; then … … 481 620 let "num = num + 1" >/dev/null 482 621 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 622 let "num = num + 1" >/dev/null 623 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 483 624 484 625 # … … 499 640 let "num = num + 1" >/dev/null 500 641 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 642 let "num = num + 1" >/dev/null 643 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 501 644 502 645 if test -r "Makefile"; then … … 510 653 let "num = num + 1" >/dev/null 511 654 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 655 let "num = num + 1" >/dev/null 656 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 512 657 # 513 658 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; } … … 538 683 let "num = num + 1" >/dev/null 539 684 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 685 let "num = num + 1" >/dev/null 686 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 540 687 # 541 688 if test -r "Makefile"; then … … 549 696 let "num = num + 1" >/dev/null 550 697 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 698 let "num = num + 1" >/dev/null 699 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 551 700 fi 552 701 … … 567 716 let "num = num + 1" >/dev/null 568 717 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 718 let "num = num + 1" >/dev/null 719 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 569 720 # 570 721 if test -r "Makefile"; then … … 578 729 let "num = num + 1" >/dev/null 579 730 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 731 let "num = num + 1" >/dev/null 732 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 580 733 581 734 # … … 594 747 let "num = num + 1" >/dev/null 595 748 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null 749 let "num = num + 1" >/dev/null 750 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 596 751 # 597 752 if test -r "Makefile"; then … … 605 760 let "num = num + 1" >/dev/null 606 761 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null 762 let "num = num + 1" >/dev/null 763 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 607 764 608 765 # … … 621 778 let "num = num + 1" >/dev/null 622 779 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 780 let "num = num + 1" >/dev/null 781 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 623 782 # 624 783 if test -r "Makefile"; then … … 632 791 let "num = num + 1" >/dev/null 633 792 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 793 let "num = num + 1" >/dev/null 794 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 634 795 635 796 # … … 648 809 let "num = num + 1" >/dev/null 649 810 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 811 let "num = num + 1" >/dev/null 812 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 650 813 # 651 814 if test -r "Makefile"; then … … 659 822 let "num = num + 1" >/dev/null 660 823 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 824 let "num = num + 1" >/dev/null 825 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 661 826 662 827 # … … 675 840 let "num = num + 1" >/dev/null 676 841 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null 842 let "num = num + 1" >/dev/null 843 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 677 844 # 678 845 if test -r "Makefile"; then … … 686 853 let "num = num + 1" >/dev/null 687 854 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null 855 let "num = num + 1" >/dev/null 856 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 688 857 689 858 # … … 702 871 let "num = num + 1" >/dev/null 703 872 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 873 let "num = num + 1" >/dev/null 874 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 704 875 # 705 876 if test -r "Makefile"; then … … 713 884 let "num = num + 1" >/dev/null 714 885 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 886 let "num = num + 1" >/dev/null 887 run_uno $? $num || let "numfail = numfail + 1" >/dev/null 715 888 716 889 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; }
Note:
See TracChangeset
for help on using the changeset viewer.