1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-02-07 17:33:02 +01:00

* sign.c (write_plaintext_packet)

* progress.c (handle_progress)
* encode.c (encode_simple,encode_crypt): Make sure that a filename
of "-" is considered to be stdin so that iobuf_get_filelength
won't get called.  This fixes bug 156 reported by Gregery Barton.
This commit is contained in:
Werner Koch 2003-05-21 08:41:26 +00:00
parent 905e6b2528
commit 847c935307
4 changed files with 16 additions and 5 deletions

View File

@ -1,3 +1,11 @@
2003-05-21 Werner Koch <wk@gnupg.org>
* sign.c (write_plaintext_packet)
* progress.c (handle_progress)
* encode.c (encode_simple,encode_crypt): Make sure that a filename
of "-" is considered to be stdin so that iobuf_get_filelength
won't get called. This fixes bug 156 reported by Gregery Barton.
2003-05-20 David Shaw <dshaw@jabberwocky.com> 2003-05-20 David Shaw <dshaw@jabberwocky.com>
* keylist.c (list_keyblock_print): Don't dump attribs for * keylist.c (list_keyblock_print): Don't dump attribs for

View File

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

View File

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

View File

@ -1,5 +1,6 @@
/* sign.c - sign data /* sign.c - sign data
* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. * Copyright (C) 1998, 1999, 2000, 2001, 2002,
* 2003 Free Software Foundation, Inc.
* *
* This file is part of GnuPG. * This file is part of GnuPG.
* *
@ -460,7 +461,7 @@ write_plaintext_packet (IOBUF out, IOBUF inp, const char *fname, int ptmode)
} }
/* try to calculate the length of the data */ /* try to calculate the length of the data */
if (fname) { if (fname && *fname && !(*fname=='-' && !fname[1])) {
if( !(filesize = iobuf_get_filelength(inp)) ) if( !(filesize = iobuf_get_filelength(inp)) )
log_info (_("WARNING: `%s' is an empty file\n"), fname); log_info (_("WARNING: `%s' is an empty file\n"), fname);