]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/idmapd/idmapd.c
idmapd: Fix decoding of octal encoded fields
[nfs-utils.git] / utils / idmapd / idmapd.c
index 9ecab66f2696adec7cb7e82ebb8cac95146b8b37..19d91147eaed2a990694a33e683e99e1fcef892c 100644 (file)
@@ -119,8 +119,8 @@ struct idmap_client {
 static struct idmap_client nfsd_ic[2] = {
 {
        .ic_which = IC_IDNAME, 
-       .ic_clid = "Server", 
-       .ic_id = "", 
+       .ic_clid = "", 
+       .ic_id = "Server", 
        .ic_path = IC_IDNAME_CHAN, 
        .ic_fd = -1, 
        .ic_dirfd = -1, 
@@ -128,8 +128,8 @@ static struct idmap_client nfsd_ic[2] = {
 },
 {
        .ic_which = IC_NAMEID, 
-       .ic_clid = "Server", 
-       .ic_id = "", 
+       .ic_clid = "", 
+       .ic_id = "Server", 
        .ic_path = IC_NAMEID_CHAN, 
        .ic_fd = -1, 
        .ic_dirfd = -1, 
@@ -158,10 +158,6 @@ static int nfsdopenone(struct idmap_client *);
 static void nfsdreopen_one(struct idmap_client *);
 static void nfsdreopen(void);
 
-size_t  strlcat(char *, const char *, size_t);
-size_t  strlcpy(char *, const char *, size_t);
-ssize_t atomicio(ssize_t (*f) (int, void*, size_t),
-                int, void *, size_t);
 void    mydaemon(int, int);
 void    release_parent(void);
 
@@ -929,9 +925,9 @@ getfield(char **bpp, char *fld, size_t fldsz)
                if (*bp == '\\') {
                        if ((n = sscanf(bp, "\\%03o", &val)) != 1)
                                return (-1);
-                       if (val > (char)-1)
+                       if (val > UCHAR_MAX)
                                return (-1);
-                       *fld++ = (char)val;
+                       *fld++ = val;
                        bp += 4;
                } else {
                        *fld++ = *bp;