mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Added SELInux hacks and did some cleanups.
This commit is contained in:
parent
d44906ad4d
commit
151ca81f1a
22 changed files with 396 additions and 62 deletions
|
@ -33,7 +33,7 @@
|
|||
#include "packet.h"
|
||||
#include "options.h"
|
||||
#include "main.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
/****************
|
||||
* Take an armor file and write it out without armor
|
||||
|
@ -49,8 +49,15 @@ dearmor_file( const char *fname )
|
|||
memset( &afx, 0, sizeof afx);
|
||||
|
||||
/* prepare iobufs */
|
||||
if( !(inp = iobuf_open(fname)) ) {
|
||||
log_error("can't open %s: %s\n", fname? fname: "[stdin]",
|
||||
inp = iobuf_open(fname);
|
||||
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"), fname? fname: "[stdin]",
|
||||
strerror(errno) );
|
||||
rc = G10ERR_OPEN_FILE;
|
||||
goto leave;
|
||||
|
@ -91,9 +98,16 @@ enarmor_file( const char *fname )
|
|||
memset( &afx, 0, sizeof afx);
|
||||
|
||||
/* prepare iobufs */
|
||||
if( !(inp = iobuf_open(fname)) ) {
|
||||
log_error("can't open %s: %s\n", fname? fname: "[stdin]",
|
||||
strerror(errno) );
|
||||
inp = iobuf_open(fname);
|
||||
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"), fname? fname: "[stdin]",
|
||||
strerror(errno) );
|
||||
rc = G10ERR_OPEN_FILE;
|
||||
goto leave;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue