Changeset 207
- Timestamp:
- Jan 16, 2009, 11:52:26 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r205 r207 1229 1229 if test -z "$PGSQL_DIR"; then 1230 1230 for i in $pgsql_directory; do 1231 if test -r $i/include/postgresql/libpq-fe.h; then 1232 PGSQL_INC_DIR=$i/include 1233 PGSQL_DIR=$i 1234 fi 1235 done 1236 fi 1237 if test -z "$PGSQL_DIR"; then 1238 for i in $pgsql_directory; do 1231 1239 if test -r $i/include/libpq-fe.h; then 1232 1240 PGSQL_INC_DIR=$i/include … … 1239 1247 tmp="" 1240 1248 for i in $pgsql_directory; do 1241 tmp="$tmp $i/include $i/include/pgsql "1249 tmp="$tmp $i/include $i/include/pgsql $i/include/postgresql" 1242 1250 done 1243 1251 FAIL_MESSAGE("PostgreSQL header file (libpq-fe.h)", $tmp) 1244 1252 fi 1245 1253 1246 for i in lib lib/pgsql ; do1254 for i in lib lib/pgsql lib/postgresql; do 1247 1255 str="$PGSQL_DIR/$i/libpq.*" 1248 1256 for j in `echo $str`; do … … 1256 1264 if test -z "$PGSQL_LIB_DIR"; then 1257 1265 for ff in $pgsql_directory; do 1258 for i in lib lib/pgsql ; do1266 for i in lib lib/pgsql lib/postgresql; do 1259 1267 str="$ff/$i/libpq.*" 1260 1268 for j in `echo $str`; do … … 1271 1279 tmp="" 1272 1280 for i in $pgsql_directory; do 1273 tmp="$i/lib $i/lib/pgsql "1281 tmp="$i/lib $i/lib/pgsql $i/lib/postgresql" 1274 1282 done 1275 1283 FAIL_MESSAGE("postgresql library libpq", $tmp) … … 1287 1295 CPPFLAGS="$CPPFLAGS -I${PGSQL_INC_DIR}" 1288 1296 AC_CHECK_HEADERS(pgsql/libpq-fe.h) 1297 AC_CHECK_HEADERS(postgresql/libpq-fe.h) 1289 1298 else 1290 1299 pg_lib_dir=`${PGCONF} --libdir` -
trunk/docs/Changelog
r206 r207 1 1 2.5.2: 2 * samhain.c: report module failure with positive offset 3 * sh_database.c: parse numerical fields into ulong 4 * fix regression test script for postgresql 5 * fix regression test script for SELinux/ACL test 2 6 * fix reporting of user for open ports to prelude 3 7 * report process pid for open ports … … 7 11 * improved help output of samhain_stealth (as suggested 8 12 by Michael Athanasiou) 9 * new option ProcessCheckIsOpen vz([false]/true)13 * new option ProcessCheckIsOpenVZ ([false]/true) 10 14 11 15 2.5.1: -
trunk/include/samhain.h
r170 r207 138 138 #define SH_MOD_ACTIVE 0 139 139 #define SH_MOD_FAILED -1 140 #define SH_MOD_OFFSET 10 140 141 141 142 /* Flags for file status -
trunk/src/samhain.c
r203 r207 1664 1664 MSG_MOD_FAIL, 1665 1665 _(modList[modnum].name), 1666 status );1666 status+SH_MOD_OFFSET); 1667 1667 } else { 1668 1668 sh_error_handle ((-1), FIL__, __LINE__, status, MSG_MOD_FAIL, 1669 1669 _(modList[modnum].name), 1670 status );1670 status+SH_MOD_OFFSET); 1671 1671 } 1672 1672 modList[modnum].initval = SH_MOD_FAILED; … … 1832 1832 status, MSG_MOD_FAIL, 1833 1833 _(modList[modnum].name), 1834 status );1834 status+SH_MOD_OFFSET); 1835 1835 } else { 1836 1836 sh_error_handle ((-1), FIL__, __LINE__, 1837 1837 status, MSG_MOD_FAIL, 1838 1838 _(modList[modnum].name), 1839 status );1839 status+SH_MOD_OFFSET); 1840 1840 } 1841 1841 modList[modnum].initval = SH_MOD_FAILED; … … 2073 2073 if (0 != (status = modList[modnum].mod_check())) 2074 2074 sh_error_handle ((-1), FIL__, __LINE__, status, MSG_MOD_EXEC, 2075 _(modList[modnum].name), (long) status);2075 _(modList[modnum].name), (long) (status+SH_MOD_OFFSET)); 2076 2076 } 2077 2077 -
trunk/src/sh_database.c
r170 r207 112 112 char acl_new[1024]; 113 113 114 longlong_data[20];114 unsigned long ulong_data[20]; 115 115 116 116 /* … … 870 870 ******************************************************************/ 871 871 872 #if def HAVE_PGSQL_LIBPQ_FE_H872 #if defined(HAVE_PGSQL_LIBPQ_FE_H) 873 873 #include <pgsql/libpq-fe.h> 874 #elif defined(HAVE_POSTGRESQL_LIBPQ_FE_H) 875 #include <postgresql/libpq-fe.h> 874 876 #else 877 #if !defined(USE_UNO) 875 878 #include <libpq-fe.h> 879 #else 880 #include <postgresql/libpq-fe.h> 881 #endif 876 882 #endif 877 883 … … 1395 1401 { 1396 1402 (void) 1397 sl_snprintf(end, (size_t)(size-1), _(",\'%l d\'"),1398 db_entry-> long_data[attr_tab[i].val-START_SEC_LONGS]);1403 sl_snprintf(end, (size_t)(size-1), _(",\'%lu\'"), 1404 db_entry->ulong_data[attr_tab[i].val-START_SEC_LONGS]); 1399 1405 while (*end != '\0') { ++end; --size; } 1400 1406 (void) sl_snprintf(c_end, (size_t)(c_size-1), … … 1406 1412 (void) 1407 1413 md5Update(&crc, 1408 (sh_byte *) db_entry-> long_data[attr_tab[i].val-START_SEC_LONGS],1414 (sh_byte *) db_entry->ulong_data[attr_tab[i].val-START_SEC_LONGS], 1409 1415 sizeof(long)); 1410 1416 /*@+type@*/ … … 1718 1724 else if (res->val >= START_SEC_LONGS) 1719 1725 { 1720 db_entry->long_data[res->val-START_SEC_LONGS] 1721 = atol(&p[j+2]); 1726 db_entry->ulong_data[res->val-START_SEC_LONGS] 1727 = strtoul(&p[j+2], (char **) NULL, 10); 1728 /* atol(&p[j+2]); */ 1722 1729 } 1723 1730 -
trunk/test/testrun_1.sh
r172 r207 190 190 # 191 191 TESTPOLICY_11=" 192 [Misc] 193 UseAclCheck=yes 194 UseSelinuxCheck=yes 192 195 [ReadOnly] 193 196 dir=99${BASE} … … 231 234 232 235 TESTPOLICY_10=" 236 [Misc] 237 UseAclCheck=yes 238 UseSelinuxCheck=yes 233 239 [ReadOnly] 234 240 dir=99${BASE} … … 253 259 # CDIRS="a b c a/a a/b a/c a/a/a a/a/b a/a/c a/a/a/a a/a/a/b a/a/a/c"; 254 260 tmp=`grep CRIT $LOGFILE | wc -l` 255 if [ $tmp -ne 3]; then261 if [ $tmp -ne 5 ]; then 256 262 [ -z "$verbose" ] || log_msg_fail "policy count"; 257 263 return 1 … … 1241 1247 let "tcount = tcount + 1" >/dev/null 1242 1248 # 1243 if [ -z "$doall" -a $tcount -eq 10 ]; then 1244 log_skip 10 $MAXTEST 'ACL/SELinux test (or use --really-all)' 1245 let "tcount = tcount + 1" >/dev/null 1246 fi 1247 # 1248 if [ -z "$doall" -a $tcount -eq 11 ]; then 1249 log_skip 11 $MAXTEST 'ACL/SELinux test (or use --really-all)' 1250 let "tcount = tcount + 1" >/dev/null 1249 if [ $tcount -eq 10 ]; then 1250 if [ -z "$doall" ]; then 1251 log_skip 10 $MAXTEST 'ACL/SELinux test (or use --really-all)' 1252 log_skip 11 $MAXTEST 'ACL/SELinux test (or use --really-all)' 1253 let "tcount = tcount + 2" >/dev/null 1254 else 1255 # 'id -u' is posix 1256 # 1257 if test -f /usr/xpg4/bin/id 1258 then 1259 my_uid=`/usr/xpg4/bin/id -u` 1260 else 1261 my_uid=`id -u` 1262 fi 1263 # 1264 if [ ${my_uid} -ne 0 ]; then 1265 log_skip 10 $MAXTEST 'ACL/SELinux test (you are not root)' 1266 log_skip 11 $MAXTEST 'ACL/SELinux test (you are not root)' 1267 let "tcount = tcount + 2" >/dev/null 1268 else 1269 1270 SETFATTR=`find_path setfattr` 1271 if [ -z "$SETFATTR" ]; then 1272 log_skip 10 $MAXTEST 'ACL/SELinux test (setfattr not in path)' 1273 log_skip 11 $MAXTEST 'ACL/SELinux test (setfattr not in path)' 1274 let "tcount = tcount + 2" >/dev/null 1275 fi 1276 fi 1277 fi 1251 1278 fi 1252 1279 # -
trunk/test/testrun_2a.sh
r172 r207 221 221 cp ./testrc_2 ./rc.${SH_LOCALHOST} 222 222 mv ./.samhain_file ./file.${SH_LOCALHOST} 223 chmod 644 ./rc.${SH_LOCALHOST} 224 chmod 644 ./file.${SH_LOCALHOST} 223 225 224 226 ALTHOST=`find_hostname` 225 227 cp ./testrc_2 "./rc.${ALTHOST}" 226 228 cp ./file.${SH_LOCALHOST} "./file.${ALTHOST}" 2>/dev/null 229 chmod 644 ./rc.${ALTHOST} 230 chmod 644 ./file.${ALTHOST} 227 231 } 228 232 -
trunk/test/testrun_2d.sh
r170 r207 38 38 # PGPASSWORD=samhain; export PGPASSWORD 39 39 create_pgpass 40 psql - U samhain -d samhain -c "SELECT * FROM log WHERE entry_status = 'NEW' and log_time > '${DATE}';" >test_log_db40 psql -o test_log_db -U samhain -d samhain -c "SELECT * FROM log WHERE entry_status = 'NEW' and log_time > '${DATE}';" 41 41 # 42 42 egrep "START.*Yule" test_log_db >/dev/null 2>&1 43 43 if [ $? -ne 0 ]; then 44 [ -z "$verbose" ] || log_msg_fail "Server start ";44 [ -z "$verbose" ] || log_msg_fail "Server start (psql)"; 45 45 return 1 46 46 fi 47 47 egrep "NEW CLIENT" test_log_db >/dev/null 2>&1 48 48 if [ $? -ne 0 ]; then 49 [ -z "$verbose" ] || log_msg_fail "Client connect ";49 [ -z "$verbose" ] || log_msg_fail "Client connect (psql)"; 50 50 return 1 51 51 fi 52 52 egrep "Checking.*/bin" test_log_db >/dev/null 2>&1 53 53 if [ $? -ne 0 ]; then 54 [ -z "$verbose" ] || log_msg_fail "Client file check ";54 [ -z "$verbose" ] || log_msg_fail "Client file check (psql)"; 55 55 return 1 56 56 fi 57 57 egrep "EXIT.*Samhain" test_log_db >/dev/null 2>&1 58 58 if [ $? -ne 0 ]; then 59 [ -z "$verbose" ] || log_msg_fail "Client exit ";59 [ -z "$verbose" ] || log_msg_fail "Client exit (psql)"; 60 60 return 1 61 61 fi 62 62 egrep "EXIT.*Yule.*SIGTERM" test_log_db >/dev/null 2>&1 63 63 if [ $? -ne 0 ]; then 64 [ -z "$verbose" ] || log_msg_fail "Server exit ";64 [ -z "$verbose" ] || log_msg_fail "Server exit (psql)"; 65 65 return 1 66 66 fi
Note:
See TracChangeset
for help on using the changeset viewer.