From 151ca81f1a5a03ae83d9c14ab7748a2d3c09919e Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 13 Oct 2004 18:10:06 +0000 Subject: Added SELInux hacks and did some cleanups. --- g10/decrypt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'g10/decrypt.c') diff --git a/g10/decrypt.c b/g10/decrypt.c index 028815eec..90130872c 100644 --- a/g10/decrypt.c +++ b/g10/decrypt.c @@ -58,6 +58,12 @@ decrypt_message( const char *filename ) /* open the message file */ fp = iobuf_open(filename); + if (fp && is_secured_file (iobuf_get_fd (fp))) + { + iobuf_close (fp); + fp = NULL; + errno = EPERM; + } if( !fp ) { log_error(_("can't open `%s'\n"), print_fname_stdin(filename)); return G10ERR_OPEN_FILE; @@ -140,6 +146,12 @@ decrypt_messages(int nfiles, char *files[]) if (!output) goto next_file; fp = iobuf_open(filename); + if (fp && is_secured_file (iobuf_get_fd (fp))) + { + iobuf_close (fp); + fp = NULL; + errno = EPERM; + } if (!fp) { log_error(_("can't open `%s'\n"), print_fname_stdin(filename)); -- cgit