- if( !(inp = iobuf_open(filename)) ) {
- log_error(_("%s: can't open: %s\n"), filename? filename: "[stdin]",
- strerror(errno) );
+ inp = iobuf_open(filename);
+ if (inp)
+ iobuf_ioctl (inp,3,1,NULL); /* disable fd caching */
+ if (inp && is_secured_file (iobuf_get_fd (inp)))
+ {
+ iobuf_close (inp);
+ inp = NULL;
+ errno = EPERM;
+ }
+ if( !inp ) {
+ log_error(_("can't open `%s': %s\n"), filename? filename: "[stdin]",
+ strerror(errno) );