1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

* configure.ac: Actually name the option --disable-finger and not

http.

* openfile.c (overwrite_filep, make_outfile_name, open_outfile)
(open_sigfile): Use iobuf_is_pipe_filename to check for pipes so
that special filesnames are taken into account. This is bug 327.
* tdbdump.c (import_ownertrust): Ditto.
* sign.c (write_plaintext_packet): Ditto.
* progress.c (handle_progress): Ditto.
* plaintext.c (handle_plaintext): Ditto.
* encode.c (encode_simple, encode_crypt): Ditto.

* iobuf.c (iobuf_is_pipe_filename): New.
* fileutil.c (is_file_compressed): Use it here.
This commit is contained in:
Werner Koch 2004-10-13 09:59:46 +00:00
parent c44e66f352
commit 620ac79ebf
14 changed files with 52 additions and 27 deletions

View file

@ -1,3 +1,14 @@
2004-10-13 Werner Koch <wk@g10code.com>
* openfile.c (overwrite_filep, make_outfile_name, open_outfile)
(open_sigfile): Use iobuf_is_pipe_filename to check for pipes so
that special filesnames are taken into account. This is bug 327.
* tdbdump.c (import_ownertrust): Ditto.
* sign.c (write_plaintext_packet): Ditto.
* progress.c (handle_progress): Ditto.
* plaintext.c (handle_plaintext): Ditto.
* encode.c (encode_simple, encode_crypt): Ditto.
2004-10-12 Werner Koch <wk@g10code.com>
* keygen.c (read_parameter_file): Changed to use iobuf based file

View file

@ -293,8 +293,8 @@ encode_simple( const char *filename, int mode, int use_seskey )
either partial length or fixed length with the new style
messages. */
if (filename && *filename && !(*filename == '-' && !filename[1])
&& !opt.textmode ) {
if ( !iobuf_is_pipe_filename (filename) && filename && *filename
&& !opt.textmode ) {
off_t tmpsize;
if ( !(tmpsize = iobuf_get_filelength(inp)) )
@ -582,7 +582,7 @@ encode_crypt( const char *filename, STRLIST remusr, int use_symkey )
}
}
if (filename && *filename && !(*filename == '-' && !filename[1])
if (!iobuf_is_pipe_filename (filename) && *filename
&& !opt.textmode ) {
off_t tmpsize;

View file

@ -64,8 +64,8 @@
int
overwrite_filep( const char *fname )
{
if( !fname || (*fname == '-' && !fname[1]) )
return 1; /* writing to stdout is always okay */
if( iobuf_is_pipe_filename (fname) )
return 1; /* Writing to stdout is always okay */
if( access( fname, F_OK ) )
return 1; /* does not exist */
@ -98,7 +98,7 @@ make_outfile_name( const char *iname )
{
size_t n;
if( (!iname || (*iname=='-' && !iname[1]) ))
if ( iobuf_is_pipe_filename (iname) )
return m_strdup("-");
n = strlen(iname);
@ -174,7 +174,7 @@ open_outfile( const char *iname, int mode, IOBUF *a )
int rc = 0;
*a = NULL;
if( (!iname || (*iname=='-' && !iname[1])) && !opt.outfile ) {
if( iobuf_is_pipe_filename (iname) && !opt.outfile ) {
if( !(*a = iobuf_create(NULL)) ) {
log_error(_("%s: can't open: %s\n"), "[stdout]", strerror(errno) );
rc = G10ERR_CREATE_FILE;
@ -269,7 +269,7 @@ open_sigfile( const char *iname, progress_filter_context_t *pfx )
IOBUF a = NULL;
size_t len;
if( iname && !(*iname == '-' && !iname[1]) ) {
if( !iobuf_is_pipe_filename (iname) ) {
len = strlen(iname);
if( len > 4 && ( !strcmp(iname + len - 4, EXTSEP_S "sig")
|| ( len > 5 && !strcmp(iname + len - 5, EXTSEP_S "sign") )

View file

@ -105,8 +105,8 @@ handle_plaintext( PKT_plaintext *pt, md_filter_context_t *mfx,
if( nooutput )
;
else if( !*fname || (*fname=='-' && !fname[1])) {
/* no filename or "-" given; write to stdout */
else if ( iobuf_is_pipe_filename (fname) ) {
/* No filename or "-" given; write to stdout. */
fp = stdout;
#ifdef HAVE_DOSISH_SYSTEM
setmode ( fileno(fp) , O_BINARY );

View file

@ -105,7 +105,7 @@ handle_progress (progress_filter_context_t *pfx, IOBUF inp, const char *name)
if (!is_status_enabled ())
return;
if (name && *name && !(*name == '-' && !name[1]))
if ( !iobuf_is_pipe_filename (name) && name && *name )
filesize = iobuf_get_filelength (inp);
else if (opt.set_filesize)
filesize = opt.set_filesize;

View file

@ -543,7 +543,7 @@ write_plaintext_packet (IOBUF out, IOBUF inp, const char *fname, int ptmode)
}
/* try to calculate the length of the data */
if (fname && *fname && !(*fname=='-' && !fname[1])) {
if ( !iobuf_is_pipe_filename (fname) && fname && *fname ) {
off_t tmpsize;
if( !(tmpsize = iobuf_get_filelength(inp)) )

View file

@ -131,7 +131,7 @@ import_ownertrust( const char *fname )
int rc;
init_trustdb();
if( !fname || (*fname == '-' && !fname[1]) ) {
if( iobuf_is_pipe_filename (fname) ) {
fp = stdin;
fname = "[stdin]";
is_stdin = 1;