Index: /server/common/oursrc/httpdmods/mod_authz_afsgroup.c
===================================================================
--- /server/common/oursrc/httpdmods/mod_authz_afsgroup.c	(revision 228)
+++ /server/common/oursrc/httpdmods/mod_authz_afsgroup.c	(revision 229)
@@ -56,5 +56,6 @@
     int required_afsgroup = 0;
     register int x;
-    const char *t, *w;
+    const char *t;
+    char *w;
     const apr_array_header_t *reqs_arr = ap_requires(r);
     require_line *reqs;
@@ -78,4 +79,5 @@
 		int pfd[2];
 		pid_t cpid;
+		int status;
 		FILE *fp;
 		char *line = NULL;
@@ -83,4 +85,5 @@
 		size_t len = 0;
 		ssize_t read;
+		int found = 0;
                 w = ap_getword_conf(r->pool, &t);
 		if (pipe(pfd) == -1) {
@@ -91,4 +94,6 @@
 		cpid = fork();
 		if (cpid == -1) {
+		    close(pfd[0]);
+		    close(pfd[1]);
 		    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
 				  "fork() failed!");
@@ -121,11 +126,23 @@
 		}
 		while ((read = getline(&line, &len, fp)) != -1) {
-		    if (strcmp(line, buf) == 0) {
-			return OK;
-		    }
+		    if (strcmp(line, buf) == 0)
+			found = 1;
 		}
 		if (line)
 		    free(line);
 		fclose(fp);
+		if (waitpid(cpid, &status, 0) == -1) {
+		    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+				  "waitpid() failed!");
+		    return HTTP_INTERNAL_SERVER_ERROR;
+		}
+		if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
+		    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+				  "`pts membership -nameorid %s` failed!",
+				  w);
+		    return HTTP_INTERNAL_SERVER_ERROR;
+		}
+		if (found)
+		    return OK;
             }
         }
