summaryrefslogtreecommitdiffstats
path: root/common/sysutils.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2016-11-29 16:18:24 +0100
committerWerner Koch <wk@gnupg.org>2016-11-29 16:54:36 +0100
commit60b4982836a00ef6b2a97d16f735b3f6b74dce62 (patch)
tree95b51ae8ed413646ebdc601d8344fd85e34965dd /common/sysutils.h
parentg10: Fix memory leak. (diff)
downloadgnupg2-60b4982836a00ef6b2a97d16f735b3f6b74dce62.tar.xz
gnupg2-60b4982836a00ef6b2a97d16f735b3f6b74dce62.zip
gpg,sm: Merge the two versions of check_special_filename.
* sm/gpgsm.c (check_special_filename): Move to .. * common/sysutils.c (check_special_filename): here. Add arg NOTRANSLATE. (allow_special_filenames): New local var. (enable_special_filenames): New public functions. * sm/gpgsm.c (allow_special_filenames): Remove var. (main): Call enable_special_filenames instead of setting the var. (open_read, open_es_fread, open_es_fwrite): Call check_special_filename with 0 for NOTRANSLATE. * common/iobuf.c (special_names_enabled): Remove var. (iobuf_enable_special_filenames): Remove func. (check_special_filename): Remove func. (iobuf_is_pipe_filename): Call new version of the function with NOTRANSLATE set. (do_open): Ditto. * g10/gpg.c (main): Call enable_special_filenames instead of iobuf_enable_special_filenames. * g10/gpgv.c (main): Ditto. -- Note that we keep the iobuf.c:translate_file_handle because it is a bit different (for whatever reasons) than the translate function from sysutils. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'common/sysutils.h')
-rw-r--r--common/sysutils.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/sysutils.h b/common/sysutils.h
index fef6ba13e..a9316d7ce 100644
--- a/common/sysutils.h
+++ b/common/sysutils.h
@@ -50,6 +50,7 @@ typedef int gnupg_fd_t;
void trap_unaligned (void);
int disable_core_dumps (void);
int enable_core_dumps (void);
+void enable_special_filenames (void);
const unsigned char *get_session_marker (size_t *rlen);
unsigned int get_uint_nonce (void);
/*int check_permissions (const char *path,int extension,int checkonly);*/
@@ -57,6 +58,7 @@ void gnupg_sleep (unsigned int seconds);
void gnupg_usleep (unsigned int usecs);
int translate_sys2libc_fd (gnupg_fd_t fd, int for_write);
int translate_sys2libc_fd_int (int fd, int for_write);
+int check_special_filename (const char *fname, int for_write, int notranslate);
FILE *gnupg_tmpfile (void);
void gnupg_reopen_std (const char *pgmname);
void gnupg_allow_set_foregound_window (pid_t pid);