diff --git a/scripts/base/protocols/conn/main.zeek b/scripts/base/protocols/conn/main.zeek index 015b854df2..bd8a8d1261 100644 --- a/scripts/base/protocols/conn/main.zeek +++ b/scripts/base/protocols/conn/main.zeek @@ -240,7 +240,7 @@ function set_conn(c: connection, eoc: bool) { if ( ! c?$conn ) { - local tmp: Info &is_set; + local tmp: Info &is_assigned; c$conn = tmp; } diff --git a/scripts/base/protocols/dns/main.zeek b/scripts/base/protocols/dns/main.zeek index 955c3d5eae..4f48e510bc 100644 --- a/scripts/base/protocols/dns/main.zeek +++ b/scripts/base/protocols/dns/main.zeek @@ -293,7 +293,7 @@ hook set_session(c: connection, msg: dns_msg, is_query: bool) &priority=5 else { # Just pick an arbitrary, unpaired query. - local tid: count &is_set; + local tid: count &is_assigned; local found_one = F; for ( trans_id, q in c$dns_state$pending_queries ) diff --git a/scripts/base/protocols/ftp/utils-commands.zeek b/scripts/base/protocols/ftp/utils-commands.zeek index 037055a42a..43519b8422 100644 --- a/scripts/base/protocols/ftp/utils-commands.zeek +++ b/scripts/base/protocols/ftp/utils-commands.zeek @@ -87,7 +87,7 @@ function add_pending_cmd(pc: PendingCmds, cmd: string, arg: string): CmdArg # response code and message. function get_pending_cmd(pc: PendingCmds, reply_code: count, reply_msg: string): CmdArg { - local best_match: CmdArg &is_set; # &is_set for $ts field + local best_match: CmdArg &is_assigned; # &is_assigned for $ts field local best_seq = 0; local best_score: int = -1; diff --git a/scripts/base/protocols/ntp/main.zeek b/scripts/base/protocols/ntp/main.zeek index 6f870af7f8..d922ae39e3 100644 --- a/scripts/base/protocols/ntp/main.zeek +++ b/scripts/base/protocols/ntp/main.zeek @@ -66,7 +66,7 @@ event zeek_init() &priority=5 event ntp_message(c: connection, is_orig: bool, msg: NTP::Message) &priority=5 { - local info: Info &is_set; # &is_set for case where no $std_msg + local info: Info &is_assigned; # for case where no $std_msg info$ts = network_time(); info$uid = c$uid; info$id = c$id; diff --git a/scripts/base/protocols/ssh/main.zeek b/scripts/base/protocols/ssh/main.zeek index cb38afee13..f2b5d52e5c 100644 --- a/scripts/base/protocols/ssh/main.zeek +++ b/scripts/base/protocols/ssh/main.zeek @@ -142,7 +142,7 @@ function set_session(c: connection) { if ( ! c?$ssh ) { - local info: SSH::Info &is_set; # needed for $version + local info: SSH::Info &is_assigned; # needed for $version info$ts = network_time(); info$uid = c$uid; info$id = c$id; diff --git a/scripts/base/protocols/ssl/files.zeek b/scripts/base/protocols/ssl/files.zeek index 52de1f5da6..d155825f2e 100644 --- a/scripts/base/protocols/ssl/files.zeek +++ b/scripts/base/protocols/ssl/files.zeek @@ -102,7 +102,7 @@ event file_sniff(f: fa_file, meta: fa_metadata) &priority=5 || f$info$mime_type == "application/pkix-cert" ) ) return; - local c: connection &is_set; # &is_set to help static analysis + local c: connection &is_assigned; # to help static analysis for ( cid, c in f$conns ) { diff --git a/scripts/policy/protocols/ssl/log-hostcerts-only.zeek b/scripts/policy/protocols/ssl/log-hostcerts-only.zeek index 52fc6b8b22..2019adfa6f 100644 --- a/scripts/policy/protocols/ssl/log-hostcerts-only.zeek +++ b/scripts/policy/protocols/ssl/log-hostcerts-only.zeek @@ -44,7 +44,7 @@ event file_sniff(f: fa_file, meta: fa_metadata) &priority=4 || f$info$mime_type == "application/pkix-cert" ) ) return; - local c: connection &is_set; + local c: connection &is_assigned; for ( cid, c in f$conns ) { diff --git a/scripts/policy/protocols/ssl/validate-sct.zeek b/scripts/policy/protocols/ssl/validate-sct.zeek index 8a7d38f353..796cd127a7 100644 --- a/scripts/policy/protocols/ssl/validate-sct.zeek +++ b/scripts/policy/protocols/ssl/validate-sct.zeek @@ -95,7 +95,7 @@ event x509_ocsp_ext_signed_certificate_timestamp(f: fa_file, version: count, log if ( |f$conns| != 1 ) return; - local c: connection &is_set; + local c: connection &is_assigned; for ( cid, c in f$conns ) { diff --git a/src/Attr.cc b/src/Attr.cc index 9ca5283715..0c134606fb 100644 --- a/src/Attr.cc +++ b/src/Attr.cc @@ -290,7 +290,7 @@ void Attributes::CheckAttr(Attr* a) switch ( a->Tag() ) { case ATTR_DEPRECATED: case ATTR_REDEF: - case ATTR_IS_SET: + case ATTR_IS_ASSIGNED: break; case ATTR_OPTIONAL: diff --git a/src/Attr.h b/src/Attr.h index df8667dfb6..c63b0adacc 100644 --- a/src/Attr.h +++ b/src/Attr.h @@ -46,7 +46,7 @@ enum AttrTag { ATTR_BROKER_STORE_ALLOW_COMPLEX, // for Broker store backed tables ATTR_BACKEND, // for Broker store backed tables ATTR_DEPRECATED, - ATTR_IS_SET, // to suppress warnings + ATTR_IS_ASSIGNED, // to suppress warnings NUM_ATTRS // this item should always be last }; diff --git a/src/parse.y b/src/parse.y index 6429d9250f..11c168541f 100644 --- a/src/parse.y +++ b/src/parse.y @@ -28,7 +28,7 @@ %token TOK_ATTR_BROKER_STORE_ALLOW_COMPLEX TOK_ATTR_BACKEND %token TOK_ATTR_PRIORITY TOK_ATTR_LOG TOK_ATTR_ERROR_HANDLER %token TOK_ATTR_TYPE_COLUMN TOK_ATTR_DEPRECATED -%token TOK_ATTR_IS_SET +%token TOK_ATTR_IS_ASSIGNED %token TOK_DEBUG @@ -1472,8 +1472,8 @@ attr: { $$ = new zeek::detail::Attr(zeek::detail::ATTR_OPTIONAL); } | TOK_ATTR_REDEF { $$ = new zeek::detail::Attr(zeek::detail::ATTR_REDEF); } - | TOK_ATTR_IS_SET - { $$ = new zeek::detail::Attr(zeek::detail::ATTR_IS_SET); } + | TOK_ATTR_IS_ASSIGNED + { $$ = new zeek::detail::Attr(zeek::detail::ATTR_IS_ASSIGNED); } | TOK_ATTR_ADD_FUNC '=' expr { $$ = new zeek::detail::Attr(zeek::detail::ATTR_ADD_FUNC, {zeek::AdoptRef{}, $3}); } | TOK_ATTR_DEL_FUNC '=' expr diff --git a/src/scan.l b/src/scan.l index 15777124d7..da512f4206 100644 --- a/src/scan.l +++ b/src/scan.l @@ -285,7 +285,7 @@ when return TOK_WHEN; &expire_func return TOK_ATTR_EXPIRE_FUNC; &log return TOK_ATTR_LOG; &optional return TOK_ATTR_OPTIONAL; -&is_set return TOK_ATTR_IS_SET; +&is_assigned return TOK_ATTR_IS_ASSIGNED; &priority return TOK_ATTR_PRIORITY; &type_column return TOK_ATTR_TYPE_COLUMN; &read_expire return TOK_ATTR_EXPIRE_READ; diff --git a/src/script_opt/GenRDs.cc b/src/script_opt/GenRDs.cc index 3400d4d470..ddd3ebb54a 100644 --- a/src/script_opt/GenRDs.cc +++ b/src/script_opt/GenRDs.cc @@ -733,7 +733,7 @@ void RD_Decorate::CheckVar(const Expr* e, const ID* id, bool check_fields) return; if ( analysis_options.usage_issues > 0 && - ! mgr.HasPreMinRD(e, id) && ! id->GetAttr(ATTR_IS_SET) ) + ! mgr.HasPreMinRD(e, id) && ! id->GetAttr(ATTR_IS_ASSIGNED) ) e->Warn("possibly used without definition"); if ( check_fields && id->GetType()->Tag() == TYPE_RECORD ) @@ -921,7 +921,7 @@ TraversalCode RD_Decorate::PreExpr(const Expr* e) { auto r_def = mgr.GetExprDI(r); - if ( r_def && ! r_def->RootID()->GetAttr(ATTR_IS_SET) ) + if ( r_def && ! r_def->RootID()->GetAttr(ATTR_IS_ASSIGNED) ) { auto fn = f->FieldName(); auto field_rd = mgr.GetConstID_DI(r_def.get(), fn); @@ -1243,7 +1243,7 @@ void RD_Decorate::CheckRecordRDs(std::shared_ptr di, CreateRecordRDs(di, dp, false, nullptr); auto root_id = di->RootID(); - if ( root_id->GetAttr(ATTR_IS_SET) ) + if ( root_id->GetAttr(ATTR_IS_ASSIGNED) ) // No point checking for unset fields. return; @@ -1254,7 +1254,7 @@ void RD_Decorate::CheckRecordRDs(std::shared_ptr di, { if ( rt->FieldHasAttr(i, ATTR_DEFAULT) || rt->FieldHasAttr(i, ATTR_OPTIONAL) || - rt->FieldHasAttr(i, ATTR_IS_SET) ) + rt->FieldHasAttr(i, ATTR_IS_ASSIGNED) ) continue; auto n_i = rt->FieldName(i); diff --git a/testing/btest/language/uninitialized-local3.zeek b/testing/btest/language/uninitialized-local3.zeek index a9623842d3..688628df6b 100644 --- a/testing/btest/language/uninitialized-local3.zeek +++ b/testing/btest/language/uninitialized-local3.zeek @@ -5,12 +5,12 @@ type r: record { a: count; b: count &optional; c: count &default = 9; - d: string &is_set; + d: string &is_assigned; e: string; }; type r2: record { - no_worries: r &is_set; + no_worries: r &is_assigned; worries: r; }; diff --git a/testing/btest/scripts/base/files/x509/signed_certificate_timestamp.test b/testing/btest/scripts/base/files/x509/signed_certificate_timestamp.test index 10e2d98a14..c7645b9622 100644 --- a/testing/btest/scripts/base/files/x509/signed_certificate_timestamp.test +++ b/testing/btest/scripts/base/files/x509/signed_certificate_timestamp.test @@ -37,7 +37,7 @@ event x509_ocsp_ext_signed_certificate_timestamp(f: fa_file, version: count, log if ( ! f$conns[cid]?$ssl ) return; - local c: connection &is_set; + local c: connection &is_assigned; c = f$conns[cid]; } diff --git a/testing/btest/scripts/base/files/x509/signed_certificate_timestamp_ocsp.test b/testing/btest/scripts/base/files/x509/signed_certificate_timestamp_ocsp.test index 33de63f0b1..5211428817 100644 --- a/testing/btest/scripts/base/files/x509/signed_certificate_timestamp_ocsp.test +++ b/testing/btest/scripts/base/files/x509/signed_certificate_timestamp_ocsp.test @@ -20,7 +20,7 @@ event x509_ocsp_ext_signed_certificate_timestamp(f: fa_file, version: count, log if ( ! f$conns[cid]?$ssl ) return; - local c: connection &is_set; + local c: connection &is_assigned; c = f$conns[cid]; }