]> arthur.barton.de Git - netatalk.git/commitdiff
Don't assume offsets, specify the struct member. (Olaf)
authorsrittau <srittau>
Sun, 26 Jan 2003 16:40:44 +0000 (16:40 +0000)
committersrittau <srittau>
Sun, 26 Jan 2003 16:40:44 +0000 (16:40 +0000)
acconfig.h
contrib/macusers/macusers.in
etc/afpd/auth.c
etc/uams/uams_dhx_passwd.c
etc/uams/uams_pgp.c
include/atalk/adouble.h
macros/ssl-check.m4

index fa1f2e26184ec3483bb662db06edbba73359ad52..2c38adfee6d737e4d543e9216003d4fcaf4cea81 100644 (file)
@@ -26,6 +26,7 @@
 #undef NO_CRYPT_H
 #undef NO_DDP
 #undef NO_STRUCT_TM_GMTOFF
+#undef GNUTLS_DHX
 #undef OPENSSL_DHX
 #undef SENDFILE_FLAVOR_BSD
 #undef SENDFILE_FLAVOR_LINUX
index 4796e8cc4d0da8a64d59dbc6ddfff0630e5d2c75..0c44430b788fd450d74d31809ff666858ec7b0e5 100644 (file)
@@ -42,7 +42,7 @@ if ($^O eq "freebsd") {
                 $pid  = $1;
                 $addr = $2;
                 $host = gethostbyaddr(pack('C4', split (/\./, $addr)), AF_INET);
-                ($host) = ($host =~ /(^[\w\d\-]+)/);
+                ($host) = ( $host =~ /(^(\d+\.){3}\d+|[\w\d\-]+)/ );
                 $mac{$pid} = $host;
         }
         print
@@ -57,7 +57,7 @@ if ($^O eq "freebsd") {
                 my ($pid, $host);
                 $pid  = $1;
                 $host = $2;
-                ($host) = ($host =~ /(^[\w\d\-]+)/);
+                ($host) = ( $host =~ /(^(\d+\.){3}\d+|[\w\d\-]+)/ );
                 $mac{$pid} = $host;
         }
         print
@@ -81,6 +81,7 @@ while (<PS>) {
 
         if ($ppid != 1) {
                 ($t, $t, $uid, $t, $t, $t, $name, $t, $t) = getpwnam($user);
+                ($name) = ( $name =~ /(^[^,]+)/ );
                 printf "%-8d %-8d %-16s %-20s %-9s %s\n", $pid, $uid, $user,
                     $name, $time, $mac{$pid};
         }
index 12b5f78808c2f7e60e5022cc7554b0c48e39eb93..da01ce610f323edbbdf6f68169f1cd48ec7e2658 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: auth.c,v 1.40 2003-01-24 06:58:23 didg Exp $
+ * $Id: auth.c,v 1.41 2003-01-26 16:40:44 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -172,7 +172,7 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void))
     }
 
     LOG(log_info, logtype_afpd, "login %s (uid %d, gid %d) %s", pwd->pw_name,
-        pwd->pw_uid, pwd->pw_gid , afp_versions[afp_version_index]);
+        pwd->pw_uid, pwd->pw_gid , afp_versions[afp_version_index].av_name);
 
     if (obj->proto == AFPPROTO_ASP) {
         ASP asp = obj->handle;
index 3df63c4b5703406e49c865da6143bf5f3670252e..7d199df9630be1213da7cd61f11edb6672e958ba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uams_dhx_passwd.c,v 1.16 2002-09-29 23:30:20 sibaz Exp $
+ * $Id: uams_dhx_passwd.c,v 1.17 2003-01-26 16:40:44 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
@@ -26,7 +26,9 @@
 #include <shadow.h>
 #endif /* SHADOWPW */
 
-#ifdef OPENSSL_DHX
+#if defined(GNUTLS_DHX)
+#include <gnutls/openssl.h>
+#elif defined(OPENSSL_DHX)
 #include <openssl/bn.h>
 #include <openssl/dh.h>
 #include <openssl/cast.h>
index 7cb9cac3ec30a0ebd0209e878c8ca72705817023..d115f801bd7235b4b620f49a7d44a23c38dcc260 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uams_pgp.c,v 1.7 2002-09-29 23:30:20 sibaz Exp $
+ * $Id: uams_pgp.c,v 1.8 2003-01-26 16:40:45 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
@@ -21,7 +21,9 @@
 #include <pwd.h>
 #include <atalk/logger.h>
 
-#ifdef OPENSSL_DHX
+#if defined(GNUTLS_DHX)
+#include <gnutls/openssl.h>
+#elif defined(OPENSSL_DHX)
 #include <openssl/bn.h>
 #include <openssl/dh.h>
 #include <openssl/cast.h>
index 3f6adf53259e9212ef22283838994f6ee30e08b6..492c3b80953983ff3cd29b04626dc6216f369f1b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: adouble.h,v 1.15 2003-01-24 06:58:25 didg Exp $
+ * $Id: adouble.h,v 1.16 2003-01-26 16:40:45 srittau Exp $
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
 #ifndef _ATALK_ADOUBLE_H
 #define _ATALK_ADOUBLE_H
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 /* ------------------- 
  * need pread() and pwrite()
 */
@@ -49,6 +53,7 @@
 #endif
 
 #ifdef HAVE_UNISTD_H
+#define __USE_MISC
 #include <unistd.h>
 #endif 
 
 
 #undef SENDFILE_FLAVOR_LINUX
 
-#else
+#else /* _FILE_OFFSET_BITS != 64 */
+
 #define HAVE_SENDFILE_READ
 #define HAVE_SENDFILE_WRITE
 #include <asm/unistd.h>
 
 #ifdef __NR_sendfile
-#ifndef ATACC
+#ifdef ATACC
+extern int sendfile __P((int , int , off_t *, size_t ));
+#else /* !ATACC */
 static __inline__ int sendfile(int fdout, int fdin, off_t *off, size_t count)
 {
-#if _FILE_OFFSET_BITS == 64 
-  return syscall(__NR_sendfile64, fdout, fdin, off, count);
-#else
   return syscall(__NR_sendfile, fdout, fdin, off, count);
-#endif
 }
-#else
-extern int sendfile __P((int , int , off_t *, size_t ));
 #endif /* ATACC */
 
-#else
+#else /* !__NR_sendfile */
 #include <sys/sendfile.h>
-#endif
-#endif
+#endif /* __NR_sendfile */
+#endif /* _FILE_OFFSET_BITS */
 #endif /* SENDFILE_FLAVOR_LINUX */
 
 #ifdef SENDFILE_FLAVOR_BSD
index 7aee7c02fe193165dcece0f74db57ca99e235f94..e7954f12e842328a0664b0f1cba7baad1e0c3d2e 100644 (file)
@@ -1,4 +1,4 @@
-dnl $Id: ssl-check.m4,v 1.5 2001-12-03 19:31:33 srittau Exp $
+dnl $Id: ssl-check.m4,v 1.6 2003-01-26 16:40:46 srittau Exp $
 dnl Autoconf macro to check for SSL or OpenSSL
 
 AC_DEFUN([AC_PATH_SSL], [
@@ -23,31 +23,45 @@ AC_DEFUN([AC_PATH_SSL], [
        compile_ssl=no
 
        if test "$tryssl" = "yes"; then
-               AC_MSG_CHECKING([for SSL])
-               for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl /usr/local/ssl ; do
-                       if test -f "$ssldir/include/openssl/cast.h" ; then
-                               SSL_CFLAGS="$SSL_CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
-                               SSL_LIBS="$SSL_LIBS -L$ssldir/lib -L$ssldir -lcrypto"
-                               if test "x$need_dash_r" = "xyes"; then
-                                       SSL_LIBS="$SSL_LIBS -R$ssldir/lib -R$ssldir"
-                               fi
-                               AC_MSG_RESULT([$ssldir (enabling RANDNUM and DHX support)])
+
+dnl GnuTLS test
+
+               AM_PATH_LIBGNUTLS_EXTRA(, [
+                       SSL_CFLAGS="$SSL_CFLAGS $LIBGNUTLS_EXTRA_CFLAGS"
+                       SSL_LIBS="$SSL_LIBS $LIBGNUTLS_EXTRA_LIBS"
+                       AC_DEFINE(GNUTLS_DHX, 1)
+                       AC_DEFINE(UAM_DHX,    1)
+                       compile_ssl=yes
+               ], [
+
+dnl OpenSSL test
+
+                       AC_MSG_CHECKING([for OpenSSL])
+                       for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl /usr/local/ssl ; do
+                               if test -f "$ssldir/include/openssl/cast.h" ; then
+                                       SSL_CFLAGS="$SSL_CFLAGS -I$ssldir/include -I$ssldir/include/openssl"
+                                       SSL_LIBS="$SSL_LIBS -L$ssldir/lib -L$ssldir -lcrypto"
+                                       if test "x$need_dash_r" = "xyes"; then
+                                               SSL_LIBS="$SSL_LIBS -R$ssldir/lib -R$ssldir"
+                                       fi
+                                       AC_MSG_RESULT([$ssldir (enabling RANDNUM and DHX support)])
 
 dnl FIXME: The following looks crude and probably doesn't work properly.
-                               dnl Check for the crypto library:
-                               AC_CHECK_LIB(crypto, main)
-                               dnl Check for "DES" library (for SSLeay, not openssl):
-                               AC_CHECK_LIB(des, main)
-
-                               AC_DEFINE(OPENSSL_DHX,  1)
-                               AC_DEFINE(UAM_DHX,      1)
-                               compile_ssl=yes
-                               break
+                                       dnl Check for the crypto library:
+                                       AC_CHECK_LIB(crypto, main)
+                                       dnl Check for "DES" library (for SSLeay, not openssl):
+                                       AC_CHECK_LIB(des, main)
+
+                                       AC_DEFINE(OPENSSL_DHX,  1)
+                                       AC_DEFINE(UAM_DHX,      1)
+                                       compile_ssl=yes
+                                       break
+                               fi
+                       done
+                       if test "x$compile_ssl" = "xno"; then
+                               AC_MSG_RESULT([no])
                        fi
-               done
-               if test "x$compile_ssl" = "xno"; then
-                       AC_MSG_RESULT([no])
-               fi
+               ])
        fi
        AC_SUBST(SSL_CFLAGS)
        AC_SUBST(SSL_LIBS)