[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

anon[ug]id doesn't work in netstd! :-(



Package: netstd
Version: 3.07-2

I built an exports configuration with the anongid and map_static
options, and found that anongid is not honoured... The anonymous
mapping in the static file always goes to nobody/nogroup, regardless
of the anon[ug]id options.

Looking at the source I found this beautiful peace of CRAP at the end
of mountd.c:

/*
 * Don't look. This is an awful hack to overcome a link problem with
 * auth_clnt temporarily.
 */

uid_t
luid(uid_t uid, nfs_mount *mp, struct svc_req *rqstp)
{
        return -2;
}

gid_t
lgid(gid_t gid, nfs_mount *mp, struct svc_req *rqstp)
{
        return -2;
}

void
ugid_free_map(struct ugid_map *map)
{
        /* NOP */
}

void
ugid_map_uid(nfs_mount *mp, uid_t from, uid_t to)
{
        /* NOP */
}

void
ugid_map_gid(nfs_mount *mp, gid_t from, gid_t to)
{
        /* NOP */
}

void
ugid_squash_uids(nfs_mount *mp, uid_t from, uid_t to)
{
        /* NOP */
}

void
ugid_squash_gids(nfs_mount *mp, gid_t from, gid_t to)
{
        /* NOP */
}

Isn't it really wonderful? :-( These functions are defined in
ugid_map.c, so I removed the above crap and included ugid_map.o it in
the necessary objects for mountd. But then you have to compile
nfs_dispatch.c because of some undefined references. No problem, just
include nfs_dispatch.o in the necessary objects as well, and then you
get A LOT more undefined references, which can only be satisfied by
nfsd.c! OOPS!!!

So, a complete restructuring of the functions seems to be needed. Or
separate uid/gid authentication from export/mount authentication so
that only nfsd does uid/gid, and these problematic functions are not
needed for mountd, which doesn't look right to me...

Comments? Patches? :-)

Carlos


Reply to: