-dnl $Id: configure.in,v 1.240 2010-03-29 15:22:57 franklahm Exp $
+dnl $Id: configure.in,v 1.241 2010-04-03 07:11:33 franklahm Exp $
dnl configure.in for netatalk
AC_INIT(etc/afpd/main.c)
AC_FUNC_UTIME_NULL
AC_FUNC_WAIT3
AC_CHECK_FUNCS(getcwd gethostname gettimeofday getusershell mkdir rmdir select socket strdup strcasestr strstr strtoul strchr memcpy)
-AC_CHECK_FUNCS(backtrace_symbols setlocale nl_langinfo)
+AC_CHECK_FUNCS(backtrace_symbols setlocale nl_langinfo strlcpy strlcat setlinebuf dirfd pselect)
AC_CHECK_FUNCS(waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
-AC_CHECK_FUNCS(strlcpy strlcat setlinebuf dirfd)
AC_CHECK_FUNC(renameat, AC_DEFINE([_ATFILE_SOURCE], 1, AT file source))
AC_CHECK_MEMBERS(struct tm.tm_gmtoff,,, [#include <time.h>])
AC_CACHE_SAVE
## /usr/etc/modload -sym :ETCDIR:/netatalk.o;
##fi
+netatalk_conf=":ETCDIR:/netatalk.conf"
+
+[ -f ${netatalk_conf} ] && . ${netatalk_conf}
+
echo -n 'starting netatalk daemons:'
+if [ X"${ATALKD_RUN}" != X"no" ]; then
if [ -x :SBINDIR:/atalkd ]; then
:SBINDIR:/atalkd; echo -n ' atalkd'
fi
:BINDIR:/nbprgstr -p 4 `hostname|sed 's/\..*$//'`:netatalk
echo -n ' nbprgstr'
fi
+fi
-if [ -x :SBINDIR:/papd ]; then
+if [ -x :SBINDIR:/papd -a X"${PAPD_RUN}" != X"no" ]; then
:SBINDIR:/papd; echo -n ' papd'
fi
-if [ -x :SBINDIR:/cnid_metad ]; then
+if [ -x :SBINDIR:/cnid_metad -a X"${CNID_METAD_RUN}" != X"no" ]; then
:SBINDIR:/cnid_metad $CNID_CONFIG
echo -n ' cnid_metad'
fi
-if [ -x :SBINDIR:/afpd ]; then
+if [ -x :SBINDIR:/afpd -a X"${AFPD_RUN}" != X"no" ]; then
:SBINDIR:/afpd; echo -n ' afpd'
fi
-if [ -x :SBINDIR:/timelord ]; then
+if [ -x :SBINDIR:/timelord -a X"${TIMELORD_RUN}" != X"no" ]; then
:SBINDIR:/timelord; echo -n ' timelord'
fi
/*
- * $Id: quota.c,v 1.34 2010-02-10 14:05:37 franklahm Exp $
+ * $Id: quota.c,v 1.35 2010-04-03 07:11:35 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#include <atalk/logger.h>
#include <atalk/afp.h>
+#include <atalk/compat.h>
#include "auth.h"
#include "volume.h"
#ifndef HAVE_VSNPRINTF
int vsnprintf(char *str, size_t count, const char *fmt, va_list args);
#endif
+
+/* OpenBSD */
+#if defined(__OpenBSD__) && !defined(ENOTSUP)
+#define ENOTSUP EOPNOTSUPP
+#endif
+
+#if !defined(HAVE_PSELECT) || defined(__OpenBSD__)
+extern int pselect(int, fd_set * restrict, fd_set * restrict,
+ fd_set * restrict, const struct timespec * restrict,
+ const sigset_t * restrict);
+#endif
#include <atalk/server_child.h>
#include <netatalk/endian.h>
+#ifdef __OpenBSD__
+#include <sys/socket.h>
+#endif
+
/* What a DSI packet looks like:
0 32
|-------------------------------|
strdup.c \
inet_aton.c \
rquota_xdr.c \
+ pselect.c \
snprintf.c
--- /dev/null
+/*
+ * Copyright 2000 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* $FreeBSD: src/lib/libc/gen/pselect.c,v 1.6 2002/10/12 16:13:37 mike Exp $ */
+/* modified for OpenBSD by Masahito Yamaga (2010-02-02) */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#if !defined(HAVE_PSELECT) || defined(__OpenBSD__)
+
+#include <sys/select.h>
+#include <sys/time.h>
+#include <errno.h>
+#include <signal.h>
+
+/*
+ * Emulate the POSIX 1003.1g-2000 `pselect' interface. This is the
+ * same as the traditional BSD `select' function, except that it uses
+ * a timespec rather than a timeval, doesn't modify the timeout argument,
+ * and allows the user to specify a signal mask to apply during the select.
+ */
+int
+pselect(int count, fd_set * restrict rfds, fd_set * restrict wfds,
+ fd_set * restrict efds, const struct timespec * restrict timo,
+ const sigset_t * restrict mask)
+{
+ sigset_t omask;
+ struct timeval tvtimo, *tvp;
+ int rv, sverrno;
+
+ if (timo) {
+ TIMESPEC_TO_TIMEVAL(&tvtimo, timo);
+ tvp = &tvtimo;
+ } else
+ tvp = 0;
+
+ if (mask != 0) {
+ rv = sigprocmask(SIG_SETMASK, mask, &omask);
+ if (rv != 0)
+ return rv;
+ }
+
+ rv = select(count, rfds, wfds, efds, tvp);
+ if (mask != 0) {
+ sverrno = errno;
+ sigprocmask(SIG_SETMASK, &omask, (sigset_t *)0);
+ errno = sverrno;
+ }
+
+ return rv;
+}
+
+#endif /* not HAVE_PSELECT || __OpenBSD__ */
/*
- $Id: ea_sys.c,v 1.6 2010-03-12 15:16:49 franklahm Exp $
+ $Id: ea_sys.c,v 1.7 2010-04-03 07:11:36 franklahm Exp $
Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
#include <atalk/vfs.h>
#include <atalk/util.h>
#include <atalk/unix.h>
+#include <atalk/compat.h>
#ifndef ENOATTR
#define ENOATTR ENODATA
-dnl $Id: db3-check.m4,v 1.21 2009-12-13 11:59:11 franklahm Exp $
+dnl $Id: db3-check.m4,v 1.22 2010-04-03 07:11:36 franklahm Exp $
dnl Autoconf macros to check for the Berkeley DB library
dnl -- check header for minimum version and return version in
atalk_cv_bdb_version=no
maj=$atalk_cv_bdb_MAJOR
min=$atalk_cv_bdb_MINOR
- atalk_cv_bdb_try_libs="db$maj$min db$maj.$min db-$maj$min db-$maj.$min"
+ atalk_cv_bdb_try_libs="db$maj$min db$maj.$min db-$maj$min db-$maj.$min db"
for lib in $atalk_cv_bdb_try_libs ; do
LIBS="-l$lib $savedlibs"