summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2007-08-29 21:42:25 +0000
committerRuss Allbery <rra@stanford.edu>2007-08-29 21:42:25 +0000
commit53b27504ee9c1e323c5842d82862e40cdafe408f (patch)
tree5234e3f5cad20cc9b226285ca60daed868906532
parent68f5fbb99b9c58baf7d04ba371df77e28022b318 (diff)
Kill warnings. We now build with all warnings enabled.
-rw-r--r--client/wallet.c3
-rw-r--r--configure.ac3
-rw-r--r--kasetkey/kasetkey.c28
3 files changed, 25 insertions, 9 deletions
diff --git a/client/wallet.c b/client/wallet.c
index 7b62c1f..05066f2 100644
--- a/client/wallet.c
+++ b/client/wallet.c
@@ -72,7 +72,6 @@ main(int argc, char *argv[])
long tmp;
char *end;
- command[0] = "wallet";
while ((option = getopt(argc, argv, "c:f:k:hp:S:s:v")) != EOF) {
switch (option) {
case 'c':
@@ -162,7 +161,7 @@ main(int argc, char *argv[])
if (status < 0) {
fprintf(stderr, "write to %s failed: %s", file, strerror(errno));
exit(1);
- } else if (status != result->stdout_len) {
+ } else if (status != (ssize_t) result->stdout_len) {
fprintf(stderr, "write to %s truncated", file);
exit(1);
}
diff --git a/configure.ac b/configure.ac
index d309f5b..e48c18f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,6 +69,9 @@ AC_CHECK_LIB([afsauthent], [KAM_DeleteUser],
LDFLAGS="$save_LDFLAGS"
AC_SUBST([AFS_LIBS])
+AC_CHECK_HEADERS([kerberosIV/krb.h])
+AC_CHECK_DECLS([ubik_Call], , , [#include <ubik.h>])
+
AC_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([Makefile perl/Makefile.PL])
AC_CONFIG_FILES([tests/client/basic-t], [chmod +x tests/client/basic-t])
diff --git a/kasetkey/kasetkey.c b/kasetkey/kasetkey.c
index 0e477f5..2210866 100644
--- a/kasetkey/kasetkey.c
+++ b/kasetkey/kasetkey.c
@@ -23,10 +23,17 @@
#include <sys/types.h>
#include <unistd.h>
+#ifdef HAVE_KERBEROSIV_KRB_H
+# include <kerberosIV/krb.h>
+#else
+# include <krb.h>
+#endif
+
#include <afs/stds.h>
#include <afs/kauth.h>
#include <afs/kautils.h>
#include <afs/cellconfig.h>
+#include <ubik.h>
/* Normally set by the AFS libraries. */
#ifndef SNAME_SZ
@@ -35,6 +42,13 @@
# define REALM_SZ 40
#endif
+/* AFS currently doesn't prototype this function. Cheat on the first argument
+ since it actually takes a function with a completely variable argument
+ list. */
+#if !HAVE_DECL_UBIK_CALL
+afs_int32 ubik_Call(void *, struct ubik_client *, afs_int32, ...);
+#endif
+
/* The name of the program, for error reporting. */
static const char *program = NULL;
@@ -173,11 +187,11 @@ write_srvtab(const char *filename, const char *name, const char *inst,
fd = open(filename, O_WRONLY | O_CREAT, 0600);
if (fd == -1)
sysdie("can't create srvtab %s", filename);
- if (write(fd, name, strlen(name) + 1) != strlen(name) + 1)
+ if (write(fd, name, strlen(name) + 1) != (ssize_t) strlen(name) + 1)
sysdie("can't write to srvtab %s", filename);
- if (write(fd, inst, strlen(inst) + 1) != strlen(inst) + 1)
+ if (write(fd, inst, strlen(inst) + 1) != (ssize_t) strlen(inst) + 1)
sysdie("can't write to srvtab %s", filename);
- if (write(fd, realm, strlen(realm) + 1) != strlen(realm) + 1)
+ if (write(fd, realm, strlen(realm) + 1) != (ssize_t) strlen(realm) + 1)
sysdie("can't write to srvtab %s", filename);
if (write(fd, &kvno, 1) != 1)
sysdie("can't write to srvtab %s", filename);
@@ -272,7 +286,7 @@ authenticate(struct config *config, struct ktc_token *token)
/* Delete a principal out of the AFS kaserver. */
-void
+static void
delete_principal(struct config *config)
{
struct ktc_token token;
@@ -309,7 +323,7 @@ delete_principal(struct config *config)
* the key from an existing srvtab (likely created via Kerberos v5 kadmin from
* a keytab).
*/
-void
+static void
generate_srvtab(struct config *config)
{
struct ktc_token token;
@@ -348,6 +362,7 @@ generate_srvtab(struct config *config)
fclose(srvtab);
/* Now parse it. Fields are delimited by NUL. */
+ p = buffer;
strncpy(sname, p, SNAME_SZ - 1);
sname[sizeof(sname) - 1] = '\0';
p += strlen(sname) + 1;
@@ -368,7 +383,7 @@ generate_srvtab(struct config *config)
if (code != 0)
die("can't get random key");
} else {
- code = ka_ReadPassword("service password: ", 1, cell, &key);
+ code = ka_ReadPassword((char *) "service password: ", 1, cell, &key);
if (code != 0)
die("can't read password");
}
@@ -399,7 +414,6 @@ generate_srvtab(struct config *config)
char realm[MAXKTCREALMLEN];
int local;
unsigned char kvno = 0;
- int sfd;
if (ka_CellToRealm(cell, realm, &local) == KANOCELL)
die("unable to determine realm");