Get rid of AUTH completely and replace all uses with 'struct AUTH'
[deb_libnfs.git] / lib / libnfs-zdr.c
index 315aa0afd7f45eb04bd155d5aba8cf6c09c8828e..fd80a8d1c7f33e3c853378008c2bbcdcb2cff41f 100644 (file)
@@ -30,6 +30,8 @@ struct opaque_auth _null_auth;
 bool_t libnfs_zdr_setpos(ZDR *zdrs, uint32_t pos)
 {
        zdrs->pos = pos;
+
+       return TRUE;
 }
 
 uint32_t libnfs_zdr_getpos(ZDR *zdrs)
@@ -284,7 +286,7 @@ static bool_t libnfs_opaque_auth(ZDR *zdrs, struct opaque_auth *auth)
                return FALSE;
        }
 
-       if (!libnfs_zdr_bytes(zdrs, &auth->oa_base, &auth->oa_length, &auth->oa_length)) {
+       if (!libnfs_zdr_bytes(zdrs, &auth->oa_base, &auth->oa_length, auth->oa_length)) {
                return FALSE;
        }
 
@@ -316,6 +318,8 @@ static bool_t libnfs_rpc_call_body(ZDR *zdrs, struct call_body *cmb)
        if (!libnfs_opaque_auth(zdrs, &cmb->cb_verf)) {
                return FALSE;
        }
+
+       return TRUE;
 }
 
 static bool_t libnfs_accepted_reply(ZDR *zdrs, struct accepted_reply *ar)
@@ -409,11 +413,11 @@ bool_t libnfs_zdr_replymsg(ZDR *zdrs, struct rpc_msg *msg)
        return libnfs_rpc_msg(zdrs, msg);
 }
 
-AUTH *authnone_create(void)
+struct AUTH *authnone_create(void)
 {
-       AUTH *auth;
+       struct AUTH *auth;
 
-       auth = malloc(sizeof(AUTH));
+       auth = malloc(sizeof(struct AUTH));
 
        auth->ah_cred.oa_flavor = AUTH_NONE;
        auth->ah_cred.oa_length = 0;
@@ -428,20 +432,20 @@ AUTH *authnone_create(void)
        return auth;
 }
 
-AUTH *libnfs_authunix_create(char *host, uint32_t uid, uint32_t gid, uint32_t len, uint32_t *groups)
+struct AUTH *libnfs_authunix_create(char *host, uint32_t uid, uint32_t gid, uint32_t len, uint32_t *groups)
 {
-       AUTH *auth;
+       struct AUTH *auth;
        int size;
        uint32_t *buf;
        int idx;
 
        size = 4 + 4 + ((strlen(host) + 3) & ~3) + 4 + 4 + 4 + len * 4;
-       auth = malloc(sizeof(AUTH));
+       auth = malloc(sizeof(struct AUTH));
        auth->ah_cred.oa_flavor = AUTH_UNIX;
        auth->ah_cred.oa_length = size;
        auth->ah_cred.oa_base = malloc(size);
 
-       buf = auth->ah_cred.oa_base;
+       buf = (uint32_t *)auth->ah_cred.oa_base;
        idx = 0;
        buf[idx++] = htonl(time(NULL));
        buf[idx++] = htonl(strlen(host));
@@ -464,12 +468,12 @@ AUTH *libnfs_authunix_create(char *host, uint32_t uid, uint32_t gid, uint32_t le
        return auth;
 }
 
-AUTH *libnfs_authunix_create_default(void)
+struct AUTH *libnfs_authunix_create_default(void)
 {
        return libnfs_authunix_create("libnfs", getuid(), -1, 0, NULL);
 }
 
-void libnfs_auth_destroy(AUTH *auth)
+void libnfs_auth_destroy(struct AUTH *auth)
 {
        if (auth->ah_cred.oa_base) {
                free(auth->ah_cred.oa_base);