diff options
author | Steve Dickson <steved@redhat.com> | 2012-11-17 08:50:09 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2012-11-19 10:44:30 -0500 |
commit | e07913c2c5e4dc5e406c2cb12cf78150cab3d95a (patch) | |
tree | 2f6ec819201004f4c69db204a919577cc8c6529c | |
parent | ebc81ebb479853cee00d3279052cbfaaa29a3823 (diff) | |
download | nfs-utils-e07913c2c5e4dc5e406c2cb12cf78150cab3d95a.tar.gz nfs-utils-e07913c2c5e4dc5e406c2cb12cf78150cab3d95a.tar.xz nfs-utils-e07913c2c5e4dc5e406c2cb12cf78150cab3d95a.zip |
svcgssd: Encryption types not being parsed correctly
When svcgssd reads the supported encrytion types from the
kernel, they are prefixed with a 'enctypes='. That prefix
has to be ignored to correctly parse the rest of the types.
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | utils/gssd/svcgssd_krb5.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/gssd/svcgssd_krb5.c b/utils/gssd/svcgssd_krb5.c index 6c34faf..1d44d34 100644 --- a/utils/gssd/svcgssd_krb5.c +++ b/utils/gssd/svcgssd_krb5.c @@ -38,6 +38,7 @@ #include <stdio.h> #include <errno.h> +#include <ctype.h> #include <gssapi/gssapi.h> #include <krb5.h> @@ -98,6 +99,12 @@ parse_enctypes(char *enctypes) if (n == 0) return ENOENT; + /* Skip pass any non digits */ + while (*enctypes && isdigit(*enctypes) == 0) + enctypes++; + if (*enctypes == '\0') + return EINVAL; + /* Allocate space for enctypes array */ if ((parsed_enctypes = (int *) calloc(n, sizeof(int))) == NULL) { return ENOMEM; |