]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Treat GSSAPI error codes as unsigned.
authorKevin Coffman <kwc@citi.umich.edu>
Thu, 8 Feb 2007 22:27:09 +0000 (17:27 -0500)
committerNeil Brown <neilb@suse.de>
Fri, 9 Feb 2007 00:41:45 +0000 (11:41 +1100)
Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
GSSAPI error codes (major and minor) are defined as unsigned values.
However, we treat them as signed while passing them down to the
kernel where conversion fails if they include the minus sign.
Convert them as unsigned.
Signed-off-by: Neil Brown <neilb@suse.de>
utils/gssd/cacheio.c
utils/gssd/cacheio.h
utils/gssd/svcgssd_proc.c

index f2f2960ca3491685d0285a60be457ed52b042ccc..e24ef56f7970dd17e5219e12d7ccc2d6f4cad8b0 100644 (file)
@@ -132,6 +132,17 @@ void qword_addint(char **bpp, int *lp, int n)
        *lp -= len;
 }
 
+void qword_adduint(char **bpp, int *lp, unsigned int n)
+{
+       int len;
+
+       len = snprintf(*bpp, *lp, "%u ", n);
+       if (len > *lp)
+               len = *lp;
+       *bpp += len;
+       *lp -= len;
+}
+
 void qword_addeol(char **bpp, int *lp)
 {
        if (*lp <= 0)
index dfff2586ae23ab8942296af35ab5d9b68f326ee4..6585fc71bb1983668b204945e70760006aa528d5 100644 (file)
@@ -36,6 +36,7 @@
 void qword_add(char **bpp, int *lp, char *str);
 void qword_addhex(char **bpp, int *lp, char *buf, int blen);
 void qword_addint(char **bpp, int *lp, int n);
+void qword_adduint(char **bpp, int *lp, unsigned int n);
 void qword_addeol(char **bpp, int *lp);
 void qword_print(FILE *f, char *str);
 void qword_printhex(FILE *f, char *str, int slen);
index 4037159b2ede2f737d0229728c15425ff9acdbd3..7c58f7bf1b1c10709682fff269c46767404a1161 100644 (file)
@@ -125,8 +125,8 @@ send_response(FILE *f, gss_buffer_desc *in_handle, gss_buffer_desc *in_token,
        qword_addhex(&bp, &blen, in_handle->value, in_handle->length);
        qword_addhex(&bp, &blen, in_token->value, in_token->length);
        qword_addint(&bp, &blen, 0x7fffffff); /*XXX need a better timeout */
-       qword_addint(&bp, &blen, maj_stat);
-       qword_addint(&bp, &blen, min_stat);
+       qword_adduint(&bp, &blen, maj_stat);
+       qword_adduint(&bp, &blen, min_stat);
        qword_addhex(&bp, &blen, out_handle->value, out_handle->length);
        qword_addhex(&bp, &blen, out_token->value, out_token->length);
        qword_addeol(&bp, &blen);