]> arthur.barton.de Git - netatalk.git/commitdiff
solaris bug #1242278, #1240793, #1079670, from Andrew Morgan
authordidg <didg>
Wed, 3 Dec 2008 19:17:27 +0000 (19:17 +0000)
committerdidg <didg>
Wed, 3 Dec 2008 19:17:27 +0000 (19:17 +0000)
configure.in
etc/atalkd/config.c
etc/uams/uams_dhx_pam.c
macros/db3-check.m4

index e730fce6f364b6012619dcb6030f2a8888d8f98c..01b24fd37b3d4a343a3853952e8eb47499014d26 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: configure.in,v 1.179.2.3.2.37.2.8 2008-12-02 03:11:58 didg Exp $
+dnl $Id: configure.in,v 1.179.2.3.2.37.2.9 2008-12-03 19:17:27 didg Exp $
 dnl configure.in for netatalk
 
 AC_INIT(etc/afpd/main.c)
@@ -380,19 +380,6 @@ dnl Check for CNID database backends
 bdb_required=no
 AC_NETATALK_CNID([bdb_required=yes],[bdb_required=no])
 
-dnl Check for Berkeley DB library
-if test "x$bdb_required" = "xyes"; then
-       AC_PATH_BDB(, [
-               AC_MSG_RESULT([])
-               AC_MSG_RESULT([Make sure you have the required Berkeley DB libraries AND headers installed.])
-               AC_MSG_RESULT([You can download the latest version from http://www.sleepycat.com.])
-               AC_MSG_RESULT([If you have installed BDB in a non standard location use the])
-               AC_MSG_RESULT([--with-bdb=/path/to/bdb configure option and make sure])
-               AC_MSG_RESULT([your linker is configured to check for libraries there.])
-               AC_MSG_ERROR([Berkeley DB library required but not found!])
-       ])
-fi
-
 dnl Check for quota support
 AC_CHECK_QUOTA
 
@@ -930,6 +917,19 @@ AM_PATH_LIBGCRYPT([1:1.2.3],[neta_cv_compile_dhx2=yes
 dnl -- look for openssl, if found enables DHX UAM and Randnum UAM
 AC_PATH_SSL
 
+dnl Check for Berkeley DB library
+if test "x$bdb_required" = "xyes"; then
+       AC_PATH_BDB(, [
+               AC_MSG_RESULT([])
+               AC_MSG_RESULT([Make sure you have the required Berkeley DB libraries AND headers installed.])
+               AC_MSG_RESULT([You can download the latest version from http://www.sleepycat.com.])
+               AC_MSG_RESULT([If you have installed BDB in a non standard location use the])
+               AC_MSG_RESULT([--with-bdb=/path/to/bdb configure option and make sure])
+               AC_MSG_RESULT([your linker is configured to check for libraries there.])
+               AC_MSG_ERROR([Berkeley DB library required but not found!])
+       ])
+fi
+
 dnl -- check for crypt
 AC_CRYPT
 
index fe3eb2a6870531221567e3d5a595006cf4929150..22ff63a34e0660f15c5ca9e20a855a176410da25 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: config.c,v 1.13.6.5.2.5 2008-11-14 10:04:52 didg Exp $
+ * $Id: config.c,v 1.13.6.5.2.6 2008-12-03 19:17:27 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved. See COPYRIGHT.
@@ -832,8 +832,9 @@ struct interface *newiface( name )
 int plumb()
 {
     struct interface   *iface;
-    char               device[ MAXPATHLEN + 1], *p;
+    char               device[ MAXPATHLEN + 1], *p, *t;
     int                        fd, ppa;
+    int                        digits = 0;
 
     for ( iface = interfaces; iface != NULL; iface = iface->i_next ) {
        if ( strcmp( iface->i_name, LOOPIFACE ) == 0 ) {
@@ -842,7 +843,16 @@ int plumb()
 
        strcpy( device, "/dev/" );
        strcat( device, iface->i_name );
-       if (( p = strpbrk( device, "0123456789" )) == NULL ) {
+       for (t = device; *t != '\0' ; ++t) {
+           if (isdigit(*t) == 0) {
+               p = t + 1;
+           }
+           else {
+               digits++;
+           }
+       }
+
+       if (digits == 0) {
            LOG(log_error, logtype_atalkd, "plumb: invalid device: %s", device );
            return -1;
        }
index 249cc7318b96885abb5436d95dc749ed9f8257bd..8d589836d1897ae668eddd4ff6d0c07ccd01c8fe 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uams_dhx_pam.c,v 1.24.6.5.2.1 2005-09-27 10:40:41 didg Exp $
+ * $Id: uams_dhx_pam.c,v 1.24.6.5.2.2 2008-12-03 19:17:27 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
@@ -193,12 +193,6 @@ static int dhx_setup(void *obj, char *ibuf, int ibuflen _U_,
     BIGNUM *bn, *gbn, *pbn;
     DH *dh;
 
-    /* TODO: seed dhx_setup properly... this is a hack */
-#ifdef sun
-       /* *SEVERE* hack... fix */
-       RAND_load_file("/var/adm/messages", KEYSIZE);
-#endif /* sun */
-
     /* get the client's public key */
     if (!(bn = BN_bin2bn(ibuf, KEYSIZE, NULL))) {
     /* Log Entry */
@@ -243,12 +237,22 @@ static int dhx_setup(void *obj, char *ibuf, int ibuflen _U_,
     /* generate key and make sure that we have enough space */
     dh->p = pbn;
     dh->g = gbn;
-    if (!DH_generate_key(dh) || (BN_num_bytes(dh->pub_key) > KEYSIZE)) {
-    /* Log Entry */
-           LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Err Generating Key -- Not enough Space? -- %s",
-                 strerror(errno));
-    /* Log Entry */
-    goto pam_fail;
+    if (DH_generate_key(dh) == 0) {
+       unsigned long dherror;
+       char errbuf[256];
+
+       ERR_load_crypto_strings();
+       dherror = ERR_get_error();
+       ERR_error_string_n(dherror, errbuf, 256);
+
+       LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Err Generating Key (OpenSSL error code: %u, %s)", dherror, errbuf);
+
+       ERR_free_strings();
+       goto pam_fail;
+    }
+    if (BN_num_bytes(dh->pub_key) > KEYSIZE) {
+       LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Err Generating Key -- Not enough Space? -- %s", strerror(errno));
+       goto pam_fail;
     }
 
     /* figure out the key. store the key in rbuf for now. */
index c21cbbba5cf0f0db0c4ff9e001946d0d03b78292..5d79ed8b0ed7f60cfd7a97ce09def0d6944a82f7 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: db3-check.m4,v 1.11.6.9.2.2 2006-09-09 01:36:39 didg Exp $
+dnl $Id: db3-check.m4,v 1.11.6.9.2.3 2008-12-03 19:17:27 didg Exp $
 dnl Autoconf macros to check for the Berkeley DB library
 
 
@@ -207,11 +207,17 @@ dnl                         bdbbindir="`echo $bdbdir | sed 's/include\/db4\.*.*/bin/'`"
                          CPPFLAGS="-I${bdbdir}${subdir} $CFLAGS"
                          CFLAGS=""
                          LDFLAGS="-L$bdblibdir $LDFLAGS"
+                         if test "x$need_dash_r" = "xyes"; then
+                               LDFLAGS="$LDFLAGS -R${bdblibdir}"
+                         fi
                          NETATALK_BERKELEY_LINK
                          if test x"${atalk_cv_lib_db}" != x"no"; then
                                NETATALK_BDB_CHECK_VERSION
                                if test x"${atalk_cv_bdb_version}" != x"no"; then
                                    BDB_LIBS="-L${bdblibdir} ${atalk_cv_lib_db}"
+                                   if test "x$need_dash_r" = "xyes"; then
+                                       BDB_LIBS="$BDB_LIBS -R${bdblibdir}"
+                                   fi
                                    BDB_CFLAGS="-I${bdbdir}${subdir}"
                                     BDB_BIN=$bdbbindir
                                     BDB_PATH="`echo $bdbdir | sed 's,include\/db4$,,'`"