Define ENOAUTHSERVICE to indicate "Authentication service unavailable" [ver #2]
Subsystems (10)
PATCH 1/2 Define ENOAUTHSERVICE to indicate "Authentication service unavailable" [ver #2]
As the kernel has or will have filesystems (and possibly other services) that want to obtain authentication tokens and/or encryption data on demand (via GSSAPI for example), it would seem useful to provide an additional error code to indicate a problem with the lookup, rather than overloading some other error code.
We already have EKEYREJECTED, EKEYREVOKED and EKEYEXPIRED to indicate problems with a token that we already have, but what if the authentication server just isn't available?
Define ENOAUTHSERVICE to indicate "Authentication service unavailable". This can be used to indicate, for example, that an attempt was made by request_key() to retrieve a key, but the authentication server (e.g. a KDC) it is supposed to contact didn't answer or that it couldn't determine the location of a suitable server.
One way this can be used is that the user of a network filesystem can get a TGT from the KDC and stash it in their session keyring, then the filesystem can attempt to automatically get a ticket for accessing the filesystem - but if the server is uncontactable then the ticket can be negatively instantiated with KEYCTL_REJECT, giving the error to be handed to future requests as ENOAUTHSERVICE and a small timeout so that the key will expire from the cache and allow a retry after a short while to prevent thrashing.
---
arch/alpha/include/asm/errno.h | 2 ++ arch/mips/include/asm/errno.h | 1 + arch/parisc/include/asm/errno.h | 1 + arch/sparc/include/asm/errno.h | 1 + include/asm-generic/errno.h | 1 + 5 files changed, 6 insertions(+), 0 deletions(-)
arch/alpha/include/asm/errno.h +2 -0
@@ -124,4 +124,6 @@#define EHWPOISON 139/* Memory page has hardware error */ +#define ENOAUTHSERVICE 140/* Authentication service not available */ +#endif
arch/mips/include/asm/errno.h +1 -0
@@ -122,6 +122,7 @@#define ERFKILL 167/* Operation not possible due to RF-kill */ #define EHWPOISON 168/* Memory page has hardware error */ +#define ENOAUTHSERVICE 169/* Authentication service not available */ #define EDQUOT 1133/* Quota exceeded */
arch/parisc/include/asm/errno.h +1 -0
@@ -123,5 +123,6 @@#define ERFKILL 256/* Operation not possible due to RF-kill */ #define EHWPOISON 257/* Memory page has hardware error */ +#define ENOAUTHSERVICE 258/* Authentication service not available */ #endif
arch/sparc/include/asm/errno.h +1 -0
@@ -113,5 +113,6 @@#define ERFKILL 134/* Operation not possible due to RF-kill */ #define EHWPOISON 135/* Memory page has hardware error */ +#define ENOAUTHSERVICE 136/* Authentication service not available */ #endif
include/asm-generic/errno.h +1 -0
@@ -109,5 +109,6 @@#define ERFKILL 132/* Operation not possible due to RF-kill */ #define EHWPOISON 133/* Memory page has hardware error */ +#define ENOAUTHSERVICE 134/* Authentication service not available */ #endif
PATCH 2/2 Define ENONAMESERVICE and ENAMEUNKNOWN to indicate name service errors [ver #2]
Now that the kernel has filesystems (and possibly other services) that want to look up internet addresses corresponding to arbitrary hostnames retrieved from the server, it would seem useful to provide a couple of error codes to indicate problems with the look up, rather than overloading some other error code.
Define ENONAMESERVICE to indicate "Network name service unavailable". This can be used to indicate, for example, that an attempt was made by dns_query() to make a query, but the name server (e.g. a DNS server) it is supposed to contact didn't answer or that it couldn't determine the location of a suitable server.
Define ENAMEUNKNOWN to indicate "Network name unknown". This can be used to indicate, for example, that an attempt was made by dns_query() to make a query, but the name server (e.g. a DNS server) replied indicating that it had no matching records.
The DNS query upcall program can report these to keyctl_reject() so that cached failed queries will respond with these errors until they expire.
---
arch/alpha/include/asm/errno.h | 2 ++ arch/mips/include/asm/errno.h | 2 ++ arch/parisc/include/asm/errno.h | 2 ++ arch/sparc/include/asm/errno.h | 2 ++ include/asm-generic/errno.h | 2 ++ 5 files changed, 10 insertions(+), 0 deletions(-)
arch/alpha/include/asm/errno.h +2 -0
@@ -125,5 +125,7 @@#define EHWPOISON 139/* Memory page has hardware error */ #define ENOAUTHSERVICE 140/* Authentication service not available */ +#define ENONAMESERVICE 141/* Network name service unavailable */ +#define ENAMEUNKNOWN 142/* Network name unknown */ #endif
arch/mips/include/asm/errno.h +2 -0
@@ -123,6 +123,8 @@#define EHWPOISON 168/* Memory page has hardware error */ #define ENOAUTHSERVICE 169/* Authentication service not available */ +#define ENONAMESERVICE 170/* Network name service unavailable */ +#define ENAMEUNKNOWN 171/* Network name unknown */ #define EDQUOT 1133/* Quota exceeded */
arch/parisc/include/asm/errno.h +2 -0
@@ -124,5 +124,7 @@#define EHWPOISON 257/* Memory page has hardware error */ #define ENOAUTHSERVICE 258/* Authentication service not available */ +#define ENONAMESERVICE 259/* Network name service unavailable */ +#define ENAMEUNKNOWN 260/* Network name unknown */ #endif
arch/sparc/include/asm/errno.h +2 -0
@@ -114,5 +114,7 @@#define EHWPOISON 135/* Memory page has hardware error */ #define ENOAUTHSERVICE 136/* Authentication service not available */ +#define ENONAMESERVICE 137/* Network name service unavailable */ +#define ENAMEUNKNOWN 138/* Network name unknown */ #endif
include/asm-generic/errno.h +2 -0
@@ -110,5 +110,7 @@#define EHWPOISON 133/* Memory page has hardware error */ #define ENOAUTHSERVICE 134/* Authentication service not available */ +#define ENONAMESERVICE 135/* Network name service unavailable */ +#define ENAMEUNKNOWN 136/* Network name unknown */ #endif