From gitlab at mg.gitlab.com Sun Nov 2 00:45:57 2025 From: gitlab at mg.gitlab.com (Gary E. Miller (@garyedmundsmiller)) Date: Sun, 02 Nov 2025 00:45:57 +0000 Subject: [Git][NTPsec/ntpsec][master] Fix UnicodeError on Unicode names given to ntpdig Message-ID: <6906a9c591dce_2c64ca4a43426@gitlab-sidekiq-low-urgency-cpu-bound-v2-66dbb487d8-2qjdc.mail> Gary E. Miller pushed to branch master at NTPsec / ntpsec Commits: df6cc52c by James Browning at 2025-11-01T17:20:37-07:00 Fix UnicodeError on Unicode names given to ntpdig - - - - - 1 changed file: - ntpclients/ntpdig.py Changes: ===================================== ntpclients/ntpdig.py ===================================== @@ -90,6 +90,9 @@ def queryhost(server, concurrent, timeout=5, port=123, bindaddr=None): except socket.gaierror as e: log("lookup of %s failed, errno %d = %s" % (server, e.args[0], e.args[1])) return [] + except UnicodeError as e: + log("lookup of %s failed, %s" % (server, e.args[0])) + return [] if bindaddr: try: bindsock = socket.getaddrinfo(bindaddr,None,af, View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/df6cc52c66a1148dd7d48243d75ab968c950230d -- View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/df6cc52c66a1148dd7d48243d75ab968c950230d You're receiving this email because of your account on gitlab.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gitlab at mg.gitlab.com Wed Nov 12 08:40:53 2025 From: gitlab at mg.gitlab.com (Hal Murray (@hal.murray)) Date: Wed, 12 Nov 2025 08:40:53 +0000 Subject: [Git][NTPsec/ntpsec][master] Fix stats dir argument "-s PATH" & change default Message-ID: <691448157f395_2ce309456911@gitlab-sidekiq-low-urgency-cpu-bound-v2-7898cb4754-b2hz5.mail> Hal Murray pushed to branch master at NTPsec / ntpsec Commits: 5bdffcbc by James Browning at 2025-11-12T00:37:15-08:00 Fix stats dir argument "-s PATH" & change default - - - - - 3 changed files: - ntpd/ntp_config.c - ntpd/ntp_util.c - ntpd/ntpd.c Changes: ===================================== ntpd/ntp_config.c ===================================== @@ -1288,8 +1288,7 @@ config_monitor( int filegen_flag; /* Set the statistics directory */ - if (ptree->stats_dir) - stats_config(STATS_STATSDIR, ptree->stats_dir); + stats_config(STATS_STATSDIR, ptree->stats_dir); /* NOTE: * Calling filegen_get is brain dead. Doing a string ===================================== ntpd/ntp_util.c ===================================== @@ -296,6 +296,9 @@ stats_config( * Specify statistics directory. */ case STATS_STATSDIR: + if ((NULL == value) || ('\0' == *value)) { + break; + } /* - 1 since value may be missing the DIR_SEP. */ if (strlen(value) >= sizeof(statsdir) - 1) { @@ -303,23 +306,17 @@ stats_config( "LOG: statsdir too long (>%d, sigh)", (int)sizeof(statsdir) - 2); } else { - bool add_dir_sep; size_t value_l; - /* Add a DIR_SEP unless we already have one. */ value_l = strlen(value); - if (0 == value_l) - add_dir_sep = false; - else - add_dir_sep = (DIR_SEP != - value[value_l - 1]); - - if (add_dir_sep) - snprintf(statsdir, sizeof(statsdir), - "%s%c", value, DIR_SEP); - else - snprintf(statsdir, sizeof(statsdir), - "%s", value); + strlcpy(statsdir, value, sizeof(statsdir) - 1); + + /* Add a DIR_SEP unless we already have one. */ + if (DIR_SEP != value[value_l - 1]) { + statsdir[value_l + 1] = '\0'; + statsdir[value_l] = DIR_SEP; + } + filegen_statsdir(); } break; ===================================== ntpd/ntpd.c ===================================== @@ -323,8 +323,7 @@ parse_cmdline_opts( nofork = true; break; case 's': - if (ntp_optarg != NULL) - strlcpy(statsdir, ntp_optarg, sizeof(statsdir)); + /* defer */ break; case 't': /* defer */ @@ -703,7 +702,7 @@ main( /* handled elsewhere */ break; case 's': - stats_config(STATS_STATSDIR, statsdir); + stats_config(STATS_STATSDIR, ntp_optarg); break; case 't': if (ntp_optarg != NULL) @@ -873,7 +872,7 @@ main( #endif if (access(statsdir, W_OK) != 0) { - msyslog(LOG_ERR, "statistics directory %s does not exist or is unwriteable, error %s", statsdir, strerror(errno)); + msyslog(LOG_ERR, "statistics directory '%s' does not exist or is unwriteable, error %s", statsdir, strerror(errno)); } mainloop(); View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/5bdffcbc093f890b4274d5987197a681bb902b27 -- View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/5bdffcbc093f890b4274d5987197a681bb902b27 You're receiving this email because of your account on gitlab.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: