summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoratheik <atteh.mailbox@gmail.com>2022-03-05 00:24:49 +0200
committerPavel Shilovsky <pshilovsky@samba.org>2022-04-29 15:07:49 -0700
commit5e5aa507f4c4954ed537a7dfc75cf69915727757 (patch)
tree36d439b853f1d499c45e81bd8af0ff4948e1fc7f
parentdc6035345515acb39bf5f9bc2e5104ad0e10cc2c (diff)
downloadcifs-utils-5e5aa507f4c4954ed537a7dfc75cf69915727757.tar.gz
cifs-utils-5e5aa507f4c4954ed537a7dfc75cf69915727757.tar.bz2
cifs-utils-5e5aa507f4c4954ed537a7dfc75cf69915727757.zip
cifs-utils: work around missing krb5_free_string in Heimdal
The krb5_free_string function is not present in Heimdal and instead krb5_xfree should be used for freeing the string allocation done by krb5_cc_get_full_name. Heimdal documentation does specify that krb5_xfree should be used here and krb5_unparse_name is freed with just free. Signed-off-by: atheik <atteh.mailbox@gmail.com>
-rw-r--r--cifs.upcall.c8
-rw-r--r--configure.ac5
2 files changed, 13 insertions, 0 deletions
diff --git a/cifs.upcall.c b/cifs.upcall.c
index 7a8c374..bf4eb5d 100644
--- a/cifs.upcall.c
+++ b/cifs.upcall.c
@@ -190,6 +190,14 @@ static void krb5_free_unparsed_name(krb5_context context, char *val)
}
#endif
+#if !defined(HAVE_KRB5_FREE_STRING) /* Heimdal */
+static void krb5_free_string(krb5_context context, char *val)
+{
+ (void)context;
+ krb5_xfree(val);
+}
+#endif
+
#if !defined(HAVE_KRB5_AUTH_CON_GETSENDSUBKEY) /* Heimdal */
static krb5_error_code
krb5_auth_con_getsendsubkey(krb5_context context,
diff --git a/configure.ac b/configure.ac
index 19fb3d0..2b1aae6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -256,6 +256,11 @@ if test $enable_cifsupcall != "no"; then
AC_CHECK_FUNCS([krb5_auth_con_setaddrs krb5_auth_con_set_req_cksumtype])
fi
+# determine how to free a string allocated by a krb5 function
+if test $enable_cifsupcall != "no"; then
+ AC_CHECK_FUNCS([krb5_free_string])
+fi
+
if test $enable_systemd != "no"; then
AC_DEFINE(ENABLE_SYSTEMD, 1, [Enable systemd specific behavior for mount.cifs])
fi