]> arthur.barton.de Git - netatalk.git/commitdiff
Big configure.in cleanup
authorFrank Lahm <franklahm@googlemail.com>
Thu, 24 Feb 2011 15:02:32 +0000 (16:02 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Thu, 24 Feb 2011 15:02:32 +0000 (16:02 +0100)
42 files changed:
configure.in
contrib/Makefile.am
contrib/a2boot/.gitignore [deleted file]
contrib/a2boot/COPYRIGHT [deleted file]
contrib/a2boot/Makefile.am [deleted file]
contrib/a2boot/VERSION [deleted file]
contrib/a2boot/a2boot.c [deleted file]
contrib/timelord/.gitignore [deleted file]
contrib/timelord/COPYRIGHT [deleted file]
contrib/timelord/Makefile.am [deleted file]
contrib/timelord/README [deleted file]
contrib/timelord/VERSION [deleted file]
contrib/timelord/timelord.c [deleted file]
etc/afpd/afp_dsi.c
etc/afpd/afp_options.c
etc/afpd/auth.c
etc/afpd/desktop.c
etc/afpd/file.c
etc/afpd/filedir.c
etc/afpd/fork.c
etc/afpd/fork.h
etc/afpd/globals.h
etc/afpd/ofork.c
etc/afpd/uid.c
etc/afpd/uid.h
etc/afpd/unix.c
etc/afpd/volume.c
etc/uams/uams_gss.c
include/atalk/locking.h
include/atalk/tdb.h
include/atalk/volume.h
libatalk/adouble/ad_lock.c
libatalk/locking/Makefile.am
libatalk/locking/locking.c
libatalk/util/bprint.c
libatalk/util/volinfo.c
libatalk/vfs/unix.c
macros/cups.m4 [deleted file]
macros/srvloc.m4
macros/tcp-wrappers.m4
macros/zeroconf.m4
sys/netatalk/endian.h [deleted file]

index 4a941dc8fa841bf893c081260261c12289c40dbe..cf01c8dd4e73cdc9378239d7ea574485d9f7a3af 100644 (file)
@@ -164,41 +164,6 @@ AC_ARG_WITH(cracklib,
 AC_MSG_CHECKING([for cracklib support])
 AC_MSG_RESULT([$netatalk_cv_with_cracklib])
 
-netatalk_cv_ddp_enabled=no
-AC_MSG_CHECKING([whether to enable DDP])
-AC_ARG_ENABLE(ddp,
-       [  --enable-ddp            enable DDP (AppleTalk)],[
-       if test "$enableval" = "yes"; then 
-               AC_MSG_RESULT([yes])
-               netatalk_cv_ddp_enabled=yes
-       else
-               AC_MSG_RESULT([yes])
-               AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
-       fi
-       ],[
-               AC_MSG_RESULT([no])
-               AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
-       ]
-)
-
-AC_MSG_CHECKING([whether to enable debug code])
-AC_ARG_ENABLE(debug1,
-       [  --enable-debug1         enable debug code],[
-       if test "$enableval" != "no"; then
-               if test "$enableval" = "yes"; then
-                       AC_DEFINE(DEBUG1, 1, [Define if debugging information should be included])
-               else
-                       AC_DEFINE_UNQUOTED(DEBUG1, $enableval, [Define if debugging information should be included])
-               fi 
-               AC_MSG_RESULT([yes])
-       else
-               AC_MSG_RESULT([no])
-       fi
-       ],[
-               AC_MSG_RESULT([no])
-       ]
-)
-
 AC_MSG_CHECKING([whether to enable verbose debug code])
 AC_ARG_ENABLE(debug,
        [  --enable-debug          enable verbose debug code],[
@@ -240,46 +205,6 @@ AC_ARG_ENABLE(debugging,
 AC_SYS_LARGEFILE([], AC_MSG_ERROR([AFP 3.x support requires Large File Support.]))
 AC_CHECK_ICONV
 
-dnl ----------- A NOTE ABOUT DROPKLUDGE
-dnl The trouble with this fix is that if you know what the file is called, it
-dnl can be read from the Unix side.  That's okay for most academic institutions
-dnl since the students don't have telnet access to the Mac servers.  There is
-dnl currently no one working on further development/fixes of DROPKLUDGE.
-dnl -----------
-
-netatalk_cv_dropkludge=no
-AC_MSG_CHECKING([whether to enable experimental dropbox support])
-AC_ARG_ENABLE(dropkludge,
-       [  --enable-dropkludge     enable the experimental dropbox fix (INSECURE!) ],[
-       if test "$enableval" = "yes"; then 
-               AC_DEFINE(DROPKLUDGE, 1, [Define if you want to use the experimental dropkludge support])
-               AC_MSG_RESULT([yes])
-               netatalk_cv_dropkludge=yes
-       else
-               AC_MSG_RESULT([no])
-       fi
-       ],[
-               AC_MSG_RESULT([no])
-       ]
-)
-
-netatalk_cv_force_uidgid=no
-AC_MSG_CHECKING([whether to enable forcing of uid/gid per volume])
-AC_ARG_ENABLE(force-uidgid,
-       [  --enable-force-uidgid   allow forcing of uid/gid per volume (BROKEN) ],[
-       if test "$enableval" = "yes"; then
-               AC_DEFINE(FORCE_UIDGID, 1, [Define if you want forcing of uid/gid per volume])
-               AC_MSG_RESULT([enabling forcing of uid/gid per volume])
-               AC_MSG_RESULT([yes])
-               netatalk_cv_force_uidgid=yes
-       else
-               AC_MSG_RESULT([no])
-       fi
-       ],[
-               AC_MSG_RESULT([no])
-       ]
-)
-
 dnl Check for CNID database backends
 bdb_required=no
 AC_NETATALK_CNID([bdb_required=yes],[bdb_required=no])
@@ -288,10 +213,13 @@ dnl Check for quota support
 AC_CHECK_QUOTA
 
 dnl Check for optional server location protocol support (used by MacOS X)
-NETATALK_SRVLOC
+AC_NETATALK_SRVLOC
 
 dnl Check for optional Zeroconf support
-NETATALK_ZEROCONF
+AC_NETATALK_ZEROCONF
+
+dnl Check for optional TCP-wrappers support
+AC_NETATALK_TCP_WRAPPERS
 
 dnl Check for PAM libs
 netatalk_cv_use_pam=no
@@ -302,6 +230,7 @@ AC_PATH_PAM([
        AC_DEFINE(USE_PAM, 1, [Define to enable PAM support])
 ])
 
+dnl Check for optional shadow password support
 netatalk_cv_use_shadowpw=no
 AC_ARG_WITH(shadow,
        [  --with-shadow           enable shadow password support [[auto]]],
@@ -330,8 +259,7 @@ else
        AC_MSG_RESULT([no])
 fi
        
-       
-       
+dnl Check for optional valid-shell-check support
 netatalk_cv_use_shellcheck=yes
 AC_MSG_CHECKING([whether checking for a valid shell should be enabled])
 AC_ARG_ENABLE(shell-check,
@@ -348,25 +276,7 @@ AC_ARG_ENABLE(shell-check,
        ]
 )
 
-NETATALK_TCP_WRAPPERS
-
-AC_MSG_CHECKING([whether system (fcntl) locking should be disabled])
-AC_ARG_ENABLE(locking,
-        [  --disable-locking       disable system locking],[
-               if test "$enableval" = "no"; then
-                       AC_DEFINE(DISABLE_LOCKING, 1, [Define if system (fcntl) locking should be disabled])
-                       AC_MSG_RESULT([yes])
-               else
-                       AC_MSG_RESULT([no])
-               fi
-               
-       ],[
-               AC_MSG_RESULT([no])
-       ]
-
-)
-
-
+dnl OS specific configuration
 AC_ARG_ENABLE(redhat,
        [  --enable-redhat         use redhat-style sysv configuration ],[
        if test "$enableval" = "yes"; then
@@ -419,26 +329,7 @@ AC_ARG_ENABLE(debian,
        ]
 )
 
-dnl ----- timelord compilation (disabled by default)
-AC_MSG_CHECKING([whether timelord should be compiled])
-compile_timelord=no
-AC_ARG_ENABLE(timelord,
-       [  --enable-timelord       enable compilation of timelord server],
-       [compile_timelord="$enableval"],
-       [compile_timelord="no"]
-)
-AC_MSG_RESULT([$compile_timelord])
-
-dnl ----- a2boot compilation (disabled by default)
-AC_MSG_CHECKING([whether a2boot should be compiled])
-compile_a2boot=no
-AC_ARG_ENABLE(a2boot,
-       [  --enable-a2boot         enable compilation of Apple2 boot server],
-       [compile_a2boot="$enableval"],
-       [compile_a2boot="no"]
-)
-AC_MSG_RESULT([$compile_a2boot])
-
+dnl Path where UAM modules shall be installed
 AC_ARG_WITH(uams-path,
        [  --with-uams-path=PATH   path to UAMs [[PKGCONF/uams]]],[
                uams_path="$withval"
@@ -447,8 +338,6 @@ AC_ARG_WITH(uams-path,
        ]
 )
 
-NETATALK_AC_CUPS
-
 dnl check if we can use attribute unused (gcc only) from ethereal
 AC_MSG_CHECKING(to see if we can add '__attribute__((unused))' to CFLAGS)
 if test x$GCC != x ; then
@@ -487,9 +376,6 @@ dnl --------------------------------------------------------------------------
 dnl post-FHS substitutions, etc
 dnl --------------------------------------------------------------------------
 
-dnl ***** UAMS_PATH
-dnl AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
-dnl    [path to UAMs [default=PKGCONF/uams]])
 UAMS_PATH="${uams_path}"
 AC_SUBST(UAMS_PATH)
 
@@ -533,25 +419,8 @@ case "$host_cpu" in
        powerpc|ppc)                            this_cpu=ppc ;;
 esac
 
-dnl --------------------- GNU source
-case "$this_os" in
-       linux)  AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
-        ;;
-esac
-
 dnl --------------------- operating system specific flags (port from sys/*)
 
-dnl ----- AIX specific -----
-if test x"$this_os" = "xaix"; then
-       AC_MSG_RESULT([ * AIX specific configuration])
-       AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
-
-       dnl This is probably a lie; AIX 4.3 supports a 64-bit long
-       dnl compilation environment.  It's enough to get things defined
-       dnl right in endian.h provided that long long is supported, though.
-       AC_DEFINE(HAVE_32BIT_LONGS, 1, [Define if the data type long has 32 bit])
-fi
-
 dnl ----- FreeBSD specific -----
 if test x"$this_os" = "xfreebsd"; then 
        AC_MSG_RESULT([ * FreeBSD specific configuration])
@@ -561,57 +430,12 @@ if test x"$this_os" = "xfreebsd"; then
     AC_DEFINE(OPEN_NOFOLLOW_ERRNO, EMLINK, errno returned by open with O_NOFOLLOW)
 fi
 
-dnl ----- HP-UX 11 specific -----
-if test x"$this_os" = "xhpux11"; then
-       AC_MSG_RESULT([ * HP-UX 11 specific configuration])
-
-       AC_DEFINE(_ISOC9X_SOURCE, 1, [Compatibility macro])
-       AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
-fi
-
-dnl ----- IRIX specific -----
-if test x"$this_os" = "xirix"; then
-       AC_MSG_RESULT([ * IRIX specific configuration])
-
-       AC_DEFINE(NO_STRUCT_TM_GMTOFF, 1, [Define if the gmtoff member of struct tm is not available])
-fi
-
 dnl ----- Linux specific -----
 if test x"$this_os" = "xlinux"; then 
        AC_MSG_RESULT([ * Linux specific configuration])
        
-       dnl ----- kernel 2.6 changed struct at_addr to atalk_addr
-       AC_MSG_CHECKING([for struct atalk_addr])
-dnl    AC_COMPILE_IFELSE([
-       AC_TRY_COMPILE([
-#include <sys/socket.h>
-#include <asm/types.h>
-#include <linux/atalk.h>
-
-       struct atalk_addr foo;
-],
-[ ], [
-               ac_have_atalk_addr=yes
-               AC_MSG_RESULT([yes])
-       ], [
-               AC_MSG_RESULT([no])
-       ])
-
-if test "x$ac_have_atalk_addr" = "xyes"; then
-       AC_DEFINE(HAVE_ATALK_ADDR, 1, [set if struct at_addr is called atalk_addr])
-fi
-
        dnl ----- check if we need the quotactl wrapper
-#      AC_CHECK_HEADERS(sys/quota.h linux/quota.h)
-#      AC_CHECK_FUNC(quotactl,,
-#              AC_DEFINE(NEED_QUOTACTL_WRAPPER, 1, [Define if the quotactl wrapper is needed])
-#              AC_MSG_RESULT([enabling quotactl wrapper])
-#      )
-
-        # For quotas on Linux XFS filesystems
-        
-        # For linux > 2.5.56
-        AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
+    AC_CHECK_HEADERS(linux/dqblk_xfs.h,,
                [AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
                AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)]
        )
@@ -679,14 +503,7 @@ netatalk_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,netatalk_cv_HAVE_BROKEN_LINUX_SENDFIL
            fi
        fi
 
-       dnl ----- Linux/alpha specific -----
-       if test x"$this_cpu" = "xalpha"; then 
-               AC_MSG_RESULT([enabling gcc memcpy bug workaround])
-               AC_DEFINE(HAVE_GCC_MEMCPY_BUG, 1, [Define if memcpy is buggy])
-       fi
        need_dash_r=no
-
-
 fi
 
 dnl ----- Mac OSX specific -----
@@ -813,23 +630,6 @@ netatalk_cv_HAVE_TIMEOUT_ID_T=yes,netatalk_cv_HAVE_TIMEOUT_ID_T=no,netatalk_cv_H
        AC_SUBST(KLDFLAGS)
 fi
 
-dnl ----- Tru64 specific -----
-if test x"$this_os" = "xtru64"; then 
-       AC_MSG_RESULT([ * Tru64 specific configuration])
-       AC_DEFINE(NO_DDP, 1, [Define if DDP should be disabled])
-       AC_DEFINE(HAVE_64BIT_LONGS, 1, [Define if the data type long has 64 bit])
-       dnl AC_DEFINE(USE_MOUNT_H)
-       AC_DEFINE(USE_OLD_RQUOTA, 1, [Define to use old rquota])
-       dnl AC_DEFINE(USE_UFS_QUOTA_H)
-       AC_DEFINE(TRU64, 1, [Define on Tru64 platforms])
-       AC_DEFINE(_OSF_SOURCE, 1, [Define if the *passwd UAMs should be used])
-       AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Define for Berkeley DB 4])
-       AC_CHECK_LIB(security,set_auth_parameters)
-       CFLAGS="-I\$(top_srcdir)/sys/tru64 $CFLAGS"
-       need_dash_r=no
-       sysv_style=tru64
-fi
-
 dnl -- check for libgcrypt, if found enables DHX UAM
 AM_PATH_LIBGCRYPT([1:1.2.3],[neta_cv_compile_dhx2=yes
                        neta_cv_have_libgcrypt=yes
@@ -1216,8 +1016,6 @@ AC_SUBST(CFLAGS)
 AC_SUBST(OVERWRITE_CONFIG)
 
 AM_CONDITIONAL(SOLARIS_MODULE, test x$solaris_module = xyes)
-AM_CONDITIONAL(COMPILE_TIMELORD, test x$compile_timelord = xyes)
-AM_CONDITIONAL(COMPILE_A2BOOT, test x$compile_a2boot = xyes)
 AM_CONDITIONAL(HAVE_LIBGCRYPT, test x$neta_cv_have_libgcrypt = xyes)
 AM_CONDITIONAL(HAVE_OPENSSL, test x$neta_cv_have_openssl = xyes)
 AM_CONDITIONAL(HAVE_ACLS, test x"$with_acl_support" = x"yes")
@@ -1270,8 +1068,6 @@ AC_OUTPUT([Makefile
        contrib/shell_utils/afpd-mtab.pl
     contrib/shell_utils/apple_dump
        contrib/shell_utils/asip-status.pl
-       contrib/timelord/Makefile
-       contrib/a2boot/Makefile
        distrib/Makefile
        distrib/config/Makefile
        distrib/config/netatalk-config
index 5652b1bb74d2ad283927a2c398cc40cba3b43da9..7aa4378fba28b1c71c071bde4dd59fcff254d82a 100644 (file)
@@ -2,14 +2,6 @@
 
 SUBDIRS = macusers shell_utils
 
-if COMPILE_TIMELORD
-SUBDIRS += timelord
-endif
-
-if COMPILE_A2BOOT
-SUBDIRS += a2boot
-endif
-
 if USE_APPLETALK
 SUBDIRS += printing
 endif
diff --git a/contrib/a2boot/.gitignore b/contrib/a2boot/.gitignore
deleted file mode 100644 (file)
index a751359..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Makefile
-Makefile.in
-a2boot
-.deps
-.libs
-.gitignore
-*.o
diff --git a/contrib/a2boot/COPYRIGHT b/contrib/a2boot/COPYRIGHT
deleted file mode 100644 (file)
index c698aba..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
-       Recoding circa Dec 2002-early 2003          by Marsha Jackson
-       support booting of Apple 2 computers,   with aid of Steven N. Hirsch
-       Code is copyrighted as listed below...
-       M. Jackson is establishing no personal copyright
-       or personal restrictions on this software.  Only the below rights exist
-*/
-
-/*
- * Copyright (c) 1990,1994 Regents of The University of Michigan.
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appears in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation, and that the name of The University
- * of Michigan not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. This software is supplied as is without expressed or
- * implied warranties of any kind.
- *
- *     Research Systems Unix Group
- *     The University of Michigan
- *     c/o Wesley Craig
- *     535 W. William Street
- *     Ann Arbor, Michigan
- *     +1 313 764 2278
- *     netatalk@umich.edu
- */
-
-/*
- * The "timelord protocol" was reverse engineered from Timelord,
- * distributed with CAP, Copyright (c) 1990, The University of
- * Melbourne.  The following copyright, supplied by The University
- * of Melbourne, may apply to this code:
- *
- *     This version of timelord.c is based on code distributed
- *     by the University of Melbourne as part of the CAP package.
- *
- *     The tardis/Timelord package for Macintosh/CAP is
- *     Copyright (c) 1990, The University of Melbourne.
- */
diff --git a/contrib/a2boot/Makefile.am b/contrib/a2boot/Makefile.am
deleted file mode 100644 (file)
index 9ab8cba..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# Makefile.am for contrib/a2boot/
-
-sbin_PROGRAMS = a2boot
-
-a2boot_SOURCES = a2boot.c
-a2boot_LDADD = $(top_builddir)/libatalk/libatalk.la
-
-LIBS = @LIBS@
-
-EXTRA_DIST = COPYRIGHT VERSION
-
-AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/sys \
-        @SLP_CFLAGS@ \
-        -D_PATH_A_GS_BLOCKS=\"$(PKGCONFDIR)/a2boot/ProDOS16\ Boot\ Blocks\" \
-        -D_PATH_A_2E_BLOCKS=\"$(PKGCONFDIR)/a2boot/Apple\ :2f:2fe\ Boot\ Blocks\" \
-        -D_PATH_P16_IMAGE=\"$(PKGCONFDIR)/a2boot/ProDOS16\ Image\"
diff --git a/contrib/a2boot/VERSION b/contrib/a2boot/VERSION
deleted file mode 100644 (file)
index 8e8299d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-2.4.2
diff --git a/contrib/a2boot/a2boot.c b/contrib/a2boot/a2boot.c
deleted file mode 100644 (file)
index 77fc641..0000000
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * $Id: a2boot.c,v 1.2 2003-01-15 06:24:28 jmarcus Exp $
- *   Apple II boot support code.       with aid of Steven N. Hirsch
- *
- * based on timelord 1.6 so below copyrights still apply
- *
- * Copyright (c) 1990,1992 Regents of The University of Michigan.
- * All Rights Reserved. See COPYRIGHT.
- *
- * The "timelord protocol" was reverse engineered from Timelord,
- * distributed with CAP, Copyright (c) 1990, The University of
- * Melbourne.  The following copyright, supplied by The University
- * of Melbourne, may apply to this code:
- *
- *     This version of timelord.c is based on code distributed
- *     by the University of Melbourne as part of the CAP package.
- *
- *     The tardis/Timelord package for Macintosh/CAP is
- *     Copyright (c) 1990, The University of Melbourne.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/file.h>
-#include <sys/uio.h>
-
-#include <unistd.h>
-
-#include <netatalk/at.h>
-#include <netatalk/endian.h>
-#include <atalk/atp.h>
-#include <atalk/nbp.h>
-
-#ifdef HAVE_SGTTY_H
-#include <sgtty.h>
-#endif /* HAVE_SGTTY_H */
-
-#include <errno.h>
-#include <signal.h>
-#include <atalk/logger.h>
-#include <stdio.h>
-#include <string.h>
-
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif /* HAVE_NETDB_H */
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif /* HAVE_FCNTL_H */
-#ifdef HAVE_SYS_FCNTL_H
-#include <sys/fcntl.h>
-#endif /* HAVE_SYS_FCNTL_H */
-
-#ifdef HAVE_TERMIOS_H
-#include <termios.h>
-#endif /* HAVE_TERMIOS_H */
-#ifdef HAVE_SYS_TERMIOS_H
-#include <sys/termios.h>
-#endif /* HAVE_SYS_TERMIOS_H */
-
-#define        TL_OK           '\0'
-#define TL_EOF         '\1'
-
-int    debug = 0;
-char   *bad = "Bad request!";
-char   buf[ 4624 ];
-char   *server;
-int32_t fileoff;
-
-long a2bootreq(char *fname);
-
-void usage( char *p )
-{
-    char       *s;
-
-    if (( s = rindex( p, '/' )) == NULL ) {
-       s = p;
-    } else {
-       s++;
-    }
-    fprintf( stderr, "Usage:\t%s -d -n nbpname\n", s );
-    exit( 1 );
-}
-
-/*
- * Unregister ourself on signal.
- */
-void
-goaway(int signal)
-{
-    int regerr;
-    regerr = nbp_unrgstr( server, "Apple //gs", "*", NULL );
-    regerr += nbp_unrgstr( server, "Apple //e Boot", "*", NULL );
-    regerr += nbp_unrgstr( server, "ProDOS16 Image", "*", NULL );
-    if ( regerr < 0 ) {
-       LOG(log_error, logtype_default, "Can't unregister Apple II boot files %s", server );
-       exit( 1 );
-    }
-    LOG(log_info, logtype_default, "going down" );
-    exit( 0 );
-}
-
-int main( int ac, char **av )
-{
-    ATP                atp;
-    struct sockaddr_at sat;
-    struct atp_block   atpb;
-    struct iovec       iov;
-    char       hostname[ MAXHOSTNAMELEN ];
-    char       *p;
-    int                c;
-    int32_t    req, resp;
-    int        regerr;
-    extern char        *optarg;
-    extern int         optind;
-
-
-    if ( gethostname( hostname, sizeof( hostname )) < 0 ) {
-       perror( "gethostname" );
-       exit( 1 );
-    }
-    if (( server = index( hostname, '.' )) != 0 ) {
-       *server = '\0';
-    }
-    server = hostname;
-
-    while (( c = getopt( ac, av, "dn:" )) != EOF ) {
-       switch ( c ) {
-       case 'd' :
-           debug++;
-           break;
-       case 'n' :
-           server = optarg;
-           break;
-       default :
-           fprintf( stderr, "Unknown option -- '%c'\n", c );
-           usage( *av );
-       }
-    }
-
-    /*
-     * Disassociate from controlling tty.
-     */
-    if ( !debug ) {
-       int             i, dt;
-
-       switch ( fork()) {
-       case 0 :
-           dt = getdtablesize();
-           for ( i = 0; i < dt; i++ ) {
-               (void)close( i );
-           }
-           if (( i = open( "/dev/tty", O_RDWR )) >= 0 ) {
-               (void)ioctl( i, TIOCNOTTY, 0 );
-               setpgid( 0, getpid());
-               (void)close( i );
-           }
-           break;
-       case -1 :
-           perror( "fork" );
-           exit( 1 );
-       default :
-           exit( 0 );
-       }
-    }
-
-    if (( p = rindex( *av, '/' )) == NULL ) {
-       p = *av;
-    } else {
-       p++;
-    }
-
-#ifdef ultrix
-    openlog( p, LOG_PID );
-#else /* ultrix */
-    set_processname(p);
-    syslog_setup(log_debug, logtype_default, logoption_ndelay|logoption_pid, logfacility_daemon );
-#endif /* ultrix */
-
-    /* allocate memory */
-    memset (&sat.sat_addr, 0, sizeof (sat.sat_addr));
-
-/*
-       force port 3 as the semi-official ATP access port        MJ 2002
-*/
-    if (( atp = atp_open( (u_int8_t)3, &sat.sat_addr )) == NULL ) {
-       LOG(log_error, logtype_default, "main: atp_open: %s", strerror( errno ) );
-       exit( 1 );
-    }
-
-    regerr = nbp_rgstr( atp_sockaddr( atp ), server, "Apple //gs", "*" );
-    regerr += nbp_rgstr( atp_sockaddr( atp ), server, "Apple //e Boot", "*" );
-    regerr += nbp_rgstr( atp_sockaddr( atp ), server, "ProDOS16 Image", "*" );
-    if ( regerr < 0 ) {
-       LOG(log_error, logtype_default, "Can't register Apple II boot files %s", server );
-       exit( 1 );
-    }
-
-    LOG(log_info, logtype_default, "%s:Apple 2 Boot started", server );
-
-       signal(SIGHUP, goaway);
-       signal(SIGTERM, goaway);
-
-    for (;;) {
-       /*
-        * Something seriously wrong with atp, since these assigns must
-        * be in the loop...
-        */
-       atpb.atp_saddr = &sat;
-       atpb.atp_rreqdata = buf;
-       bzero( &sat, sizeof( struct sockaddr_at ));
-       atpb.atp_rreqdlen = sizeof( buf );
-
-       if ( atp_rreq( atp, &atpb ) < 0 ) {
-       LOG(log_error, logtype_default, "main: atp_rreq: %s", strerror( errno ) );
-           exit( 1 );
-       }
-
-       p = buf;
-       bcopy( p, &req, sizeof( int32_t ));
-       req = ntohl( req );
-       p += sizeof( int32_t );
-
-/*
-    LOG(log_info, logtype_default, "req = %08lx",(long)req );
-*/
-       /* Byte-swap and multiply by 0x200. Converts block number to
-          file offset. */
-       fileoff = (( req & 0x00ff0000 ) >> 7 ) | (( req & 0x0000ff00 ) << 9 );
-       req &= 0xff000000;
-
-/*
-    LOG(log_info, logtype_default, "       reqblklo = %02x",(int)reqblklo );
-    LOG(log_info, logtype_default, "       reqblkhi = %02x",(int)reqblkhi );
-    LOG(log_info, logtype_default, "       req now = %08lx",(long)req );
-*/
-
-       switch( req ) {
-       case 0x01000000 :       /* Apple IIgs both ROM 1 and ROM 3 */
-/*    LOG(log_info, logtype_default, "          Req ProDOS16 Boot Blocks" ); */
-               resp = a2bootreq(_PATH_A_GS_BLOCKS);
-           break;
-
-       case 0x02000000 :       /* Apple 2 Workstation card  */
-/*    LOG(log_info, logtype_default, "          Req Apple //e Boot" );  */
-               resp = a2bootreq(_PATH_A_2E_BLOCKS);
-           break;
-
-       case 0x03000000 :       /* Apple IIgs both ROM 1 and ROM 3 */
-/*    LOG(log_info, logtype_default, "          Req ProDOS16 Image" );    */
-               resp = a2bootreq(_PATH_P16_IMAGE);
-           break;
-
-       default :
-           LOG(log_error, logtype_default, bad );
-
-           resp = TL_EOF;
-           *( buf + sizeof( int32_t ) ) = (unsigned char)strlen( bad );
-           strcpy( buf + 1 + sizeof( int32_t ), bad );
-
-           break;
-       }
-
-       bcopy( &resp, buf, sizeof( int32_t ));
-
-       iov.iov_len = sizeof( int32_t ) + 512;
-       iov.iov_base = buf;
-       atpb.atp_sresiov = &iov;
-       atpb.atp_sresiovcnt = 1;
-
-       if ( atp_sresp( atp, &atpb ) < 0 ) {
-           LOG(log_error, logtype_default, "main: atp_sresp: %s", strerror( errno ) );
-           exit( 1 );
-       }
-    }
-}
-
-
-/* below MJ 2002 (initially borrowed from aep_packet */
-long a2bootreq(fname)
-       char    *fname;
-{
-       int f,m;
-       int32_t readlen;
-/*
-    LOG(log_info, logtype_default, "          a2bootreq( %s )",fname );
-*/
-       f=open(fname,O_RDONLY );
-       if(f==EOF) {
-       LOG(log_error, logtype_default, "a2boot open error on %s",fname);
-               return close(f);
-       }
-
-/*
-    LOG(log_info, logtype_default, "would lseek to %08lx",fileoff);
-*/
-       lseek(f,fileoff,0);
-       readlen=read(f, buf + sizeof( int32_t ), 512 );
-
-/*
-    LOG(log_info, logtype_default, "length is %08lx", readlen);
-*/
-
-       if(readlen < 0x200) {
-/*    LOG(log_info, logtype_default, "Read to EOF");  */
-               close(f);
-               return TL_EOF;
-       }
-       close(f);
-       return  TL_OK;
-}
-
diff --git a/contrib/timelord/.gitignore b/contrib/timelord/.gitignore
deleted file mode 100644 (file)
index 47b8196..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Makefile
-Makefile.in
-timelord
-.deps
-.libs
-.gitignore
-*.o
diff --git a/contrib/timelord/COPYRIGHT b/contrib/timelord/COPYRIGHT
deleted file mode 100644 (file)
index f6141ea..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 1990,1994 Regents of The University of Michigan.
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appears in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation, and that the name of The University
- * of Michigan not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. This software is supplied as is without expressed or
- * implied warranties of any kind.
- *
- *     Research Systems Unix Group
- *     The University of Michigan
- *     c/o Wesley Craig
- *     535 W. William Street
- *     Ann Arbor, Michigan
- *     +1 313 764 2278
- *     netatalk@umich.edu
- */
-
-/*
- * The "timelord protocol" was reverse engineered from Timelord,
- * distributed with CAP, Copyright (c) 1990, The University of
- * Melbourne.  The following copyright, supplied by The University
- * of Melbourne, may apply to this code:
- *
- *     This version of timelord.c is based on code distributed
- *     by the University of Melbourne as part of the CAP package.
- *
- *     The tardis/Timelord package for Macintosh/CAP is
- *     Copyright (c) 1990, The University of Melbourne.
- */
diff --git a/contrib/timelord/Makefile.am b/contrib/timelord/Makefile.am
deleted file mode 100644 (file)
index b592695..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# Makefile.am for contrib/timelord/
-
-sbin_PROGRAMS = timelord
-
-timelord_SOURCES = timelord.c
-timelord_LDADD = $(top_builddir)/libatalk/libatalk.la
-
-LIBS = @LIBS@
-
-EXTRA_DIST = COPYRIGHT README VERSION
diff --git a/contrib/timelord/README b/contrib/timelord/README
deleted file mode 100644 (file)
index 37446f1..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-$Id: README,v 1.3 2002-02-21 09:59:24 srittau Exp $
-
-This is the README file for timelord 1.0 (previously known as
-ntimelord), for use with netatalk 1.5. Previous versions of this
-software were designed to work with netatalk 1.3, but this has
-been patched to work with netatalk 1.5.  Please see the COPYRIGHT
-file.  This package's COPYRIGHT is *not* the same as netatalk's.
-
-Building timelord:
-
-1.  Run ./configure from the base directory of your netatalk
-    distribution, and add --enable-timelord to your command line
-    options.
-
-2.  Run "make all" for netatalk, and timelord will be built along
-    with the rest of netatalk.
-
-Installing timelord:
-
-1.  To install the binaries, type "make install" from either the base
-    directory of your netatalk distribution or from this directory. 
-    This will install all of the binaries in the directory specified
-    by ./configure.
-
-2.  The file rc.atalk as distributed with netatalk 1.5 includes lines to
-    start timelord.
diff --git a/contrib/timelord/VERSION b/contrib/timelord/VERSION
deleted file mode 100644 (file)
index d3827e7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-1.0
diff --git a/contrib/timelord/timelord.c b/contrib/timelord/timelord.c
deleted file mode 100644 (file)
index 60fdb8e..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * $Id: timelord.c,v 1.8 2005-04-28 20:49:36 bfernhomberg Exp $
- *
- * Copyright (c) 1990,1992 Regents of The University of Michigan.
- * All Rights Reserved. See COPYRIGHT.
- *
- * The "timelord protocol" was reverse engineered from Timelord,
- * distributed with CAP, Copyright (c) 1990, The University of
- * Melbourne.  The following copyright, supplied by The University
- * of Melbourne, may apply to this code:
- *
- *     This version of timelord.c is based on code distributed
- *     by the University of Melbourne as part of the CAP package.
- *
- *     The tardis/Timelord package for Macintosh/CAP is
- *     Copyright (c) 1990, The University of Melbourne.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/file.h>
-#include <sys/uio.h>
-#include <stdlib.h>
-
-#include <unistd.h>
-
-#include <netatalk/at.h>
-#include <netatalk/endian.h>
-#include <atalk/atp.h>
-#include <atalk/nbp.h>
-
-#include <time.h>
-#ifdef HAVE_SGTTY_H
-#include <sgtty.h>
-#endif /* HAVE_SGTTY_H */
-#include <errno.h>
-#include <signal.h>
-#pragma warn "testing 123"
-#include <atalk/logger.h>
-#include <stdio.h>
-#include <string.h>
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif /* HAVE_NETDB_H */
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif /* HAVE_FCNTL_H */
-#ifdef HAVE_SYS_FCNTL_H
-#include <sys/fcntl.h>
-#endif /* HAVE_SYS_FCNTL_H */
-
-#ifdef HAVE_TERMIOS_H
-#include <termios.h>
-#endif /* HAVE_TERMIOS_H */
-#ifdef HAVE_SYS_TERMIOS_H
-#include <sys/termios.h>
-#endif /* HAVE_SYS_TERMIOS_H */
-
-#define        TL_GETTIME      0
-#define        TL_OK           12
-#define TL_BAD         10
-#define EPOCH          0x7C25B080      /* 00:00:00 GMT Jan 1, 1970 for Mac */
-
-int    debug = 0;
-char   *bad = "Bad request!";
-char   buf[ 4624 ];
-char   *server;
-
-void usage( char *p )
-{
-    char       *s;
-
-    if (( s = rindex( p, '/' )) == NULL ) {
-       s = p;
-    } else {
-       s++;
-    }
-    fprintf( stderr, "Usage:\t%s -d -n nbpname\n", s );
-    exit( 1 );
-}
-
-/*
- * Unregister ourself on signal.
- */
-void
-goaway(int signal)
-{
-    if ( nbp_unrgstr( server, "TimeLord", "*", NULL ) < 0 ) {
-       LOG(log_error, logtype_default, "Can't unregister %s", server );
-       exit( 1 );
-    }
-    LOG(log_info, logtype_default, "going down" );
-    exit( 0 );
-}
-
-int main( int ac, char **av )
-{
-    ATP                        atp;
-    struct sockaddr_at sat;
-    struct atp_block   atpb;
-    struct timeval     tv;
-    struct timezone    tz;
-    struct iovec       iov;
-    struct tm          *tm;
-    char               hostname[ MAXHOSTNAMELEN ];
-    char               *p;
-    int                        c;
-    long               req, mtime, resp;
-    extern char                *optarg;
-    extern int         optind;
-
-    if ( gethostname( hostname, sizeof( hostname )) < 0 ) {
-       perror( "gethostname" );
-       exit( 1 );
-    }
-    if (( server = index( hostname, '.' )) != 0 ) {
-       *server = '\0';
-    }
-    server = hostname;
-
-    while (( c = getopt( ac, av, "dn:" )) != EOF ) {
-       switch ( c ) {
-       case 'd' :
-           debug++;
-           break;
-       case 'n' :
-           server = optarg;
-           break;
-       default :
-           fprintf( stderr, "Unknown option -- '%c'\n", c );
-           usage( *av );
-       }
-    }
-
-    /*
-     * Disassociate from controlling tty.
-     */
-    if ( !debug ) {
-       int             i, dt;
-
-       switch ( fork()) {
-       case 0 :
-           dt = getdtablesize();
-           for ( i = 0; i < dt; i++ ) {
-               (void)close( i );
-           }
-           if (( i = open( "/dev/tty", O_RDWR )) >= 0 ) {
-               (void)ioctl( i, TIOCNOTTY, 0 );
-               setpgid( 0, getpid());
-               (void)close( i );
-           }
-           break;
-       case -1 :
-           perror( "fork" );
-           exit( 1 );
-       default :
-           exit( 0 );
-       }
-    }
-
-    if (( p = rindex( *av, '/' )) == NULL ) {
-       p = *av;
-    } else {
-       p++;
-    }
-
-#ifdef ultrix
-    openlog( p, LOG_PID );
-#else /* ultrix */
-    set_processname(p);
-    syslog_setup(log_debug, logtype_default, logoption_ndelay|logoption_pid, logfacility_daemon );
-#endif /* ultrix */
-
-    /* allocate memory */
-    memset (&sat.sat_addr, 0, sizeof (sat.sat_addr));
-
-    if (( atp = atp_open( ATADDR_ANYPORT, &sat.sat_addr )) == NULL ) {
-       LOG(log_error, logtype_default, "main: atp_open: %s", strerror( errno ) );
-       exit( 1 );
-    }
-
-    if ( nbp_rgstr( atp_sockaddr( atp ), server, "TimeLord", "*" ) < 0 ) {
-       LOG(log_error, logtype_default, "Can't register %s", server );
-       exit( 1 );
-    }
-    LOG(log_info, logtype_default, "%s:TimeLord started", server );
-
-       signal(SIGHUP, goaway);
-       signal(SIGTERM, goaway);
-
-    for (;;) {
-       /*
-        * Something seriously wrong with atp, since these assigns must
-        * be in the loop...
-        */
-       atpb.atp_saddr = &sat;
-       atpb.atp_rreqdata = buf;
-       bzero( &sat, sizeof( struct sockaddr_at ));
-       atpb.atp_rreqdlen = sizeof( buf );
-       if ( atp_rreq( atp, &atpb ) < 0 ) {
-           LOG(log_error, logtype_default, "main: atp_rreq: %s", strerror( errno ) );
-           exit( 1 );
-       }
-
-       p = buf;
-       bcopy( p, &req, sizeof( long ));
-       req = ntohl( req );
-       p += sizeof( long );
-
-       switch( req ) {
-       case TL_GETTIME :
-           if ( atpb.atp_rreqdlen > 5 ) {
-                   bcopy( p + 1, &mtime, sizeof( long ));
-                   mtime = ntohl( mtime );
-                   LOG(log_info, logtype_default, "gettime from %s %s was %lu",
-                           (*( p + 5 ) == '\0' ) ? "<unknown>" : p + 5,
-                           ( *p == 0 ) ? "at boot" : "in chooser",
-                           mtime );
-           } else {
-                   LOG(log_info, logtype_default, "gettime" );
-           }
-
-           if ( gettimeofday( &tv, &tz ) < 0 ) {
-               LOG(log_error, logtype_default, "main: gettimeofday: %s", strerror( errno ) );
-               exit( 1 );
-           }
-           if (( tm = gmtime( &tv.tv_sec )) == 0 ) {
-               perror( "localtime" );
-               exit( 1 );
-           }
-
-           mtime = tv.tv_sec + EPOCH;
-           mtime = htonl( mtime );
-
-           resp = TL_OK;
-           bcopy( &resp, buf, sizeof( long ));
-           bcopy( &mtime, buf + sizeof( long ), sizeof( long ));
-           iov.iov_len = sizeof( long ) + sizeof( long );
-           break;
-
-       default :
-           LOG(log_error, logtype_default, bad );
-
-           resp = TL_BAD;
-           bcopy( &resp, buf, sizeof( long ));
-           *( buf + 4 ) = (unsigned char)strlen( bad );
-           strcpy( buf + 5, bad );
-           iov.iov_len = sizeof( long ) + 2 + strlen( bad );
-           break;
-       }
-
-       iov.iov_base = buf;
-       atpb.atp_sresiov = &iov;
-       atpb.atp_sresiovcnt = 1;
-       if ( atp_sresp( atp, &atpb ) < 0 ) {
-           LOG(log_error, logtype_default, "main: atp_sresp: %s", strerror( errno ) );
-           exit( 1 );
-       }
-    }
-}
index d030d72570ac36571080239f6f3d4325dac2f198..7382bbb47d7b1c6958a615d84d302f3bbf583dfc 100644 (file)
 #include "fork.h"
 #include "dircache.h"
 
-#ifdef FORCE_UIDGID
-#warning UIDGID
-#include "uid.h"
-#endif /* FORCE_UIDGID */
-
 /* 
  * We generally pass this from afp_over_dsi to all afp_* funcs, so it should already be
  * available everywhere. Unfortunately some funcs (eg acltoownermode) need acces to it
@@ -570,11 +565,6 @@ void afp_over_dsi(AFPObj *obj)
 
                     dir_free_invalid_q();
 
-#ifdef FORCE_UIDGID
-                    /* bring everything back to old euid, egid */
-                    if (obj->force_uid)
-                        restore_uidgid ( &obj->uidgid );
-#endif /* FORCE_UIDGID */
                     dsi->flags &= ~DSI_RUNNING;
 
                     /* Add result to the AFP replay cache */
@@ -616,11 +606,6 @@ void afp_over_dsi(AFPObj *obj)
                     AfpNum2name(function), AfpErr2name(err));
 
                 dsi->flags &= ~DSI_RUNNING;
-#ifdef FORCE_UIDGID
-               /* bring everything back to old euid, egid */
-               if (obj->force_uid)
-                   restore_uidgid ( &obj->uidgid );
-#endif /* FORCE_UIDGID */
             } else {
                 LOG(log_error, logtype_afpd, "(write) bad function %x", function);
                 dsi->datalen = 0;
index ef88b1e638a9d7237d4664528fa602a01878f866..d89c5501e8097ded5710121685627440e727ce1c 100644 (file)
@@ -580,20 +580,6 @@ static void show_version_extended(void )
        puts( "No" );
 #endif
 
-       printf( "        Dropbox kludge:\t" );
-#ifdef DROPKLUDGE
-       puts( "Yes" );
-#else
-       puts( "No" );
-#endif
-
-       printf( "  Force volume uid/gid:\t" );
-#ifdef FORCE_UIDGID
-       puts( "Yes" );
-#else
-       puts( "No" );
-#endif
-
        printf( "           ACL support:\t" );
 #ifdef HAVE_ACLS
        puts( "Yes" );
index e63a5a42c8bd8923aeb0d951e6520458809f52ec..ced4d2047da5d4bc078acf97c8e0bf4994c18e4a 100644 (file)
@@ -425,11 +425,6 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void), int expi
     obj->uid = geteuid();
     obj->logout = logout;
 
-#ifdef FORCE_UIDGID
-    obj->force_uid = 1;
-    save_uidgid ( &obj->uidgid );
-#endif
-
     return( AFP_OK );
 }
 
index b5e4f876abba3dea525f54ff0248305620da564a..955efc165f975d2427b9f6e2079b04992b9ae0e6 100644 (file)
@@ -223,13 +223,6 @@ addicon_err:
         if ((asp_wrtcont(obj->handle, rbuf, &buflen) < 0) || buflen != bsize)
             return( AFPERR_PARAM );
 
-#ifdef DEBUG1
-        if (obj->options.flags & OPTION_DEBUG) {
-            printf("(write) len: %d\n", buflen);
-            bprint(rbuf, buflen);
-        }
-#endif
-
         /*
          * We're at the end of the file, add the headers, etc.  */
         if ( cc == 0 ) {
index 266b5c7567f384c77864328ccd3139c7bdf4322f..bd0e935c0fe8d2e44049b7471578cdf69e969e9f 100644 (file)
@@ -725,12 +725,6 @@ int afp_createfile(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_,
 createfile_done:
     curdir->offcnt++;
 
-#ifdef DROPKLUDGE
-    if (vol->v_flags & AFPVOL_DROPBOX) {
-        retvalue = matchfile2dirperms(upath, vol, did);
-    }
-#endif /* DROPKLUDGE */
-
     setvoltime(obj, vol );
 
     return (retvalue);
@@ -1270,9 +1264,6 @@ int afp_copyfile(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, si
         goto copy_exit;
     }
 
-#ifdef FORCE_UIDGID
-    /* FIXME svid != dvid && dvid's user can't read svid */
-#endif
     if (NULL == ( d_vol = getvolbyvid( dvid )) ) {
         retvalue = AFPERR_PARAM;
         goto copy_exit;
@@ -1317,12 +1308,6 @@ int afp_copyfile(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, si
     }
     curdir->offcnt++;
 
-#ifdef DROPKLUDGE
-    if (vol->v_flags & AFPVOL_DROPBOX) {
-        retvalue=matchfile2dirperms(upath, vol, ddid); /* FIXME sdir or ddid */
-    }
-#endif /* DROPKLUDGE */
-
     setvoltime(obj, d_vol );
 
 copy_exit:
index 47b819f95255f09625054b9f0157944144f23649..bb2bdd1dd0011f21d0e9c001e981d9dd2f34cc76 100644 (file)
 #include "filedir.h"
 #include "unix.h"
 
-#ifdef DROPKLUDGE
-int matchfile2dirperms(
-/* Since it's kinda' big; I decided against an
-   inline function */
-    char    *upath,
-    struct vol  *vol,
-    int     did)
-/* The below code changes the way file ownership is determined in the name of
-   fixing dropboxes.  It has known security problem.  See the netatalk FAQ for
-   more information */
-{
-    struct stat st, sb;
-    struct dir  *dir;
-    char    *adpath;
-    uid_t       uid;
-    int         ret = AFP_OK;
-#ifdef DEBUG
-    LOG(log_debug9, logtype_afpd, "begin matchfile2dirperms:");
-#endif
-
-    if (stat(upath, &st ) < 0) {
-        LOG(log_error, logtype_afpd, "Could not stat %s: %s", upath, strerror(errno));
-        return AFPERR_NOOBJ ;
-    }
-
-    adpath = vol->vfs->ad_path( upath, ADFLAGS_HF );
-    /* FIXME dirsearch doesn't move cwd to did ! */
-    if (( dir = dirlookup( vol, did )) == NULL ) {
-        LOG(log_error, logtype_afpd, "matchfile2dirperms: Unable to get directory info.");
-        ret = AFPERR_NOOBJ;
-    }
-    else if (stat(".", &sb) < 0) {
-        LOG(log_error, logtype_afpd,
-            "matchfile2dirperms: Error checking directory \"%s\": %s",
-            dir->d_m_name, strerror(errno));
-        ret = AFPERR_NOOBJ;
-    }
-    else {
-        uid=geteuid();
-        if ( uid != sb.st_uid )
-        {
-            seteuid(0);
-            if (lchown(upath, sb.st_uid, sb.st_gid) < 0)
-            {
-                LOG(log_error, logtype_afpd,
-                    "matchfile2dirperms(%s): Error changing owner/gid: %s",
-                    upath, strerror(errno));
-                ret = AFPERR_ACCESS;
-            }
-            else if ((!S_ISLNK(st->st_mode)) && (chmod(upath,(st.st_mode&~default_options.umask)| S_IRGRP| S_IROTH) < 0))
-            {
-                LOG(log_error, logtype_afpd,
-                    "matchfile2dirperms(%s): Error adding file read permissions: %s",
-                    upath, strerror(errno));
-                ret = AFPERR_ACCESS;
-            }
-            else if (lchown(adpath, sb.st_uid, sb.st_gid) < 0)
-            {
-                LOG(log_error, logtype_afpd,
-                    "matchfile2dirperms(%s): Error changing AppleDouble owner/gid: %s",
-                    adpath, strerror(errno));
-                ret = AFPERR_ACCESS;
-            }
-            else if (chmod(adpath, (st.st_mode&~default_options.umask)| S_IRGRP| S_IROTH) < 0)
-            {
-                LOG(log_error, logtype_afpd,
-                    "matchfile2dirperms(%s):  Error adding AD file read permissions: %s",
-                    adpath, strerror(errno));
-                ret = AFPERR_ACCESS;
-            }
-            seteuid(uid);
-        }
-    } /* end else if stat success */
-
-#ifdef DEBUG
-    LOG(log_debug9, logtype_afpd, "end matchfile2dirperms:");
-#endif
-    return ret;
-}
-#endif
-
 int afp_getfildirparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen)
 {
     struct stat     *st;
@@ -649,9 +568,6 @@ int afp_moveandrename(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U
     int         plen;
     u_int16_t   vid;
     int         rc;
-#ifdef DROPKLUDGE
-    int     retvalue;
-#endif /* DROPKLUDGE */
     int     sdir_fd = -1;
 
 
@@ -740,23 +656,13 @@ int afp_moveandrename(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U
         }
         curdir->offcnt++;
         sdir->offcnt--;
-#ifdef DROPKLUDGE
-        if (vol->v_flags & AFPVOL_DROPBOX) {
-            /* FIXME did is not always the source id */
-            if ((retvalue=matchfile2dirperms (upath, vol, did)) != AFP_OK) {
-                rc = retvalue;
-                goto exit;
-            }
-        }
-        else
-#endif /* DROPKLUDGE */
-            /* if unix priv don't try to match perm with dest folder */
-            if (!isdir && !vol_unix_priv(vol)) {
-                int  admode = ad_mode("", 0777) | vol->v_fperm;
+        /* if unix priv don't try to match perm with dest folder */
+        if (!isdir && !vol_unix_priv(vol)) {
+            int  admode = ad_mode("", 0777) | vol->v_fperm;
 
-                setfilmode(upath, admode, NULL, vol->v_umask);
-                vol->vfs->vfs_setfilmode(vol, upath, admode, NULL);
-            }
+            setfilmode(upath, admode, NULL, vol->v_umask);
+            vol->vfs->vfs_setfilmode(vol, upath, admode, NULL);
+        }
         setvoltime(obj, vol );
     }
 
index eb18fd3373109d5c3b72fc1a8ea06e0f5b510cb8..0c9ccef9c3c6f5e318532cce3f653c0cbd425276 100644 (file)
 #include "desktop.h"
 #include "volume.h"
 
-#ifdef DEBUG1
-#define Debug(a) ((a)->options.flags & OPTION_DEBUG)
-#else
-#define Debug(a) (0)
-#endif
-
 #ifdef AFS
 struct ofork *writtenfork;
 #endif
@@ -918,7 +912,7 @@ static int read_fork(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, si
         /* due to the nature of afp packets, we have to exit if we get
            an error. we can't do this with translation on. */
 #ifdef WITH_SENDFILE
-        if (!(xlate || Debug(obj) )) {
+        if (!(xlate)) {
             int fd;
 
             fd = ad_readfile_init(ofork->of_ad, eid, &offset, 0);
@@ -945,12 +939,6 @@ static int read_fork(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, si
                 goto afp_read_exit;
 
             offset += *rbuflen;
-#ifdef DEBUG1
-            if (obj->options.flags & OPTION_DEBUG) {
-                printf( "(read) reply: %d, %d\n", *rbuflen, dsi->clientID);
-                bprint(rbuf, *rbuflen);
-            }
-#endif
             /* dsi_read() also returns buffer size of next allocation */
             cc = dsi_read(dsi, rbuf, *rbuflen); /* send it off */
             if (cc < 0)
@@ -1266,12 +1254,6 @@ static int write_fork(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, s
             return( AFPERR_PARAM );
         }
 
-#ifdef DEBUG1
-        if (obj->options.flags & OPTION_DEBUG) {
-            printf("(write) len: %d\n", *rbuflen);
-            bprint(rbuf, *rbuflen);
-        }
-#endif
         if ((cc = write_file(ofork, eid, offset, rbuf, *rbuflen,
                              xlate)) < 0) {
             *rbuflen = 0;
index 837cb98f75806b2c634ac79e789c802859a1fac0..d534ef5149c666fe5aeaf5f92edc08dcd20a34bb 100644 (file)
@@ -64,7 +64,6 @@ extern int          of_rename    (const struct vol *,
                                           struct dir *, const char *,
                                           struct dir *, const char *);
 extern int          of_flush     (const struct vol *);
-extern void         of_pforkdesc (FILE *);
 extern int          of_stat      (struct path *);
 extern int          of_statdir   (struct vol *vol, struct path *);
 extern int          of_closefork (struct ofork *ofork);
index ef77470a99b4939476cec125e7ece7e1b1d56235..af622f6a62fc56cd067447bfacd488f87b511e07 100644 (file)
 #define OPTION_ACL2MACCESS   (1 << 8)
 #define OPTION_NOZEROCONF    (1 << 9)
 
-#ifdef FORCE_UIDGID
-/* set up a structure for this */
-typedef struct uidgidset_t {
-    uid_t uid;
-    gid_t gid;
-} uidgidset;
-#endif /* FORCE_UIDGID */
-
 /* a couple of these options could get stuck in unions to save
  * space. */
 struct afp_volume_name {
@@ -108,10 +100,6 @@ typedef struct _AFPObj {
     struct session_info  sinfo;
     uid_t uid;         /* client running user id */
     int ipc_fd; /* anonymous PF_UNIX socket for IPC with afpd parent */
-#ifdef FORCE_UIDGID
-    int                 force_uid;
-    uidgidset          uidgid;
-#endif
 } AFPObj;
 
 /* typedef for AFP functions handlers */
index 0e4aeef28a6561e1e08bd00153fe36a17842ddc0..c3ca09c10cc5d4bc4df16c2e258e9524f0505ff4 100644 (file)
@@ -69,22 +69,6 @@ static void of_unhash(struct ofork *of)
     }
 }
 
-#ifdef DEBUG1
-void of_pforkdesc( FILE *f)
-{
-    int ofrefnum;
-
-    if (!oforks)
-        return;
-
-    for ( ofrefnum = 0; ofrefnum < nforks; ofrefnum++ ) {
-        if ( oforks[ ofrefnum ] != NULL ) {
-            fprintf( f, "%hu <%s>\n", ofrefnum, of_name(oforks[ ofrefnum ]));
-        }
-    }
-}
-#endif
-
 int of_flush(const struct vol *vol)
 {
     int refnum;
index 817ac6590802568e718675b67d954a052838a160..e26e6d1f1b50f702da0fb3ea0d9786937b275e99 100644 (file)
 #include "config.h"
 #endif /* HAVE_CONFIG_H */
 
-/* don't compile this file at all unless FORCE_UIDGID is set */
-#ifdef FORCE_UIDGID
-
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <atalk/logger.h>
-
-/* functions for username and group */
-#include <pwd.h>
-#include <grp.h>
-#include "uid.h"
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-extern uid_t    uuid; 
-
-void save_uidgid ( pair )
-uidgidset *pair;
-{
-    pair->uid = geteuid ();
-    pair->gid = getegid ();
-} 
-
-void restore_uidgid ( pair )
-uidgidset *pair;
-{
-    uid_t uid
-    gid_t gid;   
-    
-    uid = geteuid ();
-    gid = getegid ();
-
-    if (uid == pair->uid && gid == pair->gid)
-       return;
-
-    if (seteuid(0) < 0) {
-        LOG(log_error, logtype_afpd, "set_uidgid: Could not switch back to root: %s",
-                               strerror(errno));
-    }
-
-    if ( setegid ( pair->gid ) < 0 )
-        LOG(log_error, logtype_afpd, "restore_uidgid: unable to setegid '%s': %s",
-            pair->gid, strerror(errno) );
-
-    if ( seteuid ( pair->uid ) < 0 )
-        LOG(log_error, logtype_afpd, "restore_uidgid: unable to seteuid '%s': %s",
-            pair->uid, strerror(errno) );
-    else
-       uuid = pair->uid;       /* ugly hack for utommode */
-}
-
-void set_uidgid ( this_volume )
-const struct vol       *this_volume;
-{
-    int                uid, gid;   /* derived ones go in here */
-
-    /* check to see if we have to switch users */
-    uid = user_to_uid ( (this_volume)->v_forceuid);
-    gid = group_to_gid ( (this_volume)->v_forcegid);
-
-    if ((!uid || uid == geteuid()) && (!gid || gid == getegid()))
-       return;
-
-    if ( seteuid(0) < 0) {
-        LOG(log_error, logtype_afpd, "set_uidgid: Could not switch back to root: %s",
-                               strerror(errno));
-       return;
-    }
-
-    /* check to see if we have to switch groups */
-    if ( gid ) {
-        if ( setegid ( gid ) < 0 )
-            LOG(log_error, logtype_afpd, "set_uidgid: unable to setegid '%s': %s",
-                (this_volume)->v_forcegid, strerror(errno) );
-    } /* end of checking for (this_volume)->v_forcegid */
-
-    if ( uid) {
-        if ( seteuid ( uid ) < 0 )
-            LOG(log_error, logtype_afpd, "set_uidgid: unable to seteuid '%s': %s",
-                (this_volume)->v_forceuid, strerror(errno) );
-       else
-           uuid = uid; /* ugly hack for utommode */
-
-    } /* end of checking for (this_volume)->v_forceuid */
-
-} /* end function void set_uidgid ( username, group ) */
-
-int user_to_uid ( username )
-char   *username;
-{
-    struct passwd *this_passwd;
-
-    /* check for anything */
-    if ( !username || strlen ( username ) < 1 ) return 0;
-
-    /* grab the /etc/passwd record relating to username */
-    this_passwd = getpwnam ( username );
-
-    /* return false if there is no structure returned */
-    if (this_passwd == NULL) return 0;
-
-    /* return proper uid */
-    return this_passwd->pw_uid;
-
-} /* end function int user_to_uid ( username ) */
-
-int group_to_gid ( group )
-char   *group;
-{
-    struct group *this_group;
-
-    /* check for anything */
-    if ( !group || strlen ( group ) < 1 ) return 0;
-
-    /* grab the /etc/groups record relating to group */
-    this_group = getgrnam ( group );
-
-    /* return false if there is no structure returned */
-    if (this_group == NULL) return 0;
-
-    /* return proper gid */
-    return this_group->gr_gid;
-
-} /* end function int group_to_gid ( group ) */
-
-#endif /* FORCE_UIDGID */
index 7f00b20676a73bf74705a0e6cb4dc7d964d6c5e0..647cbd8d164a76182953c420c3650ae773f2a2a2 100644 (file)
@@ -6,20 +6,4 @@
 #ifndef AFPD_UID_H
 #define AFPD_UID_H 1
 
-#ifdef FORCE_UIDGID
-
-/* have to make sure struct vol is defined */
-#include "volume.h"
-
-/* functions to save and restore uid/gid pairs */
-extern void save_uidgid    ( uidgidset * );
-extern void restore_uidgid ( uidgidset * );
-extern void set_uidgid     ( const struct vol * );
-
-/* internal functions to convert user and group names to ids */
-extern int  user_to_uid  ( char * );
-extern int  group_to_gid ( char * );
-
-#endif /* FORCE_UIDGID */
-
 #endif
index b1ddfd919dd93c642b8390a1b84e044ca3ca7225..efc72923f6606a277674487317e702602f8b9d1d 100644 (file)
@@ -314,9 +314,6 @@ int setfilunixmode (const struct vol *vol, struct path* path, mode_t mode)
 /* --------------------- */
 int setdirunixmode(const struct vol *vol, const char *name, mode_t mode)
 {
-
-    int dropbox = (vol->v_flags & AFPVOL_DROPBOX);
-
     LOG(log_debug, logtype_afpd, "setdirunixmode('%s', mode:%04o) {v_dperm:%04o}",
         fullpathname(name), mode, vol->v_dperm);
 
@@ -324,14 +321,14 @@ int setdirunixmode(const struct vol *vol, const char *name, mode_t mode)
 
     if (dir_rx_set(mode)) {
        /* extending right? dir first then .AppleDouble in rf_setdirmode */
-       if ( stickydirmode(name, DIRBITS | mode, dropbox, vol->v_umask) < 0 )
+       if ( stickydirmode(name, DIRBITS | mode, 0, vol->v_umask) < 0 )
                return -1;
     }
     if (vol->vfs->vfs_setdirunixmode(vol, name, mode, NULL) < 0 && !vol_noadouble(vol)) {
         return  -1 ;
     }
     if (!dir_rx_set(mode)) {
-       if ( stickydirmode(name, DIRBITS | mode, dropbox, vol->v_umask) < 0 )
+       if ( stickydirmode(name, DIRBITS | mode, 0, vol->v_umask) < 0 )
             return -1;
     }
     return 0;
@@ -344,14 +341,13 @@ int setdirmode(const struct vol *vol, const char *name, mode_t mode)
     struct dirent      *dirp;
     DIR                        *dir;
     mode_t              hf_mode;
-    int                 dropbox = (vol->v_flags & AFPVOL_DROPBOX);
     
     mode |= vol->v_dperm;
     hf_mode = ad_hf_mode(mode);
 
     if (dir_rx_set(mode)) {
        /* extending right? dir first */
-       if ( stickydirmode(name, DIRBITS | mode, dropbox, vol->v_umask) < 0 )
+       if ( stickydirmode(name, DIRBITS | mode, 0, vol->v_umask) < 0 )
                return -1;
     }
     
@@ -384,7 +380,7 @@ int setdirmode(const struct vol *vol, const char *name, mode_t mode)
     }
 
     if (!dir_rx_set(mode)) {
-       if ( stickydirmode(name, DIRBITS | mode, dropbox, vol->v_umask) < 0 )
+       if ( stickydirmode(name, DIRBITS | mode, 0, vol->v_umask) < 0 )
                return -1;
     }
     return( 0 );
index 8c0e646a6489ce932eda5053489b5581b84a318b..76c6f5d244452f129b3eae6c1198e5532bec2418 100644 (file)
@@ -96,15 +96,7 @@ static void             free_extmap(void);
 #define VOLOPT_MACCHARSET    16
 #define VOLOPT_CNIDSCHEME    17
 #define VOLOPT_ADOUBLE       18  /* adouble version */
-
-#ifdef FORCE_UIDGID
-#warning UIDGID
-#include "uid.h"
-
-#define VOLOPT_FORCEUID      19  /* force uid for username x */
-#define VOLOPT_FORCEGID      20  /* force gid for group x */
-#endif /* FORCE_UIDGID */
-
+/* Usable slot: 19/20 */
 #define VOLOPT_UMASK         21
 #define VOLOPT_ALLOWED_HOSTS 22
 #define VOLOPT_DENIED_HOSTS  23
@@ -453,11 +445,6 @@ static void volset(struct vol_option *options, struct vol_option *save,
                 options[VOLOPT_FLAGS].i_value |= AFPVOL_USEDOTS | AFPVOL_INV_DOTS;
             else if (strcasecmp(p, "limitsize") == 0)
                 options[VOLOPT_FLAGS].i_value |= AFPVOL_LIMITSIZE;
-            /* support for either "dropbox" or "dropkludge" */
-            else if (strcasecmp(p, "dropbox") == 0)
-                options[VOLOPT_FLAGS].i_value |= AFPVOL_DROPBOX;
-            else if (strcasecmp(p, "dropkludge") == 0)
-                options[VOLOPT_FLAGS].i_value |= AFPVOL_DROPBOX;
             else if (strcasecmp(p, "nofileid") == 0)
                 options[VOLOPT_FLAGS].i_value |= AFPVOL_NOFILEID;
             else if (strcasecmp(p, "nostat") == 0)
@@ -513,16 +500,6 @@ static void volset(struct vol_option *options, struct vol_option *save,
         options[VOLOPT_DFLTPERM].i_value = (int)strtol(val+1, NULL, 8);
     } else if (optionok(tmp, "password:", val)) {
         setoption(options, save, VOLOPT_PASSWORD, val);
-
-#ifdef FORCE_UIDGID
-
-        /* this code allows forced uid/gid per volume settings */
-    } else if (optionok(tmp, "forceuid:", val)) {
-        setoption(options, save, VOLOPT_FORCEUID, val);
-    } else if (optionok(tmp, "forcegid:", val)) {
-        setoption(options, save, VOLOPT_FORCEGID, val);
-
-#endif /* FORCE_UIDGID */
     } else if (optionok(tmp, "root_preexec:", val)) {
         setoption(options, save, VOLOPT_ROOTPREEXEC, val);
 
@@ -801,19 +778,6 @@ static int creatvol(AFPObj *obj, struct passwd *pwd,
         if ((volume->v_flags & AFPVOL_EILSEQ))
             volume->v_utom_flags |= CONV__EILSEQ;
 
-#ifdef FORCE_UIDGID
-        if (options[VOLOPT_FORCEUID].c_value) {
-            volume->v_forceuid = strdup(options[VOLOPT_FORCEUID].c_value);
-        } else {
-            volume->v_forceuid = NULL; /* set as null so as to return 0 later on */
-        }
-
-        if (options[VOLOPT_FORCEGID].c_value) {
-            volume->v_forcegid = strdup(options[VOLOPT_FORCEGID].c_value);
-        } else {
-            volume->v_forcegid = NULL; /* set as null so as to return 0 later on */
-        }
-#endif
         if (!user) {
             if (options[VOLOPT_PREEXEC].c_value)
                 volume->v_preexec = volxlate(obj, NULL, MAXPATHLEN, options[VOLOPT_PREEXEC].c_value, pwd, path, name);
@@ -1312,10 +1276,6 @@ static void volume_free(struct vol *vol)
     free(vol->v_cnidscheme);
     free(vol->v_dbpath);
     free(vol->v_gvs);
-#ifdef FORCE_UIDGID
-    free(vol->v_forceuid);
-    free(vol->v_forcegid);
-#endif /* FORCE_UIDGID */
     if (vol->v_uuid)
         free(vol->v_uuid);
 }
@@ -1602,21 +1562,13 @@ static int getvolparams( u_int16_t bitmap, struct vol *vol, struct stat *st, cha
 #ifndef NO_LARGE_VOL_SUPPORT
         case VOLPBIT_XBFREE :
             xbfree = hton64( xbfree );
-#if defined(__GNUC__) && defined(HAVE_GCC_MEMCPY_BUG)
-            bcopy(&xbfree, data, sizeof(xbfree));
-#else /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
             memcpy(data, &xbfree, sizeof( xbfree ));
-#endif /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
             data += sizeof( xbfree );
             break;
 
         case VOLPBIT_XBTOTAL :
             xbtotal = hton64( xbtotal );
-#if defined(__GNUC__) && defined(HAVE_GCC_MEMCPY_BUG)
-            bcopy(&xbtotal, data, sizeof(xbtotal));
-#else /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
             memcpy(data, &xbtotal, sizeof( xbtotal ));
-#endif /* __GNUC__ && HAVE_GCC_MEMCPY_BUG */
             data += sizeof( xbfree );
             break;
 #endif /* ! NO_LARGE_VOL_SUPPORT */
@@ -2058,9 +2010,6 @@ int afp_openvol(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t
 
     if (( volume->v_flags & AFPVOL_OPEN  ) ) {
         /* the volume is already open */
-#ifdef FORCE_UIDGID
-        set_uidgid ( volume );
-#endif
         return stat_vol(bitmap, volume, rbuf, rbuflen);
     }
 
@@ -2071,10 +2020,6 @@ int afp_openvol(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t
         }
     }
 
-#ifdef FORCE_UIDGID
-    set_uidgid ( volume );
-#endif
-
     if (volume->v_preexec) {
         if ((ret = afprun(0, volume->v_preexec, NULL)) && volume->v_preexec_close) {
             LOG(log_error, logtype_afpd, "afp_openvol(%s): preexec : %d", volume->v_path, ret );
@@ -2319,10 +2264,6 @@ struct vol *getvolbyvid(const u_int16_t vid )
         return( NULL );
     }
 
-#ifdef FORCE_UIDGID
-    set_uidgid ( vol );
-#endif /* FORCE_UIDGID */
-
     current_vol = vol;
 
     return( vol );
index 0560f5f79a065036473eeb873ba8006a6bf57b31..76714e1522addfd13b7573c751d71494b7392e34 100644 (file)
@@ -93,7 +93,7 @@ static void log_status( char *s, OM_uint32 major_status,
 
 static void log_ctx_flags( OM_uint32 flags )
 {
-#ifdef DEBUG1
+#ifdef DEBUG
     if (flags & GSS_C_DELEG_FLAG)
         LOG(log_debug, logtype_uams, "uams_gss.c :context flag: GSS_C_DELEG_FLAG" );
     if (flags & GSS_C_MUTUAL_FLAG)
index 5c427c40c21df40e35b70b869339c0c62759566d..f90c3ff8b8e4a9420f832946ffd2a6a917e8bee5 100644 (file)
@@ -13,6 +13,6 @@
 #include <sys/types.h>
 #include <inttypes.h>
 
-extern int locktable_init(void);
+extern int locktable_init(const char *path);
 
 #endif  /* ATALK_LOCKING_H */
index c9e946a8855557a375fa755fe30b5e7b4e541e08..789649a1a6ded108932ddd9d90f52b0be10a4b14 100644 (file)
@@ -30,7 +30,8 @@
 extern "C" {
 #endif
 
-#include "signal.h"
+#include <sys/types.h>
+#include <signal.h>
 
 /* flags to tdb_store() */
 #define TDB_REPLACE 1          /* Unused */
index 7fe326db1e57a3cb9487c2ac49beaad50b0a4afa..842b705d501ba7ce2bcbfcb93346aac87348b310 100644 (file)
@@ -83,10 +83,6 @@ struct vol {
     int             v_root_preexec_close;
     int             v_preexec_close;
     char            *v_uuid;    /* For TimeMachine zeroconf record */
-#ifdef FORCE_UIDGID
-    char            *v_forceuid;
-    char            *v_forcegid;
-#endif
 #ifdef __svr4__
     int         v_qfd;
 #endif /*__svr4__*/
@@ -115,7 +111,6 @@ struct vol {
 #define AFPVOL_USEDOTS   (1 << 11)  /* use real dots */
 #define AFPVOL_LIMITSIZE (1 << 12)  /* limit size for older macs */
 #define AFPVOL_MAPASCII  (1 << 13)  /* map the ascii range as well */
-#define AFPVOL_DROPBOX   (1 << 14)  /* dropkludge dropbox support */
 #define AFPVOL_NOFILEID  (1 << 15)  /* don't advertise createid resolveid and deleteid calls */
 #define AFPVOL_NOSTAT    (1 << 16)  /* advertise the volume even if we can't stat() it
                                      * maybe because it will be mounted later in preexec */
index 40ffd1407a2eb8a100bdb74269f194113aa604fd..6fab902858965091b11528fa704d38de48f86e1d 100644 (file)
 ((type) == ADLOCK_WR ? LOCK_EX : \
  ((type) == ADLOCK_CLR ? LOCK_UN : -1)))
 
-#ifdef DISABLE_LOCKING
-#define fcntl(a, b, c ) (0)
-#endif
-
 /* ----------------------- */
 static int set_lock(int fd, int cmd,  struct flock *lock)
 {
index 8d2fda63c066cfe259b3c1218e93d0daafca5f19..bf9c4632ace3610a4f97867e4e2380819d339d94 100644 (file)
@@ -1,5 +1,6 @@
 # Makefile.am for libatalk/locking/
 
 noinst_LTLIBRARIES = liblocking.la
+noinst_HEADERS = smb_share_modes.h
 
-liblocking_la_SOURCES = locking.c
+liblocking_la_SOURCES = locking.c smb_share_modes.c
index c19f27cdd9214112b32c71a9fdda13ddd2f550a0..1511c5d8fba1e08918c18d39393e6a4dc379e54e 100644 (file)
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
-#include <pthread.h>
+#include <unistd.h>
 
 #include <atalk/logger.h>
 #include <atalk/errchk.h>
 #include <atalk/locking.h>
 #include <atalk/cnid.h>
-#define AFP_LOCKTABLE_SIZE (8*1024*1024)
+#include <atalk/paths.h>
+
+#include "smb_share_modes.h"
+
+/***************************************************************************
+ * structures and defines
+ ***************************************************************************/
+
+#define LOCKTABLE_PATH         "/tmp/netatalk-afp-locks.tdb" 
 
 /* 
  * Struct for building the the main database of file locks.
  * vid + cnid build the primary key for database access.
  */
-struct afp_lock {
+typedef struct afp_lock {
     /* Keys */
-    uint32_t vid;
-    cnid_t cnid;
+    uint32_t l_vid;
+    cnid_t   l_cnid;
+    uint64_t l_dev;
+    uint64_t l_ino;
+
+    /* pid holding the lock, also secondary key */
+    pid_t    l_pid;
 
     /* Refcounting access and deny modes */
-    uint16_t amode_r;
-    uint16_t amode_w;
-    uint16_t dmode_r;
-    uint16_t dmode_w;
-};
+    uint16_t l_amode_r;
+    uint16_t l_amode_w;
+    uint16_t l_dmode_r;
+    uint16_t l_dmode_w;
+} afp_lock_t;
 
-/* 
- * Structure for building a table which provides the way to find locks by pid
- */
-struct pid_lock {
-    /* Key */
-    pid_t pid;
+#define PACKED_AFP_LOCK_SIZE                 \
+    sizeof(((afp_lock_t *)0)->l_vid) +       \
+    sizeof(((afp_lock_t *)0)->l_cnid) +      \
+    sizeof(((afp_lock_t *)0)->l_dev) +       \
+    sizeof(((afp_lock_t *)0)->l_ino) +       \
+    sizeof(((afp_lock_t *)0)->l_pid) +       \
+    sizeof(((afp_lock_t *)0)->l_amode_r) +   \
+    sizeof(((afp_lock_t *)0)->l_amode_w) +   \
+    sizeof(((afp_lock_t *)0)->l_dmode_r) +   \
+    sizeof(((afp_lock_t *)0)->l_dmode_r)
 
-    /* Key for afp_lock */
-    uint32_t vid;
-    cnid_t cnid;
-};
+/***************************************************************************
+ * Data
+ ***************************************************************************/
+
+static struct smbdb_ctx *tdb;
 
 /***************************************************************************
- * Public functios
+ * Private functions
  ***************************************************************************/
 
-int locktable_init(void)
+/***************************************************************************
+ * Public functions
+ ***************************************************************************/
+
+/*!
+ * Open locktable from path
+ */
+int locktable_init(const char *path)
 {
     EC_INIT;
 
+    EC_NULL_LOG(tdb = smb_share_mode_db_open(path));
 
 EC_CLEANUP:
     EC_EXIT;
index 7841f6a4045566442366271bdb483173eb094a7c..87b5746f091df9dbfde1d3e1687120be332d309e 100644 (file)
@@ -2,7 +2,7 @@
 #include "config.h"
 #endif
 
-#ifdef DEBUG1
+#ifdef DEBUG
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index 9096412d8b250dec6631e43e41ae45e42cf55b62..103a420b90b6756c3db35cf4804c293805eb61c4 100644 (file)
@@ -50,7 +50,6 @@ static const vol_opt_name_t vol_opt_names[] = {
     {AFPVOL_USEDOTS,    "USEDOTS"},     /* use real dots */
     {AFPVOL_LIMITSIZE,  "LIMITSIZE"},   /* limit size for older macs */
     {AFPVOL_MAPASCII,   "MAPASCII"},    /* map the ascii range as well */
-    {AFPVOL_DROPBOX,    "DROPBOX"},     /* dropkludge dropbox support */
     {AFPVOL_NOFILEID,   "NOFILEID"},    /* don't advertise createid resolveid and deleteid calls */
     {AFPVOL_NOSTAT,     "NOSTAT"},      /* advertise the volume even if we can't stat() it
                                          * maybe because it will be mounted later in preexec */
index a43794e139550b0a6513602e3b7d82684eb78874..91d7c5586c4aeccb4a4de8df083aad88800eac40 100644 (file)
@@ -32,29 +32,6 @@ int stickydirmode(const char *name, const mode_t mode, const int dropbox, const
 {
     int retval = 0;
 
-#ifdef DROPKLUDGE
-    /* Turn on the sticky bit if this is a drop box, also turn off the setgid bit */
-    if ((dropbox & AFPVOL_DROPBOX)) {
-        int uid;
-
-        if ( ( (mode & S_IWOTH) && !(mode & S_IROTH)) ||
-             ( (mode & S_IWGRP) && !(mode & S_IRGRP)) )
-        {
-            uid=geteuid();
-            if ( seteuid(0) < 0) {
-                LOG(log_error, logtype_afpd, "stickydirmode: unable to seteuid root: %s", strerror(errno));
-            }
-            if ( (retval=chmod( name, ( (DIRBITS | mode | S_ISVTX) & ~v_umask) )) < 0) {
-                LOG(log_error, logtype_afpd, "stickydirmode: chmod \"%s\": %s", fullpathname(name), strerror(errno) );
-            } else {
-                LOG(log_debug, logtype_afpd, "stickydirmode: chmod \"%s\": %s", fullpathname(name), strerror(retval) );
-            }
-            seteuid(uid);
-            return retval;
-        }
-    }
-#endif /* DROPKLUDGE */
-
     /*
      *  Ignore EPERM errors:  We may be dealing with a directory that is
      *  group writable, in which case chmod will fail.
diff --git a/macros/cups.m4 b/macros/cups.m4
deleted file mode 100644 (file)
index 5507aa4..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-dnl $Id: cups.m4,v 1.3 2010-04-12 14:28:47 franklahm Exp $
-dnl Autoconf macros to check for CUPS
-
-AC_DEFUN([NETATALK_AC_CUPS], [
-
-       dnl Don't use spool unless it's needed
-       spool_required=no
-       netatalk_cv_use_cups=no
-
-       AC_ARG_ENABLE(cups,
-       [  --enable-cups           Turn on CUPS support (default=auto)])
-
-       if test x$enable_cups != xno; then
-               AC_PATH_PROG(CUPS_CONFIG, cups-config)
-
-               if test "x$CUPS_CONFIG" != x; then
-                       AC_DEFINE(HAVE_CUPS, 1, [Define to enable CUPS Support])
-                       CUPS_CFLAGS="`$CUPS_CONFIG --cflags`"
-                       CUPS_LDFLAGS="`$CUPS_CONFIG --ldflags`"
-                       CUPS_LIBS="`$CUPS_CONFIG --libs`"
-                       CUPS_VERSION="`$CUPS_CONFIG --version`"
-                       AC_DEFINE_UNQUOTED(CUPS_API_VERSION, "`$CUPS_CONFIG --api-version`", [CUPS API Version])
-                       AC_SUBST(CUPS_CFLAGS)
-                       AC_SUBST(CUPS_LDFLAGS)
-                       AC_SUBST(CUPS_LIBS)
-       
-                       AC_MSG_CHECKING([CUPS version])
-                       AC_MSG_RESULT([$CUPS_VERSION])
-                       netatalk_cv_use_cups=yes
-       
-                       if test x"$netatalk_cv_HAVE_USABLE_ICONV" = x"no" ; then
-                               AC_WARN([*** Warning: iconv not found on your system, using simple ascii mapping***])
-                       fi
-                       spool_required="yes"
-               elif test x"$enable_cups" = "xyes"; then
-                       AC_MSG_ERROR([*** CUPS not found. You might need to specify the path to cups-config ***])
-               fi
-       fi
-
-       AC_MSG_CHECKING([whether CUPS support can be enabled])
-       AC_MSG_RESULT([$netatalk_cv_use_cups])
-
-
-       AC_ARG_WITH(spooldir,
-               [  --with-spooldir=PATH     path for spooldir used for CUPS support (LOCALSTATEDIR/spool/netatalk)],[
-
-               if test "$withval" = "no"; then
-                      if test x"$spool_required" = x"yes"; then
-                              AC_MSG_ERROR([*** CUPS support requires a spooldir ***])
-                      else
-                              AC_DEFINE(DISABLE_SPOOL, 1, [Define to enable spooldir support])
-                              AC_MSG_RESULT([spool disabled])
-                               fi
-               elif test "$withval" != "yes"; then
-                       SPOOLDIR="$withval"
-                       AC_MSG_RESULT([spooldir set to $withval])
-               else
-                       SPOOLDIR="${localstatedir}/spool/netatalk"
-                       AC_MSG_RESULT([spool set to default])
-               fi
-       ],[
-               SPOOLDIR="${localstatedir}/spool/netatalk"
-       ])
-
-       AM_CONDITIONAL(USE_SPOOLDIR, test x"$spool_required" = x"yes")
-       AC_SUBST(SPOOLDIR)
-])
index 4fe3fe2a3e0b751178aab601c53228751a14f1f9..99f24f4b99ea2190701e4299b42b06c166269235 100644 (file)
@@ -1,8 +1,6 @@
 dnl Check for optional server location protocol support (used by MacOS X)
 
-dnl $Id: srvloc.m4,v 1.10 2009-12-13 11:58:30 franklahm Exp $
-
-AC_DEFUN([NETATALK_SRVLOC], [
+AC_DEFUN([AC_NETATALK_SRVLOC], [
 
        SLP_LIBS=""
        SLP_CFLAGS=""
index d770f049d1ea58ef1a0ed7e1481aae68bc562648..55b0f8c179428c464634cd6f5aa601b6f6521a9f 100644 (file)
@@ -1,6 +1,6 @@
 dnl $Id: tcp-wrappers.m4,v 1.4 2008-08-11 20:44:03 didg Exp $
 
-AC_DEFUN([NETATALK_TCP_WRAPPERS], [
+AC_DEFUN([AC_NETATALK_TCP_WRAPPERS], [
        check=maybe
        AC_ARG_ENABLE(tcp-wrappers,
                [  --disable-tcp-wrappers  disable TCP wrappers support],
index 788a193038fb217369d203bf581febb6766c4d11..0209dc0936e303cbd6c08dfef646a665f98a00d4 100644 (file)
@@ -1,6 +1,6 @@
 dnl Check for optional Zeroconf support
 
-AC_DEFUN([NETATALK_ZEROCONF], [
+AC_DEFUN([AC_NETATALK_ZEROCONF], [
        ZEROCONF_LIBS=""
        ZEROCONF_CFLAGS=""
        found_zeroconf=no
diff --git a/sys/netatalk/endian.h b/sys/netatalk/endian.h
deleted file mode 100644 (file)
index a216e60..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * $Id: endian.h,v 1.9 2009-01-06 20:05:00 morgana Exp $
- *
- * Copyright (c) 1990,1991 Regents of The University of Michigan.
- * All Rights Reserved. See COPYRIGHT.
- *
- * This file handles both byte ordering and integer sizes.
- */
-
-#ifndef _ATALK_ENDIAN_H_
-#define _ATALK_ENDIAN_H_
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H */
-
-#include <sys/types.h>
-#include <netinet/in.h>
-
-#ifdef _IBMR2
-#include <sys/machine.h>
-#endif /*_IBMR2*/
-
-#ifdef _ISOC9X_SOURCE
-#include <inttypes.h>
-#ifndef __BIT_TYPES_DEFINED__
-#define __BIT_TYPES_DEFINED__
-typedef uint8_t        u_int8_t;
-typedef uint16_t       u_int16_t;
-typedef uint32_t       u_int32_t;
-typedef uint64_t       u_int64_t;
-#endif /* ! __BIT_TYPES_DEFINED__ */
-#else
-
-/* handle sunos and solaris */
-#ifdef sun
-#ifdef BSD4_3
-#include <sys/bitypes.h>
-#else /* BSD4_3 */
-/* solaris and sunos don't consistently define u_int*_t. */
-typedef unsigned char      u_int8_t;
-typedef unsigned short     u_int16_t;
-typedef unsigned int       u_int32_t;
-typedef int                int32_t;
-#endif /* BSD4_3 */
-
-typedef unsigned long long u_int64_t;
-
-#ifndef _SSIZE_T
-#define _SSIZE_T
-typedef int ssize_t;
-#endif /* ssize_t */
-
-#else /* sun */
-
-/* luckily ultrix is dead. as a result, we know what the sizes of
- * various types are forever. this makes some assumptions about integer
- * sizes. */
-#if defined (ultrix) || defined(HAVE_32BIT_LONGS) || defined(HAVE_64BIT_LONGS)
-#ifndef __BIT_TYPES_DEFINED__
-#define __BIT_TYPES_DEFINED__
-typedef unsigned char  u_int8_t;
-typedef unsigned short u_int16_t;
-typedef unsigned int   u_int32_t;
-typedef int            int32_t;
-#endif
-#endif /* ultrix || HAVE_32BIT_LONGS || HAVE_64BIT_LONGS */
-
-#ifdef ultrix
-typedef int            ssize_t;
-#endif /* ultrix */
-
-#ifdef HAVE_64BIT_LONGS
-typedef unsigned long u_int64_t;
-#else /* HAVE_64BIT_LONGS */
-/* check for long long support. currently, i assume that if 64-bit
- * ints exist that their made available via long long */
-#ifdef linux
-#include <endian.h> /* i think this is here for libc4 */
-#else /* linux */
-#if defined(HAVE_32BIT_LONGS) && !(defined(BSD4_4) || \
-                                 defined(NO_LARGE_VOL_SUPPORT))
-typedef unsigned long long  u_int64_t;
-#endif /* HAVE_32BIT_LONGS || !BSD4_4 || NO_LARGE_VOL_SUPPORT */
-#endif /* linux */
-#endif /* HAVE_64BIT_LONGS */
-#endif /* sun */
-#endif /* ISOC9X */
-
-# ifndef BYTE_ORDER
-#define LITTLE_ENDIAN  1234
-#define BIG_ENDIAN     4321
-#define PDP_ENDIAN     3412
-
-
-#if defined(WORDS_BIGENDIAN) || defined(_BIG_ENDIAN)
-#define BYTE_ORDER     BIG_ENDIAN
-#else
-#define BYTE_ORDER     LITTLE_ENDIAN
-#endif /* WORDS_BIGENDIAN */
-
-# ifndef ntohl
-# if defined( sun ) || defined( ultrix ) || defined( _IBMR2 )
-#if BYTE_ORDER == BIG_ENDIAN
-#define ntohl(x)       (x)
-#define ntohs(x)       (x)
-#define htonl(x)       (x)
-#define htons(x)       (x)
-
-#else /* BYTE_ORDER == BIG_ENDIAN */
-#if defined( mips ) && defined( KERNEL )
-#define        ntohl(x)        nuxi_l(x)
-#define        ntohs(x)        nuxi_s(x)
-#define        htonl(x)        nuxi_l(x)
-#define        htons(x)        nuxi_s(x)
-
-#else /* mips && KERNEL */
-
-#if !( defined( sun ) && ( defined( i386 ) || defined(__x86_64) ) )
-unsigned short ntohs(), htons();
-unsigned int  ntohl(), htonl();
-#endif /* ! ( sun && i386 ) */
-
-#endif /* mips && KERNEL */
-#endif /* BYTE_ORDER == BIGENDIAN*/
-# endif /* sun ultrix _IBMR2 */
-# endif /* ntohl */
-#endif /* BYTE_ORDER */
-
-#endif /* _ATALK_ENDIAN_H_ */
-