mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
gpg: Use is_secured_filename before opening the file.
* g10/gpg.c (print_mds): Check by is_secured_filename, earlier. * g10/tdbdump.c (import_ownertrust): Likewise. -- GnuPG-bug-id: 6508 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
cf270b0d30
commit
5d375bb168
2 changed files with 8 additions and 11 deletions
|
@ -141,19 +141,16 @@ import_ownertrust (ctrl_t ctrl, const char *fname )
|
|||
fname = "[stdin]";
|
||||
is_stdin = 1;
|
||||
}
|
||||
else if (is_secured_filename (fname)) {
|
||||
gpg_err_set_errno (EPERM);
|
||||
log_error (_("can't open '%s': %s\n"), fname, strerror(errno) );
|
||||
return;
|
||||
}
|
||||
else if( !(fp = es_fopen( fname, "r" )) ) {
|
||||
log_error ( _("can't open '%s': %s\n"), fname, strerror(errno) );
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_secured_file (es_fileno (fp)))
|
||||
{
|
||||
es_fclose (fp);
|
||||
gpg_err_set_errno (EPERM);
|
||||
log_error (_("can't open '%s': %s\n"), fname, strerror(errno) );
|
||||
return;
|
||||
}
|
||||
|
||||
while (es_fgets (line, DIM(line)-1, fp)) {
|
||||
TRUSTREC rec;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue