From: Russ Combs Date: Sat, 4 Oct 2014 03:05:31 +0000 (-0400) Subject: removed ! from error messages X-Git-Tag: 3.0.0-233~1397^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=95b80a4a10429c87fa25ee6bf5bdd3d16f5e5dbd;p=thirdparty%2Fsnort3.git removed ! from error messages --- diff --git a/ChangeLog b/ChangeLog index bb32f8f60..36e07e6c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ -- disabled markup sanitizer() for correct asciidoc results -- tweaked snort.lua and snort_defaults.lua -- updated usage +-- removed ! from error messages 122 -- pulled thread pinning from Josh diff --git a/doc/style.txt b/doc/style.txt index 04cdb5cb5..9c80b6bfc 100644 --- a/doc/style.txt +++ b/doc/style.txt @@ -42,6 +42,10 @@ yet firm so feedback is welcome to get something we can live with. * Most debug messages should just be deleted. +* Don't bang your messages (no !). The user feels bad enough about the + problem already w/o you shouting at him. + + ==== Types * Use logical types to make the code clearer and to help the compiler catch diff --git a/src/codecs/link/cd_ppp_encap.cc b/src/codecs/link/cd_ppp_encap.cc index 961287037..0c820d569 100644 --- a/src/codecs/link/cd_ppp_encap.cc +++ b/src/codecs/link/cd_ppp_encap.cc @@ -118,7 +118,7 @@ bool PppEncap::decode(const RawData& raw, CodecData& codec, DecodeData&) case PPP_VJ_COMP: if (!had_vj) ErrorMessage("PPP link seems to use VJ compression, " - "cannot handle compressed packets!\n"); + "cannot handle compressed packets\n"); had_vj = true; return false; case PPP_VJ_UCOMP: @@ -127,7 +127,7 @@ bool PppEncap::decode(const RawData& raw, CodecData& codec, DecodeData&) if(raw.len < (uint32_t)(codec.lyr_len + ip::IP4_HEADER_LEN)) { if (ScLogVerbose()) - ErrorMessage("PPP VJ min packet length > captured len! " + ErrorMessage("PPP VJ min packet length > captured len" "(%d bytes)\n", raw.len); return false; } diff --git a/src/codecs/root/root_enc.cc b/src/codecs/root/root_enc.cc index bb7d088f3..233f1ea6c 100644 --- a/src/codecs/root/root_enc.cc +++ b/src/codecs/root/root_enc.cc @@ -71,7 +71,7 @@ void DecodeEncPkt(Packet *p, const DAQ_PktHdr_t *pkthdr, const uint8_t *pkt) { if (ScLogVerbose()) { - ErrorMessage("Captured data length < Encap header length! (%d bytes)\n", + ErrorMessage("Captured data length < Encap header length (%d bytes)\n", cap_len); } MODULE_PROFILE_END(decodePerfStats); diff --git a/src/codecs/root/root_fddi.cc b/src/codecs/root/root_fddi.cc index 4bfed1d7a..5b3354bd5 100644 --- a/src/codecs/root/root_fddi.cc +++ b/src/codecs/root/root_fddi.cc @@ -103,7 +103,7 @@ void DecodeFDDIPkt(Packet * p, const DAQ_PktHdr_t * pkthdr, const uint8_t * pkt) { if (ScLogVerbose()) { - ErrorMessage("Captured data length < FDDI header length! " + ErrorMessage("Captured data length < FDDI header length " "(%d %d bytes)\n", cap_len, dataoff); MODULE_PROFILE_END(decodePerfStats); return; @@ -129,7 +129,7 @@ void DecodeFDDIPkt(Packet * p, const DAQ_PktHdr_t * pkthdr, const uint8_t * pkt) { if (ScLogVerbose()) { - ErrorMessage("Captured data length < FDDI header length! " + ErrorMessage("Captured data length < FDDI header length " "(%d %d bytes)\n", cap_len, dataoff); MODULE_PROFILE_END(decodePerfStats); return; @@ -147,7 +147,7 @@ void DecodeFDDIPkt(Packet * p, const DAQ_PktHdr_t * pkthdr, const uint8_t * pkt) { if (ScLogVerbose()) { - ErrorMessage("Captured data length < FDDI header length! " + ErrorMessage("Captured data length < FDDI header length " "(%d %d bytes)\n", cap_len, dataoff); MODULE_PROFILE_END(decodePerfStats); return; @@ -167,7 +167,7 @@ void DecodeFDDIPkt(Packet * p, const DAQ_PktHdr_t * pkthdr, const uint8_t * pkt) { if (ScLogVerbose()) { - ErrorMessage("Captured data length < FDDI header length! " + ErrorMessage("Captured data length < FDDI header length " "(%d %d bytes)\n", cap_len, dataoff); MODULE_PROFILE_END(decodePerfStats); return; diff --git a/src/codecs/root/root_oldpflog.cc b/src/codecs/root/root_oldpflog.cc index 75ac0b81f..20198a87a 100644 --- a/src/codecs/root/root_oldpflog.cc +++ b/src/codecs/root/root_oldpflog.cc @@ -68,7 +68,7 @@ void DecodeOldPflog(Packet * p, const DAQ_PktHdr_t * pkthdr, const uint8_t * pkt { if (ScLogVerbose()) { - ErrorMessage("Captured data length < Pflog header length! " + ErrorMessage("Captured data length < Pflog header length " "(%d bytes)\n", cap_len); } MODULE_PROFILE_END(decodePerfStats); diff --git a/src/codecs/root/root_pflog.cc b/src/codecs/root/root_pflog.cc index 9880fe5c6..a4ac51399 100644 --- a/src/codecs/root/root_pflog.cc +++ b/src/codecs/root/root_pflog.cc @@ -179,7 +179,7 @@ void DecodePflog(Packet * p, const DAQ_PktHdr_t * pkthdr, const uint8_t * pkt) { if (ScLogVerbose()) { - ErrorMessage("Captured data length < minimum Pflog length! " + ErrorMessage("Captured data length < minimum Pflog length " "(%d < %lu)\n", cap_len, (unsigned long)PFLOG2_HDRMIN); } MODULE_PROFILE_END(decodePerfStats); @@ -211,7 +211,7 @@ void DecodePflog(Packet * p, const DAQ_PktHdr_t * pkthdr, const uint8_t * pkt) default: if (ScLogVerbose()) { - ErrorMessage("unrecognized pflog header length! (%d)\n", + ErrorMessage("unrecognized pflog header length (%d)\n", *((uint8_t*)pkt)); } dc.discards++; @@ -224,7 +224,7 @@ void DecodePflog(Packet * p, const DAQ_PktHdr_t * pkthdr, const uint8_t * pkt) { if (ScLogVerbose()) { - ErrorMessage("Captured data length < Pflog header length! " + ErrorMessage("Captured data length < Pflog header length " "(%d < %d)\n", cap_len, hlen); } dc.discards++; @@ -236,7 +236,7 @@ void DecodePflog(Packet * p, const DAQ_PktHdr_t * pkthdr, const uint8_t * pkt) { if (ScLogVerbose()) { - ErrorMessage("Bad Pflog header length! (%d bytes)\n", pflen); + ErrorMessage("Bad Pflog header length (%d bytes)\n", pflen); } dc.discards++; MODULE_PROFILE_END(decodePerfStats); diff --git a/src/detection/detection_options.cc b/src/detection/detection_options.cc index 37cfbc7df..e26de90cb 100644 --- a/src/detection/detection_options.cc +++ b/src/detection/detection_options.cc @@ -478,7 +478,8 @@ int detection_option_node_evaluate( if (otn->sigInfo.num_services && check_ports) /* none of the services match */ { - DEBUG_WRAP(DebugMessage(DEBUG_DETECT, "[**] SID %d not matched because of service mismatch (%d!=%d [**]\n", + DEBUG_WRAP(DebugMessage(DEBUG_DETECT, + "[**] SID %d not matched because of service mismatch (%d!=%d [**]\n", otn->sigInfo.id, eval_data->p->application_protocol_ordinal, otn->sigInfo.services[0].service_ordinal);); diff --git a/src/detection/fpcreate.cc b/src/detection/fpcreate.cc index 5f361662c..a5e89e184 100644 --- a/src/detection/fpcreate.cc +++ b/src/detection/fpcreate.cc @@ -1856,7 +1856,7 @@ static int fpCreatePortGroups( /* convert the tcp-any-any to a PortObject2 creature */ po2 = PortObject2Dup(p->tcp_anyany); if (po2 == NULL) - FatalError("Could not create a PortObject version 2 for tcp-any-any rules\n!"); + FatalError("Could not create a PortObject version 2 for tcp-any-any rules\n"); if (!fpDetectSplitAnyAny(fp)) add_any_any = po2; @@ -1899,7 +1899,7 @@ static int fpCreatePortGroups( /* UDP */ po2 = PortObject2Dup(p->udp_anyany); if (po2 == NULL ) - FatalError("Could not create a PortObject version 2 for udp-any-any rules\n!"); + FatalError("Could not create a PortObject version 2 for udp-any-any rules\n"); if (!fpDetectSplitAnyAny(fp)) add_any_any = po2; @@ -1940,7 +1940,7 @@ static int fpCreatePortGroups( /* ICMP */ po2 = PortObject2Dup(p->icmp_anyany); if (po2 == NULL) - FatalError("Could not create a PortObject version 2 for icmp-any-any rules\n!"); + FatalError("Could not create a PortObject version 2 for icmp-any-any rules\n"); if (!fpDetectSplitAnyAny(fp)) add_any_any = po2; @@ -1981,7 +1981,7 @@ static int fpCreatePortGroups( /* IP */ po2 = PortObject2Dup(p->ip_anyany); if (po2 == NULL) - FatalError("Could not create a PortObject version 2 for ip-any-any rules\n!"); + FatalError("Could not create a PortObject version 2 for ip-any-any rules\n"); if (!fpDetectSplitAnyAny(fp)) add_any_any = po2; @@ -2217,7 +2217,7 @@ void fpBuildServicePortGroups( id = AddProtocolReference(srvc); if(id <=0 ) - FatalError("Could not AddProtocolReference!\n"); + FatalError("Could not AddProtocolReference\n"); else if( id >= MAX_PROTOCOL_ORDINAL ) ParseWarning("protocol-ordinal=%d exceeds " @@ -2237,12 +2237,12 @@ void fpBuildServicePortGroups( else /* id < 0 */ { ParseError("adding protocol-ordinal=%d for " - "service=%s, can't use that !!!\n",id,srvc); + "service=%s, can't use that\n",id,srvc); } } else { - ParseError("*** failed to create and find a port group for '%s' !!! \n",srvc ); + ParseError("*** failed to create and find a port group for '%s'\n",srvc ); } } } diff --git a/src/file_api/libs/file_config.cc b/src/file_api/libs/file_config.cc index 1c892b973..aed7bb1ac 100644 --- a/src/file_api/libs/file_config.cc +++ b/src/file_api/libs/file_config.cc @@ -607,7 +607,7 @@ void parse_file_rule(const char *args, void **conf) if (file_config->FileRules[rule->id]) { - ParseError("file type: duplicated rule id %d defined!", rule->id); + ParseError("file type: duplicated rule id %d defined", rule->id); free(rule); return; } diff --git a/src/file_api/libs/file_lib.cc b/src/file_api/libs/file_lib.cc index 2e1079cbb..02c91cd05 100644 --- a/src/file_api/libs/file_lib.cc +++ b/src/file_api/libs/file_lib.cc @@ -226,7 +226,7 @@ const char* file_info_from_ID(void* conf, uint32_t id) RuleInfo *info; if (SNORT_FILE_TYPE_UNKNOWN == id) - return "Unknown file type, done!"; + return "Unknown file type, done"; else if (SNORT_FILE_TYPE_CONTINUE == id) return "Undecided file type, continue..."; diff --git a/src/hash/sfxhash.cc b/src/hash/sfxhash.cc index ac11faa03..40275a21f 100644 --- a/src/hash/sfxhash.cc +++ b/src/hash/sfxhash.cc @@ -1257,7 +1257,7 @@ int main ( int argc, char ** argv ) 1); /* Recycle nodes */ if(!t) { - printf("Low Memory!\n"); + printf("Low Memory\n"); exit(0); } /* Add Nodes to the Hash Table */ @@ -1301,7 +1301,7 @@ int main ( int argc, char ** argv ) */ if( sfxhash_remove(t,n->key) ) { - printf("...ERROR: Could not remove the key node!\n"); + printf("...ERROR: Could not remove the key node\n"); } else { diff --git a/src/ips_options/asn1_util.cc b/src/ips_options/asn1_util.cc index 9600e5b27..1045006c1 100644 --- a/src/ips_options/asn1_util.cc +++ b/src/ips_options/asn1_util.cc @@ -1012,7 +1012,7 @@ int asn1_print_types(ASN1_TYPE *asn1_type, void *user) printf("\n"); //if(BitStringOverflow(asn1_type)) //{ - // printf("!! BITSTRING OVERFLOW\n"); + // printf("BITSTRING OVERFLOW\n"); //} printf("\n"); diff --git a/src/ips_options/ips_content.cc b/src/ips_options/ips_content.cc index 406d5bb03..22cbf0f81 100644 --- a/src/ips_options/ips_content.cc +++ b/src/ips_options/ips_content.cc @@ -585,7 +585,7 @@ static void parse_depth(PatternMatchData* pmd, const char *data) /* check to make sure that this the depth allows this rule to fire */ if (pmd->depth < (int)pmd->pattern_size) { - ParseError("the depth (%d) is less than the size of the content(%u)!", + ParseError("the depth (%d) is less than the size of the content(%u)", pmd->depth, pmd->pattern_size); return; } diff --git a/src/log/log_text.cc b/src/log/log_text.cc index 2c80c25d4..74468e1ee 100644 --- a/src/log/log_text.cc +++ b/src/log/log_text.cc @@ -1497,7 +1497,7 @@ void LogNetData (TextLog* log, const uint8_t* data, const int len, Packet *p) { TextLog_Print( log, "Got bogus buffer length (%d) for LogNetData, " - "defaulting to %d bytes!\n", len, BYTES_PER_FRAME + "defaulting to %d bytes\n", len, BYTES_PER_FRAME ); } end = data + BYTES_PER_FRAME; diff --git a/src/log/text_log.cc b/src/log/text_log.cc index 21048f225..572277dd7 100644 --- a/src/log/text_log.cc +++ b/src/log/text_log.cc @@ -88,7 +88,7 @@ TextLog* TextLog_Init ( if ( !txt ) { - FatalError("Unable to allocate a TextLog(%u)!\n", maxBuf); + FatalError("Unable to allocate a TextLog(%u)\n", maxBuf); return nullptr; } txt->name = name ? SnortStrdup(name) : NULL; diff --git a/src/loggers/alert_syslog.cc b/src/loggers/alert_syslog.cc index 2d29746e6..ba6585ec9 100644 --- a/src/loggers/alert_syslog.cc +++ b/src/loggers/alert_syslog.cc @@ -293,7 +293,7 @@ static void AlertSyslog( } else { - syslog(priority, "%s", msg == NULL ? "ALERT!" : msg); + syslog(priority, "%s", msg == NULL ? "ALERT" : msg); } } diff --git a/src/loggers/alert_unixsock.cc b/src/loggers/alert_unixsock.cc index a30bacc30..1ac51bcac 100644 --- a/src/loggers/alert_unixsock.cc +++ b/src/loggers/alert_unixsock.cc @@ -211,7 +211,7 @@ static void OpenAlertSock(void) get_instance_file(name, UNSOCK_FILE); if ( access(name.c_str(), W_OK) ) - ErrorMessage("%s file doesn't exist or isn't writable!\n", name.c_str()); + ErrorMessage("%s file doesn't exist or isn't writable\n", name.c_str()); memset((char *) &us.addr, 0, sizeof(us.addr)); us.addr.sun_family = AF_UNIX; diff --git a/src/loggers/unified2.cc b/src/loggers/unified2.cc index e004fe8cb..04241a615 100644 --- a/src/loggers/unified2.cc +++ b/src/loggers/unified2.cc @@ -941,7 +941,7 @@ static void Unified2Write(uint8_t *buf, uint32_t buf_len, Unified2Config *config if (((fwcount = fwrite(buf, (size_t)buf_len, 1, u2.stream)) == 1) && ((ffstatus = fflush(u2.stream)) == 0)) { - ErrorMessage("%s(%d) Write to unified2 file succeeded!\n", + ErrorMessage("%s(%d) Write to unified2 file succeeded\n", __FILE__, __LINE__); error = 0; break; @@ -949,7 +949,7 @@ static void Unified2Write(uint8_t *buf, uint32_t buf_len, Unified2Config *config } else if ((ffstatus = fflush(u2.stream)) == 0) { - ErrorMessage("%s(%d) Write to unified2 file succeeded!\n", + ErrorMessage("%s(%d) Write to unified2 file succeeded\n", __FILE__, __LINE__); error = 0; break; @@ -993,7 +993,7 @@ static void Unified2Write(uint8_t *buf, uint32_t buf_len, Unified2Config *config if (((fwcount = fwrite(buf, (size_t)buf_len, 1, u2.stream)) == 1) && ((ffstatus = fflush(u2.stream)) == 0)) { - ErrorMessage("%s(%d) Write to unified2 file succeeded!\n", + ErrorMessage("%s(%d) Write to unified2 file succeeded\n", __FILE__, __LINE__); error = 0; break; diff --git a/src/main.cc b/src/main.cc index 3d098ffcf..9365e6081 100644 --- a/src/main.cc +++ b/src/main.cc @@ -643,7 +643,7 @@ static bool set_mode() if ( ScTestMode() || (!Trough_GetQCount() && !(snort_conf->run_flags & RUN_FLAG__SHELL)) ) { - LogMessage("\nSnort successfully validated the configuration!\n"); + LogMessage("\nSnort successfully validated the configuration.\n"); // force test mode to exit w/o stats snort_conf->run_flags |= RUN_FLAG__TEST; diff --git a/src/main/modules.cc b/src/main/modules.cc index 4537fd88c..d43b4cae7 100644 --- a/src/main/modules.cc +++ b/src/main/modules.cc @@ -1276,19 +1276,18 @@ bool ProcessModule::end(const char* fqn, int idx, SnortConfig* sc) if (cpu == -1) { ParseError("%s - cpu(%d) for thread (%d) and source (%s) " - "must be an integer in the range " - "of 0 < cpu < max_cpus", fqn, cpu); + "must be an integer in the range of 0 < cpu < max_cpus", fqn, cpu); return false; } else if ((source.empty()) && (thread == -1)) { - ParseError("%s - must have either a source or a thread!", fqn); + ParseError("%s - must have either a source or a thread", fqn); return false; } else if ((!source.empty()) && (thread >= 0)) { - ParseError("%s - must have either a source or a thread!" - " Both thread(%d) and source(%s) are set", fqn, thread, source.c_str()); + ParseError("%s - cannot set both thread(%d) and source(%s)", + fqn, thread, source.c_str()); return false; } diff --git a/src/main/thread.cc b/src/main/thread.cc index 11ae08c82..8556df544 100644 --- a/src/main/thread.cc +++ b/src/main/thread.cc @@ -80,7 +80,7 @@ bool set_cpu_affinity(SnortConfig* sc, const std::string& str, int cpu) auto search = sa.find(str); if(search != sa.end()) - ParseError("Multiple CPU's set for interface %s", str.c_str()); + ParseError("multiple CPUs set for interface %s", str.c_str()); sa[std::string(str)] = cpu; return false; @@ -126,42 +126,39 @@ void pin_thread_to_cpu(const char* source) cpu = ta[instance_id]; } + if ( cpu < 0 ) + return; - if (cpu != -1) +#if LINUX + static THREAD_LOCAL cpu_set_t cpu_set; + + if (cpu >= CPU_SETSIZE) + FatalError("Maximum CPU value for this Operating System is %d", + CPU_SETSIZE); + + CPU_ZERO(&cpu_set); + + if (!sched_getaffinity(0, sizeof(cpu_set), &cpu_set)) + if (!CPU_ISSET(cpu, &cpu_set)) + FatalError("CPU %d is not part of source %s's and thread " + "%d's CPU set\n", cpu, source, instance_id); + + CPU_ZERO(&cpu_set); + CPU_SET(cpu, &cpu_set); + + if (sched_setaffinity(0, sizeof(cpu_set), &cpu_set)) + FatalError("Unable to pin source %s to CPU %d: %s\n", + source, cpu, std::strerror(errno)); +#else + static bool warning_printed = false; + + if (!warning_printed) { -// PREPROCESSOR MACROS -- these are not actually if statements! -# if LINUX - { - static THREAD_LOCAL cpu_set_t cpu_set; - - if (cpu >= CPU_SETSIZE) - FatalError("Maximum CPU value for this Operating System is %d", - CPU_SETSIZE); - - CPU_ZERO(&cpu_set); - if (!sched_getaffinity(0, sizeof(cpu_set), &cpu_set)) - if (!CPU_ISSET(cpu, &cpu_set)) - FatalError("CPU %d is not part of source %s's and thread " - "%d's CPU set!\n", cpu, source, instance_id); - - CPU_ZERO(&cpu_set); - CPU_SET(cpu, &cpu_set); - if (sched_setaffinity(0, sizeof(cpu_set), &cpu_set)) - FatalError("Unable to pin source %s to CPU %d! %s\n", source, cpu, std::strerror(errno)); - - } -# else - { - static bool warning_printed = false; - if (!warning_printed) - { - WarningMessage("Thread Pinning / CPU affinity support is currently" - " unsupported for this Operating System"); - warning_printed = true; - } - } -# endif + WarningMessage("Thread Pinning / CPU affinity support is currently" + " unsupported for this Operating System"); + warning_printed = true; } +#endif } //------------------------------------------------------------------------- diff --git a/src/managers/codec_manager.cc b/src/managers/codec_manager.cc index a17f1fcaa..391bdd428 100644 --- a/src/managers/codec_manager.cc +++ b/src/managers/codec_manager.cc @@ -89,17 +89,17 @@ CodecManager::CodecApiWrapper& CodecManager::get_api_wrapper(const CodecApi* cd_ ParseAbort("Attempting to instantiate Codec '%s', " - "but codec has not been added!!", cd_api->base.name); + "but codec has not been added", cd_api->base.name); } void CodecManager::add_plugin(const CodecApi* api) { if (!api->ctor) - FatalError("CodecApi ctor() for Codec %s: ctor() must be implemented!!\n", + FatalError("CodecApi ctor() for Codec %s: ctor() must be implemented\n", api->base.name); if (!api->dtor) - FatalError("CodecApi ctor() for Codec %s: ctor() must be implemented!!\n", + FatalError("CodecApi ctor() for Codec %s: ctor() must be implemented\n", api->base.name); CodecApiWrapper wrap; @@ -227,7 +227,7 @@ void CodecManager::thread_init() } if(!grinder) - FatalError("PacketManager: Unable to find a Codec with data link type %d!!\n", daq_dlt); + FatalError("PacketManager: Unable to find a Codec with data link type %d\n", daq_dlt); if ( !ScReadMode() || ScPcapShow() ) LogMessage("Decoding with %s\n", s_protocols[grinder]->get_name()); diff --git a/src/network_inspectors/port_scan/ipobj.cc b/src/network_inspectors/port_scan/ipobj.cc index a34ef1f40..c6573a0b0 100644 --- a/src/network_inspectors/port_scan/ipobj.cc +++ b/src/network_inspectors/port_scan/ipobj.cc @@ -495,7 +495,7 @@ void test_ip4_parsing(void) printf("%c", not_flag ? '!' : ' '); printf("%s/", inet_ntoa(*(struct in_addr *) &host)); printf("%s", inet_ntoa(*(struct in_addr *) &mask)); - printf(" parsed successfully!\n"); + printf(" parsed successfully\n"); } /* host byte order stuff */ diff --git a/src/packet_io/active.cc b/src/packet_io/active.cc index 0df72fa7c..4d1ce1eb1 100644 --- a/src/packet_io/active.cc +++ b/src/packet_io/active.cc @@ -418,7 +418,7 @@ static int Active_Open (const char* dev) s_link = eth_open(dev); if ( !s_link ) - FatalError("%s: can't open %s!\n", + FatalError("%s: can't open %s\n", "Active response", dev); s_send = Active_SendEth; } @@ -427,7 +427,7 @@ static int Active_Open (const char* dev) s_ipnet = ip_open(); if ( !s_ipnet ) - FatalError("%s: can't open ip!\n", + FatalError("%s: can't open ip\n", "Active response"); s_send = Active_SendIp; } diff --git a/src/packet_io/sfdaq.cc b/src/packet_io/sfdaq.cc index 7ac9065cb..5240cb57c 100644 --- a/src/packet_io/sfdaq.cc +++ b/src/packet_io/sfdaq.cc @@ -162,11 +162,11 @@ DAQ_Mode DAQ_GetMode (const SnortConfig* sc) if ( !strcasecmp(daq_mode_string((DAQ_Mode)i), sc->daq_mode) ) { if ( ScAdapterInlineMode() && (i != DAQ_MODE_INLINE) ) - FatalError("DAQ '%s' mode incompatible with -Q!\n", sc->daq_mode); + FatalError("DAQ '%s' mode incompatible with -Q\n", sc->daq_mode); return (DAQ_Mode)i; } } - FatalError("Bad DAQ mode '%s'!\n", sc->daq_mode); + FatalError("Bad DAQ mode '%s'\n", sc->daq_mode); } if ( ScAdapterInlineMode() ) return DAQ_MODE_INLINE; @@ -240,7 +240,7 @@ void DAQ_Init (const SnortConfig* sc) daq_mod = daq_find_module(type); if ( !daq_mod ) - FatalError("Can't find %s DAQ!\n", type); + FatalError("Can't find %s DAQ\n", type); snap = ( sc->pkt_snaplen > 0 ) ? sc->pkt_snaplen : PKT_SNAPLEN; daq_mode = DAQ_GetMode(sc); @@ -350,7 +350,7 @@ int DAQ_SetFilter(const char* bpf) bpf_gate.unlock(); if ( err ) - FatalError("Can't set DAQ BPF filter to '%s' (%s)!\n", + FatalError("Can't set DAQ BPF filter to '%s' (%s)\n", bpf, daq_get_error(daq_mod, daq_hand)); return err; @@ -409,7 +409,7 @@ int DAQ_New (const SnortConfig* sc, const char* intf) DAQ_Config_t cfg; if ( !daq_mod ) - FatalError("DAQ_Init not called!\n"); + FatalError("DAQ_Init not called\n"); if ( intf ) interface_spec = SnortStrdup(intf); @@ -471,7 +471,7 @@ int DAQ_Start () int err = daq_start(daq_mod, daq_hand); if ( err ) - FatalError("Can't start DAQ (%d) - %s!\n", + FatalError("Can't start DAQ (%d) - %s\n", err, daq_get_error(daq_mod, daq_hand)); else if ( !DAQ_UnprivilegedStart() ) @@ -497,7 +497,7 @@ int DAQ_Stop () int err = daq_stop(daq_mod, daq_hand); if ( err ) - LogMessage("Can't stop DAQ (%d) - %s!\n", + LogMessage("Can't stop DAQ (%d) - %s\n", err, daq_get_error(daq_mod, daq_hand)); return err; @@ -522,7 +522,7 @@ int DAQ_Acquire (int max, DAQ_Analysis_Func_t callback, uint8_t* user) #endif if ( err && err != DAQ_READFILE_EOF ) - LogMessage("Can't acquire (%d) - %s!\n", + LogMessage("Can't acquire (%d) - %s\n", err, daq_get_error(daq_mod, daq_hand)); if ( s_error != DAQ_SUCCESS ) @@ -538,7 +538,7 @@ int DAQ_Inject(const DAQ_PktHdr_t* h, int rev, const uint8_t* buf, uint32_t len) int err = daq_inject(daq_mod, daq_hand, (DAQ_PktHdr_t*)h, buf, len, rev); #ifdef DEBUG if ( err ) - LogMessage("Can't inject (%d) - %s!\n", + LogMessage("Can't inject (%d) - %s\n", err, daq_get_error(daq_mod, daq_hand)); #endif return err; @@ -581,7 +581,7 @@ const DAQ_Stats_t* DAQ_GetStats (void) err = daq_get_stats(daq_mod, daq_hand, &daq_stats); if ( err ) - LogMessage("Can't get DAQ stats (%d) - %s!\n", + LogMessage("Can't get DAQ stats (%d) - %s\n", err, daq_get_error(daq_mod, daq_hand)); if ( !daq_stats.hw_packets_received ) diff --git a/src/parser/vars.cc b/src/parser/vars.cc index dfb3e2f9f..eff77dc66 100644 --- a/src/parser/vars.cc +++ b/src/parser/vars.cc @@ -497,7 +497,7 @@ VarEntry * VarDefine( if(value == NULL) { - ParseAbort("bad value in variable definition! Make sure you don't " + ParseAbort("bad value in variable definition. Make sure you don't " "have a '$' in the var name."); } @@ -533,7 +533,7 @@ VarEntry * VarDefine( break; case SFIP_NOT_ANY: - ParseAbort("!any is not allowed in %s.", name); + ParseAbort("!any is not allowed in %s", name); break; default: diff --git a/src/search_engines/acsmx.cc b/src/search_engines/acsmx.cc index 47d0ece8d..83be08ae6 100644 --- a/src/search_engines/acsmx.cc +++ b/src/search_engines/acsmx.cc @@ -68,7 +68,7 @@ #include "util.h" #include "main/thread.h" -#define MEMASSERT(p,s) if(!p){fprintf(stderr,"ACSM-No Memory: %s!\n",s);exit(0);} +#define MEMASSERT(p,s) if(!p){fprintf(stderr,"ACSM-No Memory: %s\n",s);exit(0);} #ifdef DEBUG_AC static int max_memory = 0; diff --git a/src/search_engines/acsmx2.cc b/src/search_engines/acsmx2.cc index 45abaf45d..905c906a7 100644 --- a/src/search_engines/acsmx2.cc +++ b/src/search_engines/acsmx2.cc @@ -148,7 +148,7 @@ #define printf LogMessage -#define MEMASSERT(p,s) if(!p){FatalError("ACSM-No Memory: %s!\n",s);} +#define MEMASSERT(p,s) if(!p){FatalError("ACSM-No Memory: %s\n",s);} static int acsm2_total_memory = 0; static int acsm2_pattern_memory = 0; diff --git a/src/service_inspectors/ftp_telnet/hi_util_kmap.cc b/src/service_inspectors/ftp_telnet/hi_util_kmap.cc index d994557df..13f7dd8d0 100644 --- a/src/service_inspectors/ftp_telnet/hi_util_kmap.cc +++ b/src/service_inspectors/ftp_telnet/hi_util_kmap.cc @@ -56,7 +56,7 @@ #include "hi_util_xmalloc.h" -//#define MEMASSERT(p) if(!p){printf("KMAP-No Memory: File: %s Line:%d!\n",__FILE__,__LINE__);exit(0);} +//#define MEMASSERT(p) if(!p){printf("KMAP-No Memory: File: %s Line:%d\n",__FILE__,__LINE__);exit(0);} #define MEMASSERT(p) diff --git a/src/service_inspectors/http_inspect/hi_util_kmap.cc b/src/service_inspectors/http_inspect/hi_util_kmap.cc index 4c8923e91..ac4782ab7 100644 --- a/src/service_inspectors/http_inspect/hi_util_kmap.cc +++ b/src/service_inspectors/http_inspect/hi_util_kmap.cc @@ -56,7 +56,7 @@ #include "hi_util_xmalloc.h" -//#define MEMASSERT(p) if(!p){printf("KMAP-No Memory: File: %s Line:%d!\n",__FILE__,__LINE__);exit(0);} +//#define MEMASSERT(p) if(!p){printf("KMAP-No Memory: File: %s Line:%d\n",__FILE__,__LINE__);exit(0);} #define MEMASSERT(p) /* diff --git a/src/stream/ip/ip_defrag.cc b/src/stream/ip/ip_defrag.cc index 1155fca08..41c4a3fad 100644 --- a/src/stream/ip/ip_defrag.cc +++ b/src/stream/ip/ip_defrag.cc @@ -233,7 +233,7 @@ static THREAD_LOCAL Packet** defrag_pkts; // An array of Packet pointers /* enum for policy names */ static const char *frag_policy_names[] = { - "no policy!", + "no policy", "FIRST", "LINUX", "BSD", diff --git a/src/stream/tcp/tcp_session.cc b/src/stream/tcp/tcp_session.cc index e5dee3541..beddc1220 100644 --- a/src/stream/tcp/tcp_session.cc +++ b/src/stream/tcp/tcp_session.cc @@ -409,7 +409,7 @@ void s5TcpStreamReassembleRuleOptionCleanup(void *dataPtr); /* enum for policy names */ static const char *reassembly_policy_names[] = { - "no policy!", + "no policy", "FIRST", "LINUX", "BSD", @@ -3083,7 +3083,7 @@ static int AddStreamNode( i, idx, idx->seq, idx->size, idx->next, idx->prev);); if(st->seg_count < i) - FatalError("Circular list, WTF?\n"); + FatalError("Circular list\n"); idx = idx->next; } diff --git a/src/utils/boyer_moore.cc b/src/utils/boyer_moore.cc index bbfae43ec..4a4cfb6f7 100644 --- a/src/utils/boyer_moore.cc +++ b/src/utils/boyer_moore.cc @@ -337,7 +337,9 @@ int mSearchREG( } } - DEBUG_WRAP(DebugMessage(DEBUG_PATTERN_MATCH, "got wildcard final char match! (b[%d]: %c -> p[%d]: %c\n", b_idx, buf[b_idx], p_idx, ptrn[p_idx]);); + DEBUG_WRAP(DebugMessage(DEBUG_PATTERN_MATCH, + "got wildcard final char match! (b[%d]: %c -> p[%d]: %c\n", + b_idx, buf[b_idx], p_idx, ptrn[p_idx]);); } if(p_idx == 0) diff --git a/src/utils/sfportobject.cc b/src/utils/sfportobject.cc index 146e253ce..e90975aad 100644 --- a/src/utils/sfportobject.cc +++ b/src/utils/sfportobject.cc @@ -2459,7 +2459,8 @@ int PortTableConsistencyCheck( PortTable *p ) } } - DEBUG_WRAP(DebugMessage(DEBUG_PORTLISTS,"***\n***Port Table Compiler Consistency Check Phase-I Passed !\n");); + DEBUG_WRAP(DebugMessage(DEBUG_PORTLISTS, + "***\n***Port Table Compiler Consistency Check Phase-I Passed !\n");); /* @@ -2492,7 +2493,7 @@ int PortTableConsistencyCheck( PortTable *p ) case PORT_OBJECT_PORT: if( _po2_include_po_rules( p->pt_port_object[ poi->lport ], ipo ) ) { - FatalError("InputPortObject<->CompositePortObject consistency Check II failed!\n"); + FatalError("InputPortObject<->CompositePortObject consistency Check II failed\n"); } break; @@ -2505,7 +2506,7 @@ int PortTableConsistencyCheck( PortTable *p ) { if( _po2_include_po_rules( p->pt_port_object[ i ], ipo ) ) { - FatalError("InputPortObject<->CompositePortObject consistency Check II failed!\n"); + FatalError("InputPortObject<->CompositePortObject consistency Check II failed\n"); } lastpo = p->pt_port_object[ i ]; } diff --git a/src/utils/util.cc b/src/utils/util.cc index 589c0c4f6..33fcb48fa 100644 --- a/src/utils/util.cc +++ b/src/utils/util.cc @@ -763,14 +763,14 @@ char * SnortStrdup(const char *str) if (!str) { - FatalError("Unable to duplicate string: NULL!\n"); + FatalError("Unable to duplicate string: NULL\n"); } copy = strdup(str); if (copy == NULL) { - FatalError("Unable to duplicate string: %s!\n", str); + FatalError("Unable to duplicate string: %s\n", str); } return copy; diff --git a/src/utils/util.h b/src/utils/util.h index 6b0be9240..6e64882c7 100644 --- a/src/utils/util.h +++ b/src/utils/util.h @@ -130,7 +130,7 @@ static inline void* SnortAlloc (unsigned long size) return pv; // FIXIT-M do not FatalError() on runtime allocation failures - FatalError("Unable to allocate memory! (%lu requested)\n", size); + FatalError("Unable to allocate memory (%lu requested)\n", size); return NULL; }