Changeset 229 for server/common/oursrc
- Timestamp:
- Mar 13, 2007, 7:06:48 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/common/oursrc/httpdmods/mod_authz_afsgroup.c
r56 r229 56 56 int required_afsgroup = 0; 57 57 register int x; 58 const char *t, *w; 58 const char *t; 59 char *w; 59 60 const apr_array_header_t *reqs_arr = ap_requires(r); 60 61 require_line *reqs; … … 78 79 int pfd[2]; 79 80 pid_t cpid; 81 int status; 80 82 FILE *fp; 81 83 char *line = NULL; … … 83 85 size_t len = 0; 84 86 ssize_t read; 87 int found = 0; 85 88 w = ap_getword_conf(r->pool, &t); 86 89 if (pipe(pfd) == -1) { … … 91 94 cpid = fork(); 92 95 if (cpid == -1) { 96 close(pfd[0]); 97 close(pfd[1]); 93 98 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, 94 99 "fork() failed!"); … … 121 126 } 122 127 while ((read = getline(&line, &len, fp)) != -1) { 123 if (strcmp(line, buf) == 0) { 124 return OK; 125 } 128 if (strcmp(line, buf) == 0) 129 found = 1; 126 130 } 127 131 if (line) 128 132 free(line); 129 133 fclose(fp); 134 if (waitpid(cpid, &status, 0) == -1) { 135 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, 136 "waitpid() failed!"); 137 return HTTP_INTERNAL_SERVER_ERROR; 138 } 139 if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { 140 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, 141 "`pts membership -nameorid %s` failed!", 142 w); 143 return HTTP_INTERNAL_SERVER_ERROR; 144 } 145 if (found) 146 return OK; 130 147 } 131 148 }
Note: See TracChangeset
for help on using the changeset viewer.