version 1.6 | | version 1.7 |
---|
| | |
/* | | /* |
* static char *rcsid_map_c = | | * static char *rcsid_map_c = |
* "$Id: map.c,v 1.6 2000/03/29 07:46:48 cvs Exp $"; | | * "$Id: map.c,v 1.7 2000/04/17 14:18:13 jec Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
if (i == NROF_COMPRESS_METHODS) | | if (i == NROF_COMPRESS_METHODS) |
return (-1); | | return (-1); |
if (!S_ISREG (statbuf.st_mode)) | | if (!S_ISREG (statbuf.st_mode)) |
return (0); | | return (-1); |
| | |
if (((statbuf.st_mode & S_IRGRP) && getegid() == statbuf.st_gid) || | | if (((statbuf.st_mode & S_IRGRP) && getegid() == statbuf.st_gid) || |
((statbuf.st_mode & S_IRUSR) && geteuid() == statbuf.st_uid) || | | ((statbuf.st_mode & S_IRUSR) && geteuid() == statbuf.st_uid) || |
| | |
} | | } |
if ((fp = popen(buf2, "r")) != NULL) | | if ((fp = popen(buf2, "r")) != NULL) |
return fp; | | return fp; |
} else if((fp=fopen(name,"r"))!=NULL) | | } else if((fp=fopen(name,"r"))!=NULL) { |
| | struct stat statbuf; |
| | if (fstat (fileno (fp), &statbuf) || ! S_ISREG (statbuf.st_mode)) { |
| | LOG (llevDebug, "Can't open %s - not a regular file\n", name); |
| | (void) fclose (fp); |
| | errno = EISDIR; |
| | return NULL; |
| | } |
return fp; | | return fp; |
} | | } |
| | } |
LOG(llevDebug, "Can't open %s\n", name); | | LOG(llevDebug, "Can't open %s\n", name); |
return NULL; | | return NULL; |
} | | } |