From 92ff7f21ad0b167f8d742a9d7b5f93704a57619c Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Thu, 24 Apr 2008 02:02:49 +0000 Subject: Major coding style cleanup. Updated all shared code from my other projects. The configure option requesting AFS kaserver support (and thus building kasetkey) is now --with-kaserver instead of --with-afs. If KRB5_CONFIG was explicitly set in the environment, don't use a different krb5-config based on --with-krb4 or --with-krb5. If krb5-config isn't executable, don't use it. This allows one to force library probing by setting KRB5_CONFIG to point to a nonexistent file. Sanity-check the results of krb5-config before proceeding and error out in configure if they don't work. Stop setting Stanford-specific compile-time defaults for the wallet server and port. --- client/internal.h | 102 +++++++++++++++++++++++++++++------------------------- 1 file changed, 55 insertions(+), 47 deletions(-) (limited to 'client/internal.h') diff --git a/client/internal.h b/client/internal.h index ba17b73..64fad04 100644 --- a/client/internal.h +++ b/client/internal.h @@ -1,49 +1,47 @@ -/* $Id$ -** -** Internal support functions for the wallet client. -** -** Written by Russ Allbery -** Copyright 2007, 2008 Board of Trustees, Leland Stanford Jr. University -** -** See LICENSE for licensing terms. -*/ +/* $Id$ + * + * Internal support functions for the wallet client. + * + * Written by Russ Allbery + * Copyright 2007, 2008 Board of Trustees, Leland Stanford Jr. University + * + * See LICENSE for licensing terms. + */ #ifndef CLIENT_INTERNAL_H #define CLIENT_INTERNAL_H 1 +#include + #include #include -#include - /* Forward declarations to avoid unnecessary includes. */ struct remctl; -/* Temporary until we have some real configuration. */ -#ifndef WALLET_SERVER -# define WALLET_SERVER "wallet.stanford.edu" -#endif -#ifndef WALLET_PORT -# define WALLET_PORT 0 -#endif - BEGIN_DECLS -/* Given a Kerberos context and a principal name, obtain Kerberos credentials - for that principal and store them in a memory cache for use by later - operations. */ +/* + * Given a Kerberos context and a principal name, obtain Kerberos credentials + * for that principal and store them in a memory cache for use by later + * operations. + */ void kinit(krb5_context, const char *principal); -/* Given a remctl object, run a remctl command. If data is non-NULL, saves - the standard output from the command into data with the length in length. - Otherwise, prints it to standard output. Either way, prints standard error - output and errors to standard error and returns the exit status or 255 for - a remctl internal error. */ +/* + * Given a remctl object, run a remctl command. If data is non-NULL, saves + * the standard output from the command into data with the length in length. + * Otherwise, prints it to standard output. Either way, prints standard error + * output and errors to standard error and returns the exit status or 255 for + * a remctl internal error. + */ int run_command(struct remctl *, const char **command, char **data, size_t *length); -/* Check whether an object exists using the exists wallet interface. Returns - true if it does, false if it doesn't, and dies on remctl errors. */ +/* + * Check whether an object exists using the exists wallet interface. Returns + * true if it does, false if it doesn't, and dies on remctl errors. + */ int object_exists(struct remctl *, const char *prefix, const char *type, const char *name); @@ -51,34 +49,44 @@ int object_exists(struct remctl *, const char *prefix, const char *type, void object_autocreate(struct remctl *, const char *prefix, const char *type, const char *name); -/* Given a remctl object, the type for the wallet interface, object type, - object name, and a file (which may be NULL), send a wallet get command and - write the results to the provided file. If the file is NULL, write the - results to standard output instead. Returns 0 on success and an exit - status on failure. */ +/* + * Given a remctl object, the type for the wallet interface, object type, + * object name, and a file (which may be NULL), send a wallet get command and + * write the results to the provided file. If the file is NULL, write the + * results to standard output instead. Returns 0 on success and an exit + * status on failure. + */ int get_file(struct remctl *, const char *prefix, const char *type, const char *name, const char *file); -/* Given a remctl object, the Kerberos context, the type for the wallet - interface, the name of a keytab object, and a file name, call the correct - wallet commands to download a keytab and write it to that file. If srvtab - is not NULL, write a srvtab based on the keytab after a successful - download. */ +/* + * Given a remctl object, the Kerberos context, the type for the wallet + * interface, the name of a keytab object, and a file name, call the correct + * wallet commands to download a keytab and write it to that file. If srvtab + * is not NULL, write a srvtab based on the keytab after a successful + * download. + */ int get_keytab(struct remctl *, krb5_context, const char *type, const char *name, const char *file, const char *srvtab); -/* Given a filename, some data, and a length, write that data to the given - file with error checking, overwriting any existing contents. */ +/* + * Given a filename, some data, and a length, write that data to the given + * file with error checking, overwriting any existing contents. + */ void overwrite_file(const char *name, const void *data, size_t length); -/* Given a filename, some data, and a length, write that data to the given - file safely and atomically by creating file.new, writing the data, linking - file to file.bak, and then renaming file.new to file. */ +/* + * Given a filename, some data, and a length, write that data to the given + * file safely and atomically by creating file.new, writing the data, linking + * file to file.bak, and then renaming file.new to file. + */ void write_file(const char *name, const void *data, size_t length); -/* Given a Kerberos context, a srvtab file, the Kerberos v5 principal, and the - keytab file, write a srvtab file for the corresponding Kerberos v4 - principal. */ +/* + * Given a Kerberos context, a srvtab file, the Kerberos v5 principal, and the + * keytab file, write a srvtab file for the corresponding Kerberos v4 + * principal. + */ void write_srvtab(krb5_context, const char *srvtab, const char *principal, const char *keytab); -- cgit v1.2.3