aboutsummaryrefslogtreecommitdiffstats
path: root/g10/plaintext.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2004-10-13 18:10:06 +0000
committerWerner Koch <[email protected]>2004-10-13 18:10:06 +0000
commit151ca81f1a5a03ae83d9c14ab7748a2d3c09919e (patch)
tree38cc8933051a1e45cd3e95cd8cc66746290f7e31 /g10/plaintext.c
parentAdd dearmor.c (diff)
downloadgnupg-151ca81f1a5a03ae83d9c14ab7748a2d3c09919e.tar.gz
gnupg-151ca81f1a5a03ae83d9c14ab7748a2d3c09919e.zip
Added SELInux hacks and did some cleanups.
Diffstat (limited to 'g10/plaintext.c')
-rw-r--r--g10/plaintext.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/g10/plaintext.c b/g10/plaintext.c
index 8918d199c..8b782add7 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -446,6 +446,12 @@ ask_for_detached_datafile( MD_HANDLE md, MD_HANDLE md2,
goto leave;
}
fp = iobuf_open(answer);
+ if (fp && is_secured_file (iobuf_get_fd (fp)))
+ {
+ iobuf_close (fp);
+ fp = NULL;
+ errno = EPERM;
+ }
if( !fp && errno == ENOENT ) {
tty_printf("No such file, try again or hit enter to quit.\n");
any++;
@@ -501,6 +507,12 @@ hash_datafiles( MD_HANDLE md, MD_HANDLE md2, STRLIST files,
for (sl=files; sl; sl = sl->next ) {
fp = iobuf_open( sl->d );
+ if (fp && is_secured_file (iobuf_get_fd (fp)))
+ {
+ iobuf_close (fp);
+ fp = NULL;
+ errno = EPERM;
+ }
if( !fp ) {
log_error(_("can't open signed data `%s'\n"),
print_fname_stdin(sl->d));