1999-09-01 Danilo Almeida <dalmeida@mit.edu>
* kuserok.c (krb5_kuserok): Fix improper negation in
non-Unix localname check. Also fix calling convention
before this function is exported by the Windows DLL.
* localaddr.c (krb5_os_localaddr): Fix memset to clear
right address list. (Thanks to jaltman@columbia.edu).
1999-09-01 Ken Raeburn <raeburn@mit.edu>
* get_krbhst.c (krb5_get_krbhst): Fix double-indirection
confusion. Do actually copy string contents to newly allocated
storage.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11780
dc483132-0cff-0310-8789-
dd5450dbe970
+1999-09-01 Danilo Almeida <dalmeida@mit.edu>
+
+ * kuserok.c (krb5_kuserok): Fix improper negation in
+ non-Unix localname check. Also fix calling convention
+ before this function is exported by the Windows DLL.
+
+ * localaddr.c (krb5_os_localaddr): Fix memset to clear
+ right address list. (Thanks to jaltman@columbia.edu).
+
+1999-09-01 Ken Raeburn <raeburn@mit.edu>
+
+ * get_krbhst.c (krb5_get_krbhst): Fix double-indirection
+ confusion. Do actually copy string contents to newly allocated
+ storage.
+
1999-08-21 Danilo Almeida <dalmeida@mit.edu>
* localaddr.c (krb5_os_localaddr): Use multiple addresses, if
const char *realm_kdc_names[4];
krb5_error_code retval;
int i, count;
+ char **rethosts;
- *hostlist = 0;
+ rethosts = 0;
realm_kdc_names[0] = "realms";
realm_kdc_names[1] = realm->data;
*cp = 0;
}
count = cpp - values;
- *hostlist = malloc(sizeof(char *) * (count + 1));
- if (!*hostlist) {
+ rethosts = malloc(sizeof(char *) * (count + 1));
+ if (!rethosts) {
retval = ENOMEM;
goto cleanup;
}
for (i = 0; i < count; i++) {
- *hostlist[i] = malloc(strlen(values[i]) + 1);
- if (!*hostlist[i]) {
+ int len = strlen (values[i]) + 1;
+ rethosts[i] = malloc(len);
+ if (!rethosts[i]) {
retval = ENOMEM;
goto cleanup;
}
+ memcpy (rethosts[i], values[i], len);
}
- *hostlist[count] = 0;
+ rethosts[count] = 0;
cleanup:
- if (retval && *hostlist) {
- for (cpp = *hostlist; *cpp; cpp++)
+ if (retval && rethosts) {
+ for (cpp = rethosts; *cpp; cpp++)
free(*cpp);
- free(*hostlist);
+ free(rethosts);
+ rethosts = 0;
}
profile_free_list(values);
+ *hostlist = rethosts;
return retval;
}
*
*/
-krb5_boolean
+krb5_boolean KRB5_CALLCONV
krb5_kuserok(context, principal, luser)
krb5_context context;
krb5_principal principal;
* If the given Kerberos name "server" translates to the same name as "luser"
* (using * krb5_aname_to_lname()), returns TRUE.
*/
-krb5_boolean
+krb5_boolean KRB5_CALLCONV
krb5_kuserok(context, principal, luser)
krb5_context context;
krb5_principal principal;
{
char kuser[50];
- if (! krb5_aname_to_localname(context, principal, sizeof(kuser), kuser))
+ if (krb5_aname_to_localname(context, principal, sizeof(kuser), kuser))
return FALSE;
if (strcmp(kuser, luser) == 0)
goto cleanup;
}
- memset(addr, 0, sizeof(krb5_address *) * (count+1));
+ memset(paddr, 0, sizeof(krb5_address *) * (count+1));
for (i = 0; i < count; i++)
{