Index: libexec/comsat/comsat.c =================================================================== --- libexec/comsat/comsat.c +++ libexec/comsat/comsat.c @@ -213,9 +213,10 @@ unsigned char line[BUFSIZ]; /* Set effective uid to user in case mail drop is on nfs */ - if ((p = getpwnam(user)) == NULL) - return; - if (setuid(p->pw_uid) != 0) + if ((p = getpwnam(user)) == NULL || + initgroups(p->pw_name, p->pw_gid) == -1 || + setgid(p->pw_gid) == -1 || + setuid(p->pw_uid) == -1) return; if ((fi = fopen(file, "r")) == NULL)