Skip to content

Commit

Permalink
lib/krb5_wrap: provide krb5_warnx() replacement.
Browse files Browse the repository at this point in the history
Guenther

Signed-off-by: Günther Deschner <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>

Autobuild-User(master): Andrew Bartlett <[email protected]>
Autobuild-Date(master): Fri Aug  8 08:30:50 CEST 2014 on sn-devel-104
  • Loading branch information
gd authored and abartlet committed Aug 8, 2014
1 parent c0d0006 commit 9c5470b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/krb5_wrap/krb5_samba.c
Original file line number Diff line number Diff line change
Expand Up @@ -2592,6 +2592,29 @@ int smb_krb5_principal_get_type(krb5_context context,
#endif
}

/**
* @brief Generate a krb5 warning, forwarding to com_err
*
* @param context The krb5_context
* @param fmt The message format
* @param ... The message arguments
*
* @return
*/
#if !defined(HAVE_KRB5_WARNX)
krb5_error_code krb5_warnx(krb5_context context, const char *fmt, ...)
{
va_list args;

va_start(args, fmt);
DEBUG(1,(fmt, args));
DEBUGADD(1,("\n"));
va_end(args);

return 0;
}
#endif

#else /* HAVE_KRB5 */
/* this saves a few linking headaches */
int cli_krb5_get_ticket(TALLOC_CTX *mem_ctx,
Expand Down
4 changes: 4 additions & 0 deletions lib/krb5_wrap/krb5_samba.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,10 @@ krb5_error_code krb5_copy_data_contents(krb5_data *p,
int smb_krb5_principal_get_type(krb5_context context,
krb5_const_principal principal);

#if !defined(HAVE_KRB5_WARNX)
krb5_error_code krb5_warnx(krb5_context context, const char *fmt, ...);
#endif

#endif /* HAVE_KRB5 */

int cli_krb5_get_ticket(TALLOC_CTX *mem_ctx,
Expand Down
1 change: 1 addition & 0 deletions source4/heimdal_build/wscript_configure
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ conf.define('HAVE_KRB5_CONFIG_GET_BOOL_DEFAULT', 1)
conf.define('HAVE_KRB5_DATA_COPY', 1)
conf.define('HAVE_KRB5_PRINCIPAL_SET_REALM', 1)
conf.define('HAVE_KRB5_PRINCIPAL_GET_TYPE', 1)
conf.define('HAVE_KRB5_WARNX', 1)

heimdal_includedirs = []
heimdal_libdirs = []
Expand Down
1 change: 1 addition & 0 deletions wscript_configure_system_mitkrb5
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ conf.CHECK_FUNCS('''
krb5_config_get_bool_default krb5_get_profile
krb5_data_copy
krb5_keyblock_init krb5_principal_set_realm krb5_principal_get_type
krb5_warnx
''',
lib='krb5 k5crypto')
conf.CHECK_DECLS('''krb5_get_credentials_for_user
Expand Down

0 comments on commit 9c5470b

Please sign in to comment.