Changeset 174
- Timestamp:
- Aug 27, 2008, 5:40:28 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r173 r174 13 13 dnl start 14 14 dnl 15 AM_INIT_AUTOMAKE(samhain, 2.4. 5a)15 AM_INIT_AUTOMAKE(samhain, 2.4.6) 16 16 AC_DEFINE([SAMHAIN], 1, [Application is samhain]) 17 17 AC_CANONICAL_HOST -
trunk/docs/Changelog
r173 r174 1 2.4.5a: 1 2.4.6: 2 * fix potential deadlock with dnmalloc upon fork() 3 * fix non-portable use of 'hostname -f' in regression test suite 4 (reported by Borut Podlipnik) 5 6 2.4.5a (18-08-2008): 2 7 * fix compile problem in dnmalloc.c (remove prototypes for 3 8 memset/memcpy), problem reported by Juergen Daubert -
trunk/include/sh_unix.h
r170 r174 209 209 /* close all files >= fd, except possibly one 210 210 */ 211 void sh_unix_closeall (int fd, int except );211 void sh_unix_closeall (int fd, int except, int inchild); 212 212 213 213 -
trunk/include/slib.h
r170 r174 401 401 */ 402 402 int sl_dropall(int fd, int except); 403 int sl_dropall_dirty(int fd, int except); /* don't deallocate */ 403 404 404 405 /* Check whether file is trustworthy. -
trunk/src/dnmalloc.c
r173 r174 1508 1508 pthread_mutex_unlock(&mALLOC_MUTEx); 1509 1509 } 1510 void dnmalloc_fork_child(void) { 1510 void dnmalloc_fork_child(void) { 1511 int rc; 1511 1512 #ifdef __GLIBC__ 1512 1513 if (dnmalloc_use_mutex) 1513 pthread_mutex_init(&mALLOC_MUTEx, NULL); 1514 { 1515 pthread_mutex_unlock (&mALLOC_MUTEx); 1516 pthread_mutex_destroy(&mALLOC_MUTEx); 1517 rc = pthread_mutex_init(&mALLOC_MUTEx, NULL); 1518 } 1514 1519 #else 1515 1520 if (dnmalloc_use_mutex) 1516 pthread_mutex_unlock(&mALLOC_MUTEx); 1517 #endif 1521 rc = pthread_mutex_unlock(&mALLOC_MUTEx); 1522 #endif 1523 if (rc != 0) 1524 { 1525 fputs("fork_child failed", stderr); 1526 _exit(EXIT_FAILURE); 1527 } 1518 1528 } 1519 1529 static int dnmalloc_mutex_lock(pthread_mutex_t *mutex) -
trunk/src/samhain.c
r172 r174 1234 1234 /* --- Close all but first three file descriptors. --- 1235 1235 */ 1236 sh_unix_closeall(3, -1 ); /* at program start */1236 sh_unix_closeall(3, -1, SL_FALSE); /* at program start */ 1237 1237 1238 1238 -
trunk/src/sh_entropy.c
r171 r174 581 581 /* don't leak file descriptors 582 582 */ 583 sh_unix_closeall (3, -1 ); /* in child process */583 sh_unix_closeall (3, -1, SL_TRUE); /* in child process */ 584 584 585 585 /* zero priv info -
trunk/src/sh_extern.c
r170 r174 294 294 */ 295 295 #if !defined(PDGBFILE) 296 sh_unix_closeall (3, task->com_fd ); /* in child process */296 sh_unix_closeall (3, task->com_fd, SL_TRUE); /* in child process */ 297 297 #endif 298 298 -
trunk/src/sh_gpg.c
r170 r174 487 487 /* don't leak file descriptors 488 488 */ 489 sh_unix_closeall (3, -1 ); /* in child process */489 sh_unix_closeall (3, -1, SL_TRUE); /* in child process */ 490 490 491 491 if (NULL == freopen(_("/dev/null"), "r+", stderr)) -
trunk/src/sh_unix.c
r172 r174 1246 1246 #endif 1247 1247 1248 void sh_unix_closeall (int fd, int except )1248 void sh_unix_closeall (int fd, int except, int inchild) 1249 1249 { 1250 1250 int fdx = fd; … … 1281 1281 } 1282 1282 1283 sl_dropall (fdx, except); 1283 if (!inchild) 1284 sl_dropall (fdx, except); 1285 else 1286 sl_dropall_dirty (fdx, except); 1284 1287 1285 1288 SL_RET0(_("sh_unix_closeall")); -
trunk/src/slib.c
r170 r174 2093 2093 (void) free(ofiles[fd]->path); 2094 2094 (void) free(ofiles[fd]); 2095 ofiles[fd] = NULL; 2096 } 2097 ++fd; 2098 } 2099 return 0; 2100 } 2101 2102 int sl_dropall_dirty(int fd, int except) 2103 { 2104 while (fd < MAXFD) 2105 { 2106 if (ofiles[fd] != NULL && fd != except) 2107 { 2095 2108 ofiles[fd] = NULL; 2096 2109 } -
trunk/test/test.sh
r172 r174 482 482 483 483 find_hostname () { 484 tmp=`hostname -f 2>/dev/null` 485 if [ $? -ne 0 ]; then 484 485 uname -a | grep Linux >/dev/null 486 if [ $? -eq 0 ]; then 487 tmp=`hostname -f 2>/dev/null` 488 if [ $? -ne 0 ]; then 489 tmp=`hostname 2>/dev/null` 490 fi 491 else 486 492 tmp=`hostname 2>/dev/null` 487 493 fi
Note:
See TracChangeset
for help on using the changeset viewer.