From 161286635cfa84e661aaa55932bb811f272a5695 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 13 Oct 2004 18:08:39 +0000 Subject: [PATCH] * configure.ac: Actually name the option --disable-finger and not http. Add option --enable-selinux-support. * logger.c (g10_log_error_f, g10_log_fatal_f, g10_log_info_f) (g10_log_debug_f, print_prefix_f): Removed. * iobuf.c (iobuf_is_pipe_filename): New. (iobuf_get_fd): New. --- ChangeLog | 2 +- NEWS | 4 +++ THANKS | 1 + configure.ac | 13 +++++++++- util/ChangeLog | 5 ++++ util/iobuf.c | 22 ++++++++++++++++ util/logger.c | 70 -------------------------------------------------- 7 files changed, 45 insertions(+), 72 deletions(-) diff --git a/ChangeLog b/ChangeLog index c0d7005eb..bce8f4ef3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ 2004-10-13 Werner Koch * configure.ac: Actually name the option --disable-finger and not - http. + http. Add option --enable-selinux-support. 2004-10-11 Werner Koch diff --git a/NEWS b/NEWS index f7d3d64f7..13e8ef0c6 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,10 @@ Noteworthy changes in version 1.3.91 ------------------------------------------------ + * A new configure option --enable-selinux-support disallows + processing of confidential files used by gpg (e.g. secring.gpg). + This help designing ACLs for the SELinux kernel. + Noteworthy changes in version 1.3.90 (2004-10-01) ------------------------------------------------ diff --git a/THANKS b/THANKS index 04901f5a3..d593aa876 100644 --- a/THANKS +++ b/THANKS @@ -9,6 +9,7 @@ Alec Habig habig@budoe2.bu.edu Allan Clark allanc@sco.com Anand Kumria wildfire@progsoc.uts.edu.au Andreas Haumer andreas@xss.co.at +Anthony Carrico acarrico@memebeam.org Anthony Mulcahy anthony@kcn.ne.jp Ariel T Glenn ariel@columbia.edu Bob Mathews bobmathews@mindspring.com diff --git a/configure.ac b/configure.ac index 817b827ab..bc79f886b 100644 --- a/configure.ac +++ b/configure.ac @@ -102,10 +102,17 @@ if test "$use_m_guard" = yes ; then AC_DEFINE(M_GUARD,1,[Define to use the (obsolete) malloc guarding feature]) fi +AC_MSG_CHECKING([whether SELinux support is requested]) +AC_ARG_ENABLE(selinux-support, + AC_HELP_STRING([--enable-selinux-support], + [enable SELinux support]), + selinux_support=$enableval, selinux_support=no) +AC_MSG_RESULT($selinux_support) + AC_MSG_CHECKING([whether OpenPGP card support is requested]) AC_ARG_ENABLE(card-support, AC_HELP_STRING([--disable-card-support], - [enable OpenPGP card support]), + [disable OpenPGP card support]), card_support=$enableval, card_support=yes) AC_MSG_RESULT($card_support) @@ -721,6 +728,10 @@ if test "$try_extensions" = yes ; then AC_DEFINE(USE_DYNAMIC_LINKING,1,[Define to enable the use of extensions]) fi +if test "$selinux_support" = yes ; then + AC_DEFINE(ENABLE_SELINUX_HACKS,1,[Define to enable SELinux support]) +fi + AM_CONDITIONAL(ENABLE_CARD_SUPPORT, test "$card_support" = yes) dnl Checks for header files. diff --git a/util/ChangeLog b/util/ChangeLog index 9768748bb..c9d1ce3d2 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,6 +1,11 @@ 2004-10-13 Werner Koch + * logger.c (g10_log_error_f, g10_log_fatal_f, g10_log_info_f) + (g10_log_debug_f, print_prefix_f): Removed. + * iobuf.c (iobuf_is_pipe_filename): New. + (iobuf_get_fd): New. + * fileutil.c (is_file_compressed): Use it here. 2004-09-30 David Shaw diff --git a/util/iobuf.c b/util/iobuf.c index 26cde114f..3b1fe8636 100644 --- a/util/iobuf.c +++ b/util/iobuf.c @@ -1850,6 +1850,28 @@ iobuf_get_filelength( IOBUF a ) return 0; } + +/* Return the file descriptor of the underlying file or -1 if it is + not available. */ +int +iobuf_get_fd (IOBUF a) +{ + if (a->directfp) + return a->directfp? fileno(a->directfp) : -1; + + for ( ; a; a = a->chain ) + if (!a->chain && a->filter == file_filter) + { + file_filter_ctx_t *b = a->filter_ov; + FILEP_OR_FD fp = b->fp; + + return my_fileno (fp); + } + + return -1; +} + + /**************** * Tell the file position, where the next read will take place */ diff --git a/util/logger.c b/util/logger.c index 6990473b2..bd3156f3d 100644 --- a/util/logger.c +++ b/util/logger.c @@ -130,19 +130,6 @@ g10_log_print_prefix(const char *text) #endif /* __riscos__ */ } -static void -print_prefix_f(const char *text, const char *fname) -{ - if( !logfp ) - logfp = stderr; - if( pgm_name ) - fprintf(logfp, "%s%s:%s: %s", pgm_name, pidstring, fname, text ); - else - fprintf(logfp, "?%s:%s: %s", pidstring, fname, text ); -#ifdef __riscos__ - fflush( logfp ); -#endif /* __riscos__ */ -} void g10_log_info( const char *fmt, ... ) @@ -158,19 +145,6 @@ g10_log_info( const char *fmt, ... ) #endif /* __riscos__ */ } -void -g10_log_info_f( const char *fname, const char *fmt, ... ) -{ - va_list arg_ptr ; - - print_prefix_f("", fname); - va_start( arg_ptr, fmt ) ; - vfprintf(logfp,fmt,arg_ptr) ; - va_end(arg_ptr); -#ifdef __riscos__ - fflush( logfp ); -#endif /* __riscos__ */ -} void g10_log_warning( const char *fmt, ... ) @@ -209,20 +183,6 @@ g10_log_error( const char *fmt, ... ) #endif /* __riscos__ */ } -void -g10_log_error_f( const char *fname, const char *fmt, ... ) -{ - va_list arg_ptr ; - - print_prefix_f("", fname); - va_start( arg_ptr, fmt ) ; - vfprintf(logfp,fmt,arg_ptr) ; - va_end(arg_ptr); - errorcount++; -#ifdef __riscos__ - fflush( logfp ); -#endif /* __riscos__ */ -} void g10_log_fatal( const char *fmt, ... ) @@ -240,22 +200,6 @@ g10_log_fatal( const char *fmt, ... ) exit(2); } -void -g10_log_fatal_f( const char *fname, const char *fmt, ... ) -{ - va_list arg_ptr ; - - print_prefix_f("fatal: ", fname); - va_start( arg_ptr, fmt ) ; - vfprintf(logfp,fmt,arg_ptr) ; - va_end(arg_ptr); - secmem_dump_stats(); -#ifdef __riscos__ - fflush( logfp ); -#endif /* __riscos__ */ - exit(2); -} - void g10_log_bug( const char *fmt, ... ) { @@ -300,20 +244,6 @@ g10_log_debug( const char *fmt, ... ) #endif /* __riscos__ */ } -void -g10_log_debug_f( const char *fname, const char *fmt, ... ) -{ - va_list arg_ptr ; - - print_prefix_f("DBG: ", fname); - va_start( arg_ptr, fmt ) ; - vfprintf(logfp,fmt,arg_ptr) ; - va_end(arg_ptr); -#ifdef __riscos__ - fflush( logfp ); -#endif /* __riscos__ */ -} - void