diff options
author | Andreas Schneider <asn@samba.org> | 2023-04-20 10:42:54 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2023-04-27 07:21:33 +0000 |
commit | 3e6a6c00cc09fedefa5c02f24d7852fea9a4c484 (patch) | |
tree | 60cc888c9a6e0b98b7f0d83281cf83fb17135e03 /lib/krb5_wrap | |
parent | 8027283dd7c55b611d0af19caccbdd98bb2fa264 (diff) | |
download | samba-3e6a6c00cc09fedefa5c02f24d7852fea9a4c484.tar.gz |
lib:krb5_wrap: Fix debug statements when princ_s is NULL
In file included from source4/include/includes.h:61,
from lib/krb5_wrap/krb5_samba.c:23:
lib/krb5_wrap/krb5_samba.c: In function ‘smb_krb5_kt_seek_and_delete_old_entries’:
lib/util/debug.h:200:12: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
200 | && (dbgtext body) )
| ~^~~~~~~~~~~~~
lib/krb5_wrap/krb5_samba.c:1753:25: note: in expansion of macro ‘DEBUG’
1753 | DEBUG(5, (__location__ ": Saving previous (kvno %d) "
| ^~~~~
lib/util/debug.h:200:12: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
200 | && (dbgtext body) )
| ~^~~~~~~~~~~~~
lib/krb5_wrap/krb5_samba.c:1763:25: note: in expansion of macro ‘DEBUG’
1763 | DEBUG(5, (__location__ ": Saving entry with kvno [%d] "
| ^~~~~
lib/util/debug.h:200:12: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
200 | && (dbgtext body) )
| ~^~~~~~~~~~~~~
lib/krb5_wrap/krb5_samba.c:1769:17: note: in expansion of macro ‘DEBUG’
1769 | DEBUG(5, (__location__ ": Found old entry for principal: %s "
| ^~~~~
lib/util/debug.h:200:12: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
200 | && (dbgtext body) )
| ~^~~~~~~~~~~~~
lib/krb5_wrap/krb5_samba.c:1787:17: note: in expansion of macro ‘DEBUG’
1787 | DEBUG(5, (__location__ ": removed old entry for principal: "
| ^~~~~
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/krb5_wrap')
-rw-r--r-- | lib/krb5_wrap/krb5_samba.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/krb5_wrap/krb5_samba.c b/lib/krb5_wrap/krb5_samba.c index 61fda0e502c..22aeda33026 100644 --- a/lib/krb5_wrap/krb5_samba.c +++ b/lib/krb5_wrap/krb5_samba.c @@ -1752,7 +1752,8 @@ krb5_error_code smb_krb5_kt_seek_and_delete_old_entries(krb5_context context, if (keep_old_kvno && ((kt_entry.vno & 0xff) == (old_kvno & 0xff))) { DEBUG(5, (__location__ ": Saving previous (kvno %d) " "entry for principal: %s.\n", - old_kvno, princ_s)); + old_kvno, + princ_s != NULL ? princ_s : "UNKNOWN")); continue; } @@ -1762,13 +1763,15 @@ krb5_error_code smb_krb5_kt_seek_and_delete_old_entries(krb5_context context, { DEBUG(5, (__location__ ": Saving entry with kvno [%d] " "enctype [%d] for principal: %s.\n", - kvno, kt_entry_enctype, princ_s)); + kvno, kt_entry_enctype, + princ_s != NULL ? princ_s : "UNKNOWN")); continue; } DEBUG(5, (__location__ ": Found old entry for principal: %s " "(kvno %d) - trying to remove it.\n", - princ_s, kt_entry.vno)); + princ_s != NULL ? princ_s : "UNKNOWN", + kt_entry.vno)); ret = krb5_kt_end_seq_get(context, keytab, &cursor); ZERO_STRUCT(cursor); @@ -1785,7 +1788,9 @@ krb5_error_code smb_krb5_kt_seek_and_delete_old_entries(krb5_context context, } DEBUG(5, (__location__ ": removed old entry for principal: " - "%s (kvno %d).\n", princ_s, kt_entry.vno)); + "%s (kvno %d).\n", + princ_s != NULL ? princ_s : "UNKNOWN", + kt_entry.vno)); ret = krb5_kt_start_seq_get(context, keytab, &cursor); if (ret) { |