- Timestamp:
- Jan 20, 2007, 11:04:59 PM (18 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/samhain.c
r84 r86 1443 1443 1444 1444 #if (defined(WITH_GPG) || defined(WITH_PGP)) 1445 /* do nothing -- we exit earlier if error */ 1445 /* log startup */ 1446 sh_gpg_log_startup (); 1446 1447 #else 1447 1448 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_1H, … … 1465 1466 { 1466 1467 #if (defined(WITH_GPG) || defined(WITH_PGP)) 1467 /* do nothing -- we exit earlier if error */ 1468 /* log startup */ 1469 sh_gpg_log_startup (); 1468 1470 #else 1469 1471 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_2H, … … 1476 1478 { 1477 1479 #if (defined(WITH_GPG) || defined(WITH_PGP)) 1478 /* do nothing -- we exit earlier if error */ 1480 /* log startup */ 1481 sh_gpg_log_startup (); 1479 1482 #else 1480 1483 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_1H, -
trunk/src/sh_error.c
r65 r86 110 110 int OnlyStderr = S_TRUE; 111 111 112 /* --- Enable facilities not safe for closeall(). --- 113 */ 114 int enableUnsafe = S_FALSE; 112 115 113 116 /********************************************* … … 145 148 { 146 149 OnlyStderr = flag; 150 return; 151 } 152 153 void sh_error_enable_unsafe (int flag) 154 { 155 enableUnsafe = flag; 147 156 return; 148 157 } … … 1026 1035 /* Full logging enabled. 1027 1036 */ 1028 if (OnlyStderr == BAD) /* full error logging enabled */1037 if (OnlyStderr == S_FALSE) /* full error logging enabled */ 1029 1038 { 1030 1039 … … 1083 1092 class != AUD) 1084 1093 { 1085 if (database_block == 0 )1094 if (database_block == 0 && enableUnsafe == S_TRUE) 1086 1095 { 1087 1096 /* truncates; query_max is 16k … … 1209 1218 ) 1210 1219 { 1211 if (prelude_block == 0 )1220 if (prelude_block == 0 && enableUnsafe == S_TRUE) 1212 1221 { 1213 1222 /* will truncate to 998 bytes -
trunk/src/sh_gpg.c
r34 r86 115 115 116 116 #ifdef GPG_HASH 117 117 118 static int sh_gpg_checksum (SL_TICKET checkfd, int flag) 118 119 { … … 202 203 } 203 204 #endif 205 206 struct startup_info { 207 long line; 208 char * program; 209 long uid; 210 char * path; 211 char * key_uid; 212 char * key_id; 213 }; 214 215 static struct startup_info startInfo = { 0, NULL, 0, NULL, NULL, NULL }; 216 217 void sh_gpg_log_startup () 218 { 219 if (startInfo.program != NULL) 220 { 221 sh_error_handle ((-1), FIL__, startInfo.line, 0, MSG_START_GH, 222 startInfo.program, startInfo.uid, 223 startInfo.path, 224 startInfo.key_uid, startInfo.key_id); 225 } 226 return; 227 } 228 229 static void sh_gpg_fill_startup (long line, char * program, long uid, char * path, 230 char * key_uid, char * key_id) 231 { 232 startInfo.line = line; 233 startInfo.program = sh_util_strdup(program); 234 startInfo.uid = uid; 235 startInfo.path = sh_util_strdup(path); 236 startInfo.key_uid = sh_util_strdup(key_uid); 237 startInfo.key_id = sh_util_strdup(key_id); 238 return; 239 } 204 240 205 241 static FILE * sh_gpg_popen (sh_gpg_popen_t *source, int fd, … … 968 1004 { 969 1005 tmp = sh_util_safe_name(gp.conf_id); 970 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_GH, 1006 sh_gpg_fill_startup ( 1007 /* sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_GH, */ 971 1008 sh.prg_name, sh.real.uid, 972 1009 (sh.flag.hidefile == S_TRUE) ? … … 995 1032 { 996 1033 tmp = sh_util_safe_name(gp.conf_id); 997 sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_GH, 1034 sh_gpg_fill_startup (__LINE__, 1035 /* sh_error_handle ((-1), FIL__, __LINE__, 0, MSG_START_GH, */ 998 1036 sh.prg_name, sh.real.uid, 999 1037 (sh.flag.hidefile == S_TRUE) ? -
trunk/src/sh_prelude.c
r40 r86 967 967 } 968 968 969 969 /* Allow initialization of prelude; to be called 970 * after forking the daemon. Delays heartbeat 971 * start after config read until it is safe. 972 */ 970 973 void sh_prelude_reset(void) 971 974 { -
trunk/src/sh_unix.c
r84 r86 1880 1880 } 1881 1881 1882 sh_error_enable_unsafe (S_TRUE); 1882 1883 #if defined(HAVE_LIBPRELUDE) 1883 1884 sh_prelude_reset (); … … 1913 1914 { 1914 1915 sh_unix_closeall(3, -1); /* if not daemon */ 1916 sh_error_enable_unsafe (S_TRUE); 1915 1917 #if defined(HAVE_LIBPRELUDE) 1916 1918 sh_prelude_reset ();
Note:
See TracChangeset
for help on using the changeset viewer.