[OpenAFS] asetkey: failed to set key, code 70354694
Marcus Watts
mdw@umich.edu
Mon, 09 Apr 2007 15:46:53 -0400
Derrick J Brashear <shadow@dementia.org> writes:
>
> "com_err sucks"
>
> Well, more precisely "no 2 com_errs are alike"
>
Ok, so there is the whole com_err mess. But openafs has
its own com_err so that "shouldn't" matter.
...
adogslife-root# ./asetkey add 9 /tmp/afs.foo.kt afs/foo7
adogslife-root# ./asetkey add 10 /tmp/afs.foo.kt afs/foo8
adogslife-root# ./asetkey add 11 /tmp/afs.foo.kt afs/foo9
adogslife-root# ./asetkey add 8 /tmp/afs.foo.kt afs/foo6
./asetkey: no more entries so failed to set key
adogslife-root# ./asetkey delete 30
./asetkey: could not find entry so failed to delete key 30
adogslife-root#
adogslife$ cvs diff -u asetkey.c
Index: asetkey.c
===================================================================
RCS file: /afs/umich.edu/group/itd/build/mdw/openafs/cvs/openafs/src/aklog/asetkey.c,v
retrieving revision 1.8
diff -u -r1.8 asetkey.c
--- asetkey.c 28 Jan 2007 03:16:44 -0000 1.8
+++ asetkey.c 9 Apr 2007 19:31:47 -0000
@@ -65,6 +65,7 @@
confdir = AFSDIR_SERVER_ETC_DIRPATH;
+ initialize_ACFG_error_table();
tdir = afsconf_Open(confdir);
if (!tdir) {
fprintf(stderr, "%s: can't initialize conf dir '%s'\n", argv[0],
@@ -120,7 +121,7 @@
code = afsconf_AddKey(tdir, kvno, (char *) deref_key_contents(key), 1);
if (code) {
- fprintf(stderr, "%s: failed to set key, code %d.\n", argv[0], code);
+ com_err(argv[0], code, "so failed to set key");
exit(1);
}
krb5_free_principal(context, principal);
@@ -136,8 +137,7 @@
kvno = atoi(argv[2]);
code = afsconf_DeleteKey(tdir, kvno);
if (code) {
- fprintf(stderr, "%s: failed to delete key %d, (code %d)\n",
- argv[0], kvno, code);
+ com_err(argv[0], code, "so failed to delete key %d", kvno);
exit(1);
}
}
@@ -147,7 +147,7 @@
code = afsconf_GetKeys(tdir, &tkeys);
if (code) {
- fprintf(stderr, "%s: failed to get keys, code %d\n", argv[0], code);
+ com_err(argv[0], code, "so failed to get keys");
exit(1);
}
for(i=0;i<tkeys.nkeys;i++) {