diff options
Diffstat (limited to 'src/lib/krb5/rcache/rc_io.c')
-rw-r--r-- | src/lib/krb5/rcache/rc_io.c | 76 |
1 files changed, 32 insertions, 44 deletions
diff --git a/src/lib/krb5/rcache/rc_io.c b/src/lib/krb5/rcache/rc_io.c index 1930d7e9d..7e3b7e951 100644 --- a/src/lib/krb5/rcache/rc_io.c +++ b/src/lib/krb5/rcache/rc_io.c @@ -102,16 +102,15 @@ krb5_rc_io_mkstemp(krb5_context context, krb5_rc_iostuff *d, char *dir) */ retval = fstat(d->fd, &stbuf); if (retval) { - krb5_set_error_message(context, retval, - _("Cannot fstat replay cache file %s: %s"), - d->fn, strerror(errno)); + k5_setmsg(context, retval, + _("Cannot fstat replay cache file %s: %s"), + d->fn, strerror(errno)); return KRB5_RC_IO_UNKNOWN; } if (stbuf.st_mode & 077) { - krb5_set_error_message(context, retval, - _("Insecure mkstemp() file mode for replay " - "cache file %s; try running this program " - "with umask 077 "), d->fn); + k5_setmsg(context, retval, + _("Insecure mkstemp() file mode for replay cache file %s; " + "try running this program with umask 077"), d->fn); return KRB5_RC_IO_UNKNOWN; } #endif @@ -141,15 +140,14 @@ rc_map_errno (krb5_context context, int e, const char *fn, case EACCES: case EROFS: case EEXIST: - krb5_set_error_message(context, KRB5_RC_IO_PERM, - _("Cannot %s replay cache file %s: %s"), - operation, fn, strerror(e)); + k5_setmsg(context, KRB5_RC_IO_PERM, + _("Cannot %s replay cache file %s: %s"), + operation, fn, strerror(e)); return KRB5_RC_IO_PERM; default: - krb5_set_error_message(context, KRB5_RC_IO_UNKNOWN, - _("Cannot %s replay cache: %s"), - operation, strerror(e)); + k5_setmsg(context, KRB5_RC_IO_UNKNOWN, _("Cannot %s replay cache: %s"), + operation, strerror(e)); return KRB5_RC_IO_UNKNOWN; } } @@ -261,22 +259,20 @@ krb5_rc_io_open_internal(krb5_context context, krb5_rc_iostuff *d, char *fn, || (sb1.st_mode & S_IFMT) != S_IFREG) { retval = KRB5_RC_IO_PERM; - krb5_set_error_message(context, retval, - "rcache not a file %s", d->fn); + k5_setmsg(context, retval, "rcache not a file %s", d->fn); goto cleanup; } /* check that non other can read/write/execute the file */ if (sb1.st_mode & 077) { - krb5_set_error_message(context, retval, - _("Insecure file mode for replay cache file " - "%s"), d->fn); + k5_setmsg(context, retval, + _("Insecure file mode for replay cache file %s"), d->fn); return KRB5_RC_IO_UNKNOWN; } /* owned by me */ if (sb1.st_uid != geteuid()) { retval = KRB5_RC_IO_PERM; - krb5_set_error_message(context, retval, _("rcache not owned by %d"), - (int)geteuid()); + k5_setmsg(context, retval, _("rcache not owned by %d"), + (int)geteuid()); goto cleanup; } #endif @@ -398,20 +394,17 @@ krb5_rc_io_write(krb5_context context, krb5_rc_iostuff *d, krb5_pointer buf, #endif case EFBIG: case ENOSPC: - krb5_set_error_message (context, KRB5_RC_IO_SPACE, - _("Can't write to replay cache: %s"), - strerror(errno)); + k5_setmsg(context, KRB5_RC_IO_SPACE, + _("Can't write to replay cache: %s"), strerror(errno)); return KRB5_RC_IO_SPACE; case EIO: - krb5_set_error_message (context, KRB5_RC_IO_IO, - _("Can't write to replay cache: %s"), - strerror(errno)); + k5_setmsg(context, KRB5_RC_IO_IO, + _("Can't write to replay cache: %s"), strerror(errno)); return KRB5_RC_IO_IO; case EBADF: default: - krb5_set_error_message (context, KRB5_RC_IO_UNKNOWN, - _("Can't write to replay cache: %s"), - strerror(errno)); + k5_setmsg(context, KRB5_RC_IO_UNKNOWN, + _("Can't write to replay cache: %s"), strerror(errno)); return KRB5_RC_IO_UNKNOWN; } return 0; @@ -431,9 +424,8 @@ krb5_rc_io_sync(krb5_context context, krb5_rc_iostuff *d) case EBADF: return KRB5_RC_IO_UNKNOWN; case EIO: return KRB5_RC_IO_IO; default: - krb5_set_error_message(context, KRB5_RC_IO_UNKNOWN, - _("Cannot sync replay cache file: %s"), - strerror(errno)); + k5_setmsg(context, KRB5_RC_IO_UNKNOWN, + _("Cannot sync replay cache file: %s"), strerror(errno)); return KRB5_RC_IO_UNKNOWN; } } @@ -451,9 +443,8 @@ krb5_rc_io_read(krb5_context context, krb5_rc_iostuff *d, krb5_pointer buf, case EIO: return KRB5_RC_IO_IO; case EBADF: default: - krb5_set_error_message(context, KRB5_RC_IO_UNKNOWN, - _("Can't read from replay cache: %s"), - strerror(errno)); + k5_setmsg(context, KRB5_RC_IO_UNKNOWN, + _("Can't read from replay cache: %s"), strerror(errno)); return KRB5_RC_IO_UNKNOWN; } if (count < 0 || (unsigned int)count != num) @@ -483,22 +474,19 @@ krb5_rc_io_destroy(krb5_context context, krb5_rc_iostuff *d) switch(errno) { case EIO: - krb5_set_error_message(context, KRB5_RC_IO_IO, - _("Can't destroy replay cache: %s"), - strerror(errno)); + k5_setmsg(context, KRB5_RC_IO_IO, + _("Can't destroy replay cache: %s"), strerror(errno)); return KRB5_RC_IO_IO; case EPERM: case EBUSY: case EROFS: - krb5_set_error_message(context, KRB5_RC_IO_PERM, - _("Can't destroy replay cache: %s"), - strerror(errno)); + k5_setmsg(context, KRB5_RC_IO_PERM, + _("Can't destroy replay cache: %s"), strerror(errno)); return KRB5_RC_IO_PERM; case EBADF: default: - krb5_set_error_message(context, KRB5_RC_IO_UNKNOWN, - _("Can't destroy replay cache: %s"), - strerror(errno)); + k5_setmsg(context, KRB5_RC_IO_UNKNOWN, + _("Can't destroy replay cache: %s"), strerror(errno)); return KRB5_RC_IO_UNKNOWN; } return 0; |