From ghudson at mit.edu Wed Mar 5 14:20:58 2025 From: ghudson at mit.edu (ghudson at mit.edu) Date: Wed, 5 Mar 2025 14:20:58 -0500 (EST) Subject: krb5 commit: Use k5_path_join() in krb5int_open_plugin_dirs() Message-ID: <20250305192058.F2CBA102C09@krbdev.mit.edu> https://github.com/krb5/krb5/commit/80001c8b7b00773a9eb59050aff3b0056080aaf2 commit 80001c8b7b00773a9eb59050aff3b0056080aaf2 Author: Ken Hornstein Date: Sat Mar 1 23:02:58 2025 -0500 Use k5_path_join() in krb5int_open_plugin_dirs() Simplify and improve the portability of krb5int_open_plugin_dirs() using k5_path_join(). (There is no immediate practical benefit as this function is only used to find kdb5, authdata, and locate plugin modules.) [ghudson at mit.edu: further simplified code; edited commit message] src/util/support/plugins.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/util/support/plugins.c b/src/util/support/plugins.c index 678d052e7..752f08519 100644 --- a/src/util/support/plugins.c +++ b/src/util/support/plugins.c @@ -403,12 +403,8 @@ krb5int_open_plugin_dirs (const char * const *dirnames, struct plugin_file_handle *handle = NULL; char *filepath = NULL; - if (!err) { - if (asprintf(&filepath, "%s/%s", dirnames[i], filenames[j]) < 0) { - filepath = NULL; - err = ENOMEM; - } - } + if (!err) + err = k5_path_join(dirnames[i], filenames[j], &filepath); if (!err && krb5int_open_plugin(filepath, &handle, ep) == 0) { err = krb5int_plugin_file_handle_array_add (&h, &count, handle); @@ -432,10 +428,7 @@ krb5int_open_plugin_dirs (const char * const *dirnames, strcmp(fnames[j], "..") == 0) continue; - if (asprintf(&filepath, "%s/%s", dirnames[i], fnames[j]) < 0) { - filepath = NULL; - err = ENOMEM; - } + err = k5_path_join(dirnames[i], fnames[j], &filepath); if (!err && krb5int_open_plugin(filepath, &handle, ep) == 0) { err = krb5int_plugin_file_handle_array_add(&h, &count, From ghudson at mit.edu Tue Mar 11 00:08:43 2025 From: ghudson at mit.edu (ghudson at mit.edu) Date: Tue, 11 Mar 2025 00:08:43 -0400 (EDT) Subject: krb5 commit: Display NetBIOS ticket addresses in klist Message-ID: <20250311040843.7F40A102C5C@krbdev.mit.edu> https://github.com/krb5/krb5/commit/c1e0348c95f00c352faeb849b6e7fabb57b8b159 commit c1e0348c95f00c352faeb849b6e7fabb57b8b159 Author: Ivan Korytov Date: Wed Mar 5 15:30:10 2025 +0300 Display NetBIOS ticket addresses in klist [ghudson at mit.edu: simplified code] ticket: 9165 (new) src/clients/klist/klist.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/clients/klist/klist.c b/src/clients/klist/klist.c index 92d9d6dbd..59a02bedc 100644 --- a/src/clients/klist/klist.c +++ b/src/clients/klist/klist.c @@ -832,8 +832,9 @@ one_addr(krb5_address *a) struct sockaddr_storage ss; struct sockaddr_in *sinp; struct sockaddr_in6 *sin6p; - int err; + int err, i; char namebuf[NI_MAXHOST]; + const uint8_t *p; memset(&ss, 0, sizeof(ss)); @@ -858,6 +859,16 @@ one_addr(krb5_address *a) sin6p->sin6_family = AF_INET6; memcpy(&sin6p->sin6_addr, a->contents, 16); break; + case ADDRTYPE_NETBIOS: + if (a->length != 16) { + printf(_("broken address (type %d length %d)"), + a->addrtype, a->length); + return; + } + p = a->contents; + for (i = 0; i < 15 && p[i] != '\0' && p[i] != ' '; i++) + putchar(p[i]); + return; default: printf(_("unknown addrtype %d"), a->addrtype); return;