1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01: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,8 @@
2004-10-13 Werner Koch <wk@g10code.com>
* configure.ac: Actually name the option --disable-finger and not
http.
2004-10-11 Werner Koch <wk@g10code.com> 2004-10-11 Werner Koch <wk@g10code.com>
* configure.ac: New option --disable-finger. * configure.ac: New option --disable-finger.

17
TODO
View File

@ -6,18 +6,11 @@
20% faster and the crc32 code about 50% faster. Some memory leaks were 20% faster and the crc32 code about 50% faster. Some memory leaks were
also fixed according to the ChangeLog. also fixed according to the ChangeLog.
If it can help you, here is what I did to update the distribution is
to remove all files in the zlib folder except Makefile.am. To copy all
the file in the zlib121.zip archive to the zlib folder with the
exception of configure, example.c, FAQ, INDEX, Makefile, Makefile.in
and zlib.3. I then edited Makefile.am to match the new file list and
* Reword the "Not enough entropy" messages. * Reword the "Not enough entropy" messages.
* Do we need a configure test for putenv? * Do we need a configure test for putenv?
* Check for consistent spelling of user ID, key ID etc. * Replace "user id not found" in getkey.c by "no valid user ID found"?
Replace "user id not found" in getkey.c by "no valid user ID found".
* Describe some pitfalls when using EGD. Check that ~/.gnupg/entropy * Describe some pitfalls when using EGD. Check that ~/.gnupg/entropy
really is the default. What about needed permission? really is the default. What about needed permission?
@ -37,7 +30,9 @@
* Check the changes to the gpg random gatherer on all W32 platforms. * Check the changes to the gpg random gatherer on all W32 platforms.
* Show more info does not work from edit->trust * Show more info does not work from edit->trust. We should give more
information on the user ID under question while running
--update-trustdb.
* Check that no secret temporary results are stored in the result parameter * Check that no secret temporary results are stored in the result parameter
of the mpi functions. We have already done this for mpi-mul.c of the mpi functions. We have already done this for mpi-mul.c
@ -109,11 +104,9 @@
* allow the use of option in gpg.conf. * allow the use of option in gpg.conf.
* export-secret-subkey where only one of the subkeys gets exported.
* Add the NEWSIG status. * Add the NEWSIG status.
* When generating a key onh the card we should try to also set the * When generating a key on the card we should try to also set the
display name or provide the display name as a default in the key display name or provide the display name as a default in the key
generation. The problem however is that the display name must be generation. The problem however is that the display name must be
given with an indication of the surname and the usable characters given with an indication of the surname and the usable characters

View File

@ -304,7 +304,7 @@ if test "$use_exec" = yes ; then
AC_MSG_RESULT($try_http) AC_MSG_RESULT($try_http)
AC_MSG_CHECKING([whether Finger key fetching support is requested]) AC_MSG_CHECKING([whether Finger key fetching support is requested])
AC_ARG_ENABLE(http, AC_ARG_ENABLE(finger,
AC_HELP_STRING([--disable-finger], AC_HELP_STRING([--disable-finger],
[disable Finger key fetching interface]), [disable Finger key fetching interface]),
try_finger=$enableval, try_finger=yes) try_finger=$enableval, try_finger=yes)

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> 2004-10-12 Werner Koch <wk@g10code.com>
* keygen.c (read_parameter_file): Changed to use iobuf based file * 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 either partial length or fixed length with the new style
messages. */ messages. */
if (filename && *filename && !(*filename == '-' && !filename[1]) if ( !iobuf_is_pipe_filename (filename) && filename && *filename
&& !opt.textmode ) { && !opt.textmode ) {
off_t tmpsize; off_t tmpsize;
if ( !(tmpsize = iobuf_get_filelength(inp)) ) 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 ) { && !opt.textmode ) {
off_t tmpsize; off_t tmpsize;

View File

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

@ -543,7 +543,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 && *fname && !(*fname=='-' && !fname[1])) { if ( !iobuf_is_pipe_filename (fname) && fname && *fname ) {
off_t tmpsize; off_t tmpsize;
if( !(tmpsize = iobuf_get_filelength(inp)) ) if( !(tmpsize = iobuf_get_filelength(inp)) )

View File

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

View File

@ -80,6 +80,7 @@ struct iobuf_struct {
EXTERN_UNLESS_MAIN_MODULE int iobuf_debug_mode; EXTERN_UNLESS_MAIN_MODULE int iobuf_debug_mode;
void iobuf_enable_special_filenames ( int yes ); void iobuf_enable_special_filenames ( int yes );
int iobuf_is_pipe_filename (const char *fname);
IOBUF iobuf_alloc(int use, size_t bufsize); IOBUF iobuf_alloc(int use, size_t bufsize);
IOBUF iobuf_temp(void); IOBUF iobuf_temp(void);
IOBUF iobuf_temp_with_content( const char *buffer, size_t length ); IOBUF iobuf_temp_with_content( const char *buffer, size_t length );

View File

@ -1,3 +1,8 @@
2004-10-13 Werner Koch <wk@g10code.com>
* iobuf.c (iobuf_is_pipe_filename): New.
* fileutil.c (is_file_compressed): Use it here.
2004-09-30 David Shaw <dshaw@jabberwocky.com> 2004-09-30 David Shaw <dshaw@jabberwocky.com>
* iobuf.c (pop_filter): Make static. * iobuf.c (pop_filter): Make static.

View File

@ -200,7 +200,7 @@ is_file_compressed( const char *s, int *ret_rc )
{ 4, { 0x50, 0x4b, 0x03, 0x04 } }, /* (pk)zip */ { 4, { 0x50, 0x4b, 0x03, 0x04 } }, /* (pk)zip */
}; };
if ( !s || (*s == '-' && !s[1]) || !ret_rc ) if ( iobuf_is_pipe_filename (s) || !ret_rc )
return 0; /* We can't check stdin or no file was given */ return 0; /* We can't check stdin or no file was given */
a = iobuf_open( s ); a = iobuf_open( s );

View File

@ -1005,6 +1005,16 @@ check_special_filename ( const char *fname )
return -1; return -1;
} }
/* This fucntion returns true if FNAME indicates a PIPE (stdout or
stderr) or a special file name if those are enabled. */
int
iobuf_is_pipe_filename (const char *fname)
{
if (!fname || (*fname=='-' && !fname[1]) )
return 1;
return check_special_filename (fname) != -1;
}
/**************** /****************
* Create a head iobuf for reading from a file * Create a head iobuf for reading from a file
* returns: NULL if an error occures and sets errno * returns: NULL if an error occures and sets errno