krb5_svc_get_msg(code,&str);
#elif defined(HAVE_KRB5_GET_ERROR_MESSAGE)
krb5_context context;
- krb5_init_context(&context);
- str = krb5_get_error_message(context, code);
- krb5_free_context(context);
+ if (krb5_init_context(&context) == 0) {
+ str = krb5_get_error_message(context, code);
+ krb5_free_context(context);
+ }
#else
; /* IRIX apparently has neither: use the string we have */
#endif
exit(AKLOG_AFS);
}
- if (afsconf_GetLocalCell(configdir, *local_cell, MAXCELLCHARS)) {
- fprintf(stderr, "%s: can't determine local cell.\n", progname);
- exit(AKLOG_AFS);
+ if (cell != NULL && cell[0] == '\0') {
+ /* Use the local cell */
+ cell = NULL;
}
- if ((cell == NULL) || (cell[0] == 0))
- cell = *local_cell;
-
/* XXX - This function modifies 'cell' by passing it through lcstring */
if (afsconf_GetCellInfo(configdir, cell, NULL, cellconfig)) {
- fprintf(stderr, "%s: Can't get information about cell %s.\n",
- progname, cell);
+ if (cell != NULL) {
+ fprintf(stderr, "%s: Can't get information about cell %s.\n",
+ progname, cell);
+ } else {
+ fprintf(stderr, "%s: Can't get information about the local cell.\n",
+ progname);
+ }
status = AKLOG_AFS;
+ } else if (afsconf_GetLocalCell(configdir, *local_cell, MAXCELLCHARS)) {
+ fprintf(stderr, "%s: can't determine local cell.\n", progname);
+ exit(AKLOG_AFS);
}
afsconf_Close(configdir);
* We don't care about the return value, but need to collect it
* to avoid compiler warnings.
*/
- if (write(2,"",0) < 0) /* dummy write */
- ; /* don't care */
+ if (write(2,"",0) < 0) {
+ /* dummy write, don't care */
+ }
#endif
token_setPag(token, afssetpag);
status = ktc_SetTokenEx(token);