Legend:
- Unmodified
- Added
- Removed
-
trunk/src/samhain.c
r149 r153 1391 1391 my_argv[0] = argv[0]; ++my_argc; 1392 1392 command_line[0] = '\0'; 1393 (void*) fgets (command_line, sizeof(command_line), stdin); 1394 command_line[sizeof(command_line)-1] = '\0'; 1393 if (NULL != fgets (command_line, sizeof(command_line), stdin)) 1394 command_line[sizeof(command_line)-1] = '\0'; 1395 1395 1396 do { 1396 1397 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_STRTOK_R) … … 1961 1962 (void) sh_dirs_chk (1); 1962 1963 #ifndef SH_PROFILE 1963 (void) chdir ("/");1964 (void) retry_aud_chdir (FIL__, __LINE__, "/"); 1964 1965 #endif 1965 1966 } … … 1968 1969 (void) sh_dirs_chk (2); 1969 1970 #ifndef SH_PROFILE 1970 (void) chdir ("/");1971 (void) retry_aud_chdir (FIL__, __LINE__, "/"); 1971 1972 #endif 1972 1973 } -
trunk/src/sh_entropy.c
r147 r153 618 618 } 619 619 620 freopen (_("/dev/null"), "r+", stderr); 620 if (NULL != freopen (_("/dev/null"), "r+", stderr)) 621 { 621 622 622 /* exec the program */ 623 retry_aud_execve (FIL__, __LINE__, _("/bin/sh"), arg, envp); 624 623 /* exec the program */ 624 retry_aud_execve (FIL__, __LINE__, _("/bin/sh"), arg, envp); 625 } 626 625 627 /* failed 626 628 */ -
trunk/src/sh_err_console.c
r137 r153 286 286 struct sigaction sa_new, sa_old; 287 287 static int blockMe = 0; 288 int val_return; 288 289 289 290 SL_ENTER(_("sh_log_console")); … … 315 316 { 316 317 len = strlen(errmsg); 317 (void) write(STDERR_FILENO, errmsg, len); 318 (void) write(STDERR_FILENO, "\n", 1); 318 do { 319 val_return = write(STDERR_FILENO, errmsg, len); 320 } while (val_return < 0 && errno == EINTR); 321 do { 322 val_return = write(STDERR_FILENO, "\n", 1); 323 } while (val_return < 0 && errno == EINTR); 319 324 /* 320 325 * fprintf (stderr, "%s\n", errmsg); … … 367 372 if (fd[cc] >= 0) 368 373 { 369 (void) write(fd[cc], errmsg, strlen(errmsg)); 370 (void) write(fd[cc], "\r\n", 2); 374 do { 375 val_return = write(fd[cc], errmsg, strlen(errmsg)); 376 } while (val_return < 0 && errno == EINTR); 377 do { 378 val_return = write(fd[cc], "\r\n", 2); 379 } while (val_return < 0 && errno == EINTR); 371 380 (void) close(fd[cc]); 372 381 service_failure[cc] = 0; -
trunk/src/sh_err_log.c
r138 r153 392 392 (void) fflush(stdout); 393 393 key[0] = '\0'; 394 (void) fgets(key, sizeof(key), stdin); 395 if (key[0] != '\n') 394 if (NULL != fgets(key, sizeof(key), stdin)) 396 395 { 397 if (key[strlen(key) - 1] == '\n') 398 key[strlen(key) - 1] = '\0'; 399 } 400 if (key[0] == '/') 401 { 402 chk_mode = CHK_FIL; 403 (void) sl_strlcpy(path, key, KEY_LEN+1); 404 break; 396 if (key[0] != '\n') 397 { 398 if (key[strlen(key) - 1] == '\n') 399 key[strlen(key) - 1] = '\0'; 400 } 401 if (key[0] == '/') 402 { 403 chk_mode = CHK_FIL; 404 (void) sl_strlcpy(path, key, KEY_LEN+1); 405 break; 406 } 405 407 } 406 408 } -
trunk/src/sh_gpg.c
r137 r153 489 489 sh_unix_closeall (3, -1); /* in child process */ 490 490 491 freopen(_("/dev/null"), "r+", stderr); 491 if (NULL == freopen(_("/dev/null"), "r+", stderr)) 492 { 493 dlog(1, FIL__, __LINE__, _("Internal error: freopen failed\n")); 494 aud__exit(FIL__, __LINE__, EXIT_FAILURE); 495 } 492 496 493 497 /* We should become privileged if SUID, -
trunk/src/sh_hash.c
r149 r153 459 459 460 460 unlock_and_return: 461 ; /* 'label at end of compound statement */ 461 462 SH_MUTEX_UNLOCK(mutex_hash); 462 463 return retval; … … 1349 1350 1350 1351 unlock_and_return: 1352 ; /* 'label at end of compound statement */ 1351 1353 SH_MUTEX_UNLOCK(mutex_hash); 1352 1354 SL_RET0(_("sh_hash_init")); … … 1377 1379 1378 1380 unlock_and_exit: 1381 ; /* 'label at end of compound statement */ 1379 1382 SH_MUTEX_UNLOCK(mutex_hash); 1380 1383 SL_RET0(_("sh_hash_hashdelete")); … … 1792 1795 sl_write_line_fast (pushdata_fd, attr_string, sl_strlen(attr_string)); 1793 1796 } else { 1794 fwrite (&p, sizeof(sh_filestore_t), 1, stdout); 1795 printf ("%s\n", fullpath); 1796 printf ("%s\n", linkpath); 1797 if (attr_string) 1798 printf ("%s\n", attr_string); 1797 if (fwrite (&p, sizeof(sh_filestore_t), 1, stdout)) 1798 { 1799 printf ("%s\n", fullpath); 1800 printf ("%s\n", linkpath); 1801 if (attr_string) 1802 printf ("%s\n", attr_string); 1803 } 1804 else 1805 { 1806 perror(_("Error writing database")); 1807 aud_exit (FIL__, __LINE__, EXIT_FAILURE); 1808 } 1799 1809 } 1800 1810 … … 2728 2738 2729 2739 char log_policy[32]; 2730 int log_severity;2740 volatile int log_severity; 2731 2741 char hashbuf[KEYBUF_SIZE]; 2732 2742 … … 3504 3514 3505 3515 unlock_and_return: 3506 3516 ; /* 'label at end of compound statement */ 3507 3517 SH_MUTEX_UNLOCK(mutex_hash); 3508 3518 SL_RETURN(retval, _("sh_hash_compdata")); -
trunk/src/sh_mem.c
r149 r153 260 260 void sh_mem_free (void * a, char * file, int line) 261 261 { 262 memlist_t * this = memlist;263 memlist_t * before = memlist;264 unsigned long size= 0;262 volatile memlist_t * this = memlist; 263 memlist_t * before = memlist; 264 unsigned long size = 0; 265 265 266 266 SL_ENTER(_("sh_mem_free")); -
trunk/src/sh_unix.c
r151 r153 411 411 #define STDERR_FILENO 2 412 412 #endif 413 write(STDERR_FILENO, msg, strlen(msg)); 414 write(STDERR_FILENO, "\n", 1); 413 int retval = 0; 414 do { 415 retval = write(STDERR_FILENO, msg, strlen(msg)); 416 } while (retval < 0 && errno == EINTR); 417 do { 418 retval = write(STDERR_FILENO, "\n", 1); 419 } while (retval < 0 && errno == EINTR); 415 420 return 0; 416 421 } … … 468 473 } 469 474 sl_strlcat(msg, details, 128); 470 safe_logger (signal, method, msg);475 (void) safe_logger (signal, method, msg); 471 476 _exit(EXIT_FAILURE); 472 477 } … … 507 512 if (immediate_exit_normal == 2) 508 513 { 509 chdir ("/"); 514 int val_return; 515 516 do { 517 val_return = chdir ("/"); 518 } while (val_return < 0 && errno == EINTR); 519 510 520 safe_logger (mysignal, 0, NULL); 511 521 } … … 3032 3042 { 3033 3043 char hashbuf[KEYBUF_SIZE]; 3044 UINT64 local_length = (UINT64) (tmpFile.size < 0 ? 0 : tmpFile.size); 3034 3045 sl_strlcpy(fileHash, 3035 sh_tiger_generic_hash (filename, fd, &( tmpFile.size),3046 sh_tiger_generic_hash (filename, fd, &(local_length), 3036 3047 alert_timeout, hashbuf, sizeof(hashbuf)), 3037 3048 KEY_LEN+1); -
trunk/src/sh_utmp.c
r149 r153 773 773 static void sh_utmp_addlogin (struct SH_UTMP_S * ut) 774 774 { 775 struct log_user * user = userlist;776 struct log_user * userold = userlist;775 struct log_user * user = userlist; 776 volatile struct log_user * userold = userlist; 777 777 #ifdef HAVE_UTTYPE 778 778 struct log_user * username = userlist; … … 781 781 char ttt[TIM_MAX]; 782 782 #ifdef HAVE_UTTYPE 783 int status;783 volatile int status; 784 784 #endif 785 785
Note:
See TracChangeset
for help on using the changeset viewer.