• Kinglong Mee's avatar
    nfsd/idmap: return nfserr_inval for 0-length names · c3821b34
    Kinglong Mee authored
    Tigran Mkrtchyan's new pynfs testcases for zero length principals fail:
    
    SATT16   st_setattr.testEmptyPrincipal                            : FAILURE
               Setting empty owner should return NFS4ERR_INVAL,
               instead got NFS4ERR_BADOWNER
    SATT17   st_setattr.testEmptyGroupPrincipal                       : FAILURE
               Setting empty owner_group should return NFS4ERR_INVAL,
               instead got NFS4ERR_BADOWNER
    
    This patch checks the principal and returns nfserr_inval directly.  It
    could check after decoding in nfs4xdr.c, but it's simpler to do it in
    nfsd_map_xxxx.
    Signed-off-by: default avatarKinglong Mee <kinglongmee@gmail.com>
    Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
    c3821b34
nfs4idmap.c 16.1 KB