mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
w32: Replace some fopen by es_fopen.
* agent/protect-tool.c (read_file): Replace fopen by es_fopen. * dirmngr/dirmngr-client.c (read_pem_certificate): Ditto. (read_certificate): Ditto. * g10/keydb.c (rt_from_file): Ditto. * kbx/kbxutil.c (read_file): Ditto. * g10/plaintext.c (get_output_file) [__riscos__]: Remove code. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
dd2703096f
commit
d574213ce2
5 changed files with 43 additions and 84 deletions
|
@ -146,7 +146,6 @@ get_output_file (const byte *embedded_name, int embedded_namelen,
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef __riscos__
|
||||
if (opt.outfp && is_secured_file (es_fileno (opt.outfp)))
|
||||
{
|
||||
err = gpg_error (GPG_ERR_EPERM);
|
||||
|
@ -168,44 +167,6 @@ get_output_file (const byte *embedded_name, int embedded_namelen,
|
|||
log_error (_("error creating '%s': %s\n"), fname, gpg_strerror (err));
|
||||
goto leave;
|
||||
}
|
||||
#else /* __riscos__ */
|
||||
/* If no output filename was given, i.e. we constructed it, convert
|
||||
all '.' in fname to '/' but not vice versa as we don't create
|
||||
directories! */
|
||||
if (!opt.outfile)
|
||||
for (c = 0; fname[c]; ++c)
|
||||
if (fname[c] == '.')
|
||||
fname[c] = '/';
|
||||
|
||||
if (fp || nooutput)
|
||||
;
|
||||
else
|
||||
{
|
||||
/* Note: riscos stuff is not expected to work anymore. If we
|
||||
want to port it again to riscos we should do most of the suff
|
||||
in estream. FIXME: Consider to remove all riscos special
|
||||
cases. */
|
||||
fp = fopen (fname, "wb");
|
||||
if (!fp)
|
||||
{
|
||||
log_error (_("error creating '%s': %s\n"), fname, gpg_strerror (err));
|
||||
err = GPG_ERR_CREATE_FILE;
|
||||
if (errno == 106)
|
||||
log_info ("Do output file and input file have the same name?\n");
|
||||
goto leave;
|
||||
}
|
||||
|
||||
/* If there's a ,xxx extension in the embedded filename,
|
||||
use that, else check whether the user input (in fname)
|
||||
has a ,xxx appended, then use that in preference */
|
||||
if ((c = riscos_get_filetype_from_string (embedded_name,
|
||||
embedded_namelen)) != -1)
|
||||
filetype = c;
|
||||
if ((c = riscos_get_filetype_from_string (fname, strlen (fname))) != -1)
|
||||
filetype = c;
|
||||
riscos_set_filetype_by_number (fname, filetype);
|
||||
}
|
||||
#endif /* __riscos__ */
|
||||
|
||||
leave:
|
||||
if (err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue