Forum OpenACS Development: aolserver 3.5 gid

Collapse
10: aolserver 3.5 gid (response to 1)
Posted by Vinod Kurup on
Looks like Jon's patch needs to be reapplied to the 3.5.2 source. Here's the 3.5.2 nsmain.c snippet (CVS-1.22.2.3.2.2 line 313):
if (garg != NULL) {
    gid = Ns_GetGid(garg);
    if (gid < 0) {
        gid = atoi(garg);
        if (gid == 0) {
            Ns_Fatal("nsmain: invalid group '%s'", garg);
        }
    }
}
if (uarg != NULL) {
    uid = Ns_GetUid(uarg);
    gid = Ns_GetUserGid(uarg);
    if (uid < 0) {
        uid = atoi(uarg);
    }
    if (uid == 0) {
        Ns_Fatal("nsmain: invalid user '%s'", uarg);
    }
}
So the gid gets set properly, but then if the uid is not null, gid gets overwritten to the user's gid. Jon's fix is to check the uarg first, then the garg.