I'm looking at nsmain.c for the fun of it on Christmas Eve.  I don't
understand the difference in the code between the gid and the uid. It
seems like the gid has to be less than zero before it is converted to an
int using atoi. Then it is compared to zero. In the uid case, the uid is
always compared to zero.

Merry Christmas!

  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);
   }
 }

This is from:
$Header: /cvsroot/aolserver/aolserver/nsd/nsmain.c,v 1.22.2.3.2.2
2002/10/28 23:15:45

Reply via email to