Subject: Re: CVS commit: pkgsrc/mail/up-imapproxy
To: Adrian Portelli <adrianp@netbsd.org>
From: Jukka Salmi <j+nbsd@2006.salmi.ch>
List: tech-pkg
Date: 05/09/2006 10:16:05
--yNb1oOkm5a9FJOVX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
thanks for adding this package!
While building on netbsd-2 (OpenSSL 0.9.7d) succeeds, it fails on
NetBSD-current (OpenSSL 0.9.8a):
$ make
[...]
cc -O2 -I/usr/include -I/usr/include -O2 -I/usr/include -I. -I./include -c -o ./src/imapcommon.o ./src/imapcommon.c
src/imapcommon.c: In function `Get_Server_conn':
src/imapcommon.c:377: error: `MD5_DIGEST_LENGTH' undeclared (first use in this function)
src/imapcommon.c:377: error: (Each undeclared identifier is reported only once
src/imapcommon.c:377: error: for each function it appears in.)
*** Error code 1
[...]
The first attached patch should fix this problem.
The two other patches (which I'm using on a NetBSD/i386 2.1 system
since up-imapproxy 1.2.4 is available) contain these changes:
- fix libwrap detection (patch to configure.in and regenerated configure)
- change `test x == y' to `test x = y' to make it work with non-bash /bin/sh
- fix file ownership for installed files
- close stdin, stdout and stderr when starting up the daemon
Just in case this is of use...
Cheers, Jukka
Adrian Portelli wrote:
>
> Module Name: pkgsrc
> Committed By: adrianp
> Date: Mon May 8 21:58:31 UTC 2006
>
> Update of /cvsroot/pkgsrc/mail/up-imapproxy
> In directory ivanova.netbsd.org:/tmp/cvs-serv22506
>
> Log Message:
> Proxies IMAP transactions between an IMAP client and an IMAP server. The
> general idea is that the client should never know that it's not talking to
> the real IMAP server. The only thing that makes this a slightly unique Imap
> Proxy server is that it caches server connections.
>
> Status:
>
> Vendor Tag: TNF
> Release Tags: pkgsrc-base
>
> N pkgsrc/mail/up-imapproxy/PLIST
> N pkgsrc/mail/up-imapproxy/distinfo
> N pkgsrc/mail/up-imapproxy/Makefile
> N pkgsrc/mail/up-imapproxy/DESCR
> N pkgsrc/mail/up-imapproxy/files/upimapproxy.sh
> N pkgsrc/mail/up-imapproxy/patches/patch-aa
> N pkgsrc/mail/up-imapproxy/patches/patch-ab
>
> No conflicts created by this import
>
--
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~
--yNb1oOkm5a9FJOVX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="up-imapproxy-1.2.4_md5.patch"
--- src/imapcommon.c.orig 2005-08-31 18:32:24.000000000 +0200
+++ src/imapcommon.c 2006-05-09 09:52:37.000000000 +0200
@@ -136,6 +136,7 @@
#include <openssl/evp.h>
#include <openssl/err.h>
+#include <openssl/md5.h>
#include <pthread.h>
#include <sys/types.h>
--yNb1oOkm5a9FJOVX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="up-imapproxy-1.2.4.patch"
diff -ru up-imapproxy-1.2.4.orig/Makefile.in up-imapproxy-1.2.4/Makefile.in
--- up-imapproxy-1.2.4.orig/Makefile.in 2005-06-15 14:15:33.000000000 +0200
+++ up-imapproxy-1.2.4/Makefile.in 2005-06-15 23:28:53.000000000 +0200
@@ -79,8 +79,8 @@
install: $(XYD_BIN) $(TAT_BIN)
mkdir -p $(EBIN)
- $(INSTALL) -o bin -g bin -m 0755 $(XYD_BIN) $(EBIN)
- $(INSTALL) -o bin -g bin -m 0755 $(TAT_BIN) $(EBIN)
+ $(INSTALL) -o root -g wheel -m 0555 $(XYD_BIN) $(EBIN)
+ $(INSTALL) -o root -g wheel -m 0555 $(TAT_BIN) $(EBIN)
install-init:
$(INSTALL) -o root -g sys -m 0755 ./scripts/imapproxy.init $(ETC)/init.d/imapproxy
@@ -88,7 +88,7 @@
ln -s ../init.d/imapproxy /etc/rc0.d/K10imapproxy
install-conf:
- $(INSTALL) -o root -g bin -m 0755 ./scripts/imapproxy.conf $(ETC)
+ $(INSTALL) -o root -g wheel -m 0644 ./scripts/imapproxy.conf $(ETC)
rpm-install: install
$(INSTALL) -o root -g sys -m 0755 ./scripts/imapproxy.conf $(rpm_prefix)/etc
diff -ru up-imapproxy-1.2.4.orig/config.h.in up-imapproxy-1.2.4/config.h.in
--- up-imapproxy-1.2.4.orig/config.h.in 2005-06-15 14:15:33.000000000 +0200
+++ up-imapproxy-1.2.4/config.h.in 2005-06-15 23:23:22.000000000 +0200
@@ -20,6 +20,9 @@
/* Define to 1 if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL
+/* Define to 1 if you have the `wrap' library (-lwrap). */
+#undef HAVE_LIBWRAP
+
/* Define to 1 if you have the `pthread' library (-lpthread). */
#undef HAVE_LIBPTHREAD
diff -ru up-imapproxy-1.2.4.orig/configure up-imapproxy-1.2.4/configure
--- up-imapproxy-1.2.4.orig/configure 2005-06-15 14:15:33.000000000 +0200
+++ up-imapproxy-1.2.4/configure 2005-06-15 23:23:22.000000000 +0200
@@ -950,7 +950,7 @@
else
echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi
- cd "$ac_popdir"
+ cd $ac_popdir
done
fi
@@ -1895,7 +1895,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -1953,7 +1954,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2069,7 +2071,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2123,7 +2126,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2168,7 +2172,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2212,7 +2217,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2505,7 +2511,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2572,7 +2579,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2645,7 +2653,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2728,7 +2737,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2800,7 +2810,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2908,7 +2919,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3026,86 +3038,6 @@
save_LIBS="$LIBS"
if test "$with_libwrap" != no; then
-echo "$as_me:$LINENO: checking for yp_get_default_domain in -lnsl" >&5
-echo $ECHO_N "checking for yp_get_default_domain in -lnsl... $ECHO_C" >&6
-if test "${ac_cv_lib_nsl_yp_get_default_domain+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char yp_get_default_domain ();
-int
-main ()
-{
-yp_get_default_domain ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_lib_nsl_yp_get_default_domain=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_nsl_yp_get_default_domain=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_yp_get_default_domain" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_yp_get_default_domain" >&6
-if test $ac_cv_lib_nsl_yp_get_default_domain = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNSL 1
-_ACEOF
-
- LIBS="-lnsl $LIBS"
-
-else
-
- with_libwrap=no
- { echo "$as_me:$LINENO: WARNING: nsl library not found!!! Wrappers will be disabled." >&5
-echo "$as_me: WARNING: nsl library not found!!! Wrappers will be disabled." >&2;}
-
-fi
-
- if test "$with_libwrap" != no; then
-
echo "$as_me:$LINENO: checking for request_init in -lwrap" >&5
echo $ECHO_N "checking for request_init in -lwrap... $ECHO_C" >&6
if test "${ac_cv_lib_wrap_request_init+set}" = set; then
@@ -3127,6 +3059,7 @@
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char request_init ();
+int deny_severity, allow_severity;
int
main ()
{
@@ -3144,7 +3077,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3184,7 +3118,6 @@
fi
- fi
fi
@@ -3210,6 +3143,7 @@
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char EVP_DigestInit ();
+int deny_severity, allow_severity;
int
main ()
{
@@ -3227,7 +3161,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3292,6 +3227,7 @@
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char SSL_new ();
+int deny_severity, allow_severity;
int
main ()
{
@@ -3309,7 +3245,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3371,6 +3308,7 @@
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char initscr ();
+int deny_severity, allow_severity;
int
main ()
{
@@ -3388,7 +3326,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3419,7 +3358,7 @@
curses_found=no
fi
-if test "$curses_found" == no; then
+if test "$curses_found" = no; then
echo "$as_me:$LINENO: checking for initscr in -lncurses" >&5
echo $ECHO_N "checking for initscr in -lncurses... $ECHO_C" >&6
if test "${ac_cv_lib_ncurses_initscr+set}" = set; then
@@ -3458,7 +3397,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3787,7 +3727,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3957,7 +3898,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4026,7 +3968,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4253,7 +4196,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4375,7 +4319,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -4474,7 +4419,8 @@
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -5320,6 +5266,11 @@
*) ac_INSTALL=$ac_top_builddir$INSTALL ;;
esac
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
@@ -5358,12 +5309,6 @@
fi;;
esac
done` || { (exit 1); exit 1; }
-
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
sed "$ac_vpsub
diff -ru up-imapproxy-1.2.4.orig/configure.in up-imapproxy-1.2.4/configure.in
--- up-imapproxy-1.2.4.orig/configure.in 2005-06-15 14:15:33.000000000 +0200
+++ up-imapproxy-1.2.4/configure.in 2005-06-15 23:23:22.000000000 +0200
@@ -90,16 +90,10 @@
dnl Check for libwrap
save_LIBS="$LIBS"
if test "$with_libwrap" != no; then
- AC_CHECK_LIB(nsl, yp_get_default_domain, , [
- with_libwrap=no
- AC_WARN([nsl library not found!!! Wrappers will be disabled.])
- ])
- if test "$with_libwrap" != no; then
AC_CHECK_LIB(wrap, request_init, , [
LIBS="$save_LIBS"
AC_WARN([Wrappers library not found!!! Wrappers will be disabled.])
])
- fi
fi
@@ -121,7 +115,7 @@
save_LIBS="$LIBS"
LIB_CURSES=""
AC_CHECK_LIB(curses, initscr, LIB_CURSES="-lcurses", [ curses_found=no ])
-if test "$curses_found" == no; then
+if test "$curses_found" = no; then
AC_CHECK_LIB(ncurses, initscr, LIB_CURSES="-lncurses",
AC_ERROR([Can't compile without curses!!!]))
fi
--yNb1oOkm5a9FJOVX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="up-imapproxy-1.2.4_close.patch"
--- up-imapproxy-1.2.4.orig/src/main.c 2005-06-15 14:15:34.000000000 +0200
+++ up-imapproxy-1.2.4/src/main.c 2005-06-16 01:16:24.000000000 +0200
@@ -709,12 +709,22 @@ void Usage( void )
*/
static void ServerInit( void )
{
+ int fd;
char *fn = "ServerInit()";
struct hostent *hp;
struct rlimit rl;
int rc;
struct passwd *pw;
+ /* close stdin, stdout and stderr */
+ if ((fd = open("/dev/null", O_RDWR, 0)) != -1)
+ {
+ dup2(fd, STDIN_FILENO);
+ dup2(fd, STDOUT_FILENO);
+ dup2(fd, STDERR_FILENO);
+ if (fd > STDERR_FILENO)
+ close(fd);
+ }
/* open the global trace file and make proc_username own it */
syslog( LOG_INFO, "%s: Using '%s' for global protocol logging file.",
--yNb1oOkm5a9FJOVX--