[openssh-commits] [openssh] 04/05: Constify aix_krb5_get_principal_name.
git+noreply at mindrot.org
git+noreply at mindrot.org
Mon Feb 17 22:56:56 AEDT 2020
This is an automated email from the git hooks/post-receive script.
dtucker pushed a commit to branch master
in repository openssh.
commit 31c9348c5e4e94e9913ec64b3ca6e15f68ba19e5
Author: Darren Tucker <dtucker at dtucker.net>
Date: Mon Feb 17 22:53:24 2020 +1100
Constify aix_krb5_get_principal_name.
Prevents warning about discarding type qualifiers on AIX.
---
openbsd-compat/port-aix.c | 10 ++++++----
openbsd-compat/port-aix.h | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c
index e1ad3f11..e0d3eba5 100644
--- a/openbsd-compat/port-aix.c
+++ b/openbsd-compat/port-aix.c
@@ -383,12 +383,13 @@ aix_restoreauthdb(void)
# ifdef USE_AIX_KRB_NAME
/*
- * aix_krb5_get_principal_name: returns the user's kerberos client principal name if
- * configured, otherwise NULL. Caller must free returned string.
+ * aix_krb5_get_principal_name: returns the user's kerberos client principal
+ * name if configured, otherwise NULL. Caller must free returned string.
*/
char *
-aix_krb5_get_principal_name(char *pw_name)
+aix_krb5_get_principal_name(const char *const_pw_name)
{
+ char *pw_name = (char *)const_pw_name;
char *authname = NULL, *authdomain = NULL, *principal = NULL;
setuserdb(S_READ);
@@ -398,7 +399,8 @@ aix_krb5_get_principal_name(char *pw_name)
debug("AIX getuserattr S_AUTHNAME: %s", strerror(errno));
if (authdomain != NULL)
- xasprintf(&principal, "%s@%s", authname ? authname : pw_name, authdomain);
+ xasprintf(&principal, "%s@%s", authname ? authname : pw_name,
+ authdomain);
else if (authname != NULL)
principal = xstrdup(authname);
enduserdb();
diff --git a/openbsd-compat/port-aix.h b/openbsd-compat/port-aix.h
index 904de309..0ee36614 100644
--- a/openbsd-compat/port-aix.h
+++ b/openbsd-compat/port-aix.h
@@ -97,7 +97,7 @@ char *sys_auth_get_lastlogin_msg(const char *, uid_t);
# define CUSTOM_FAILED_LOGIN 1
# if defined(S_AUTHDOMAIN) && defined (S_AUTHNAME)
# define USE_AIX_KRB_NAME
-char *aix_krb5_get_principal_name(char *);
+char *aix_krb5_get_principal_name(const char *);
# endif
#endif
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list