# Makefile.am for bin/misc
-bin_PROGRAMS = netacnv
+pkgconfdir = @PKGCONFDIR@
+bin_PROGRAMS =
+noinst_PROGRAMS = netacnv
netacnv_SOURCES = netacnv.c
netacnv_LDADD = $(top_builddir)/libatalk/libatalk.la
-pkgconfdir = @PKGCONFDIR@
-if USE_NFSv4_ACLS
+if HAVE_ACLS
bin_PROGRAMS += afpldaptest
-
afpldaptest_SOURCES = uuidtest.c
+afpldaptest_CFLAGS = -D_PATH_ACL_LDAPCONF=\"$(pkgconfdir)/afp_ldap.conf\"
afpldaptest_LDADD = $(top_builddir)/libatalk/libatalk.la
-
-AM_CFLAGS = -D_PATH_ACL_LDAPCONF=\"$(pkgconfdir)/afp_ldap.conf\"
endif
#include "config.h"
#endif /* HAVE_CONFIG_H */
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
#include <unistd.h>
#include <stdlib.h>
return 0;
}
-#endif /* HAVE_NFSv4_ACLS */
+#endif /* HAVE_ACLS */
TMPLFILES = afpd.conf.tmpl AppleVolumes.default.tmpl
CONFFILES = AppleVolumes.system netatalk.conf
-if USE_NFSv4_ACLS
+if HAVE_ACLS
CONFFILES += afp_ldap.conf
endif
AC_MSG_RESULT([$OVERWRITE_CONFIG])
dnl --------------------- check for ACL support
-neta_cv_nfsv4acl="no"
-AC_MSG_CHECKING([if NFSv4 ACL Support should be enabled])
-AC_ARG_ENABLE(nfsv4acls,
- [ --enable-nfsv4acls enable NFSv4 ACL Support],[
- if test x"$enableval" = x"yes"; then
- AC_MSG_RESULT([yes])
- neta_cv_nfsv4acl="yes"
- else
- AC_MSG_RESULT([no])
- fi],[
- AC_MSG_RESULT([no])
- ]
-)
-if test x$neta_cv_nfsv4acl = xyes; then
- AC_CHECK_HEADER([ldap.h],,[
- AC_MSG_ERROR([ACL Support need the LDAP client headers not found.])
- neta_cv_nfsv4acl=no
- ]
- )
- AC_CHECK_LIB(ldap,ldap_init,neta_cv_nfsv4acl=yes,neta_cv_nfsv4acl=no)
+AC_MSG_CHECKING(whether to support ACLs)
+AC_ARG_WITH(acl-support,
+ [AS_HELP_STRING([--with-acl-support],
+ [Include ACL support (default=auto)])],
+ [ case "$withval" in
+ yes|no)
+ with_acl_support="$withval"
+ ;;
+ *)
+ with_acl_support=auto
+ ;;
+ esac ],
+ [with_acl_support=auto])
+AC_MSG_RESULT($with_acl_support)
+
+if test x"$with_acl_support" = x"no"; then
+ AC_MSG_RESULT(Disabling ACL support)
+ AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
+else
+ with_acl_support=yes
+ AC_MSG_NOTICE([ACL support requires LDAP support, checking whether that's available])
+ AC_CHECK_HEADER([ldap.h],,
+ [AC_MSG_ERROR([ACL Support prerequisite LDAP client headers not found.])
+ with_acl_support=no])
+
+ AC_CHECK_LIB(ldap, ldap_init,,
+ [AC_MSG_ERROR([ACL Support prerequisite LDAP client libs not found.])
+ with_acl_support=no])
fi
-if test x$neta_cv_nfsv4acl = xyes; then
- AC_CHECK_HEADER([sys/acl.h],[
- AC_DEFINE([HAVE_NFSv4_ACLS], 1, [Enable ACL code])
- AC_MSG_NOTICE([Enabling ACL support])
- ],
- neta_cv_nfsv4acl=no
- )
+
+if test x"$with_acl_support" = x"yes" ; then
+ AC_MSG_NOTICE(checking whether ACL support is available:)
+ case "$host_os" in
+ *sysv5*)
+ AC_MSG_NOTICE(Using UnixWare ACLs)
+ AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
+ ;;
+ *solaris*)
+ AC_MSG_NOTICE(Using solaris ACLs)
+ AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
+ ACL_LIBS="$ACL_LIBS -lsec"
+ ;;
+ *hpux*)
+ AC_MSG_NOTICE(Using HPUX ACLs)
+ AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
+ ;;
+ *irix*)
+ AC_MSG_NOTICE(Using IRIX ACLs)
+ AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
+ ;;
+ *aix*)
+ AC_MSG_NOTICE(Using AIX ACLs)
+ AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
+ ;;
+ *osf*)
+ AC_MSG_NOTICE(Using Tru64 ACLs)
+ AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
+ ACL_LIBS="$ACL_LIBS -lpacl"
+ ;;
+ *darwin*)
+ AC_MSG_NOTICE(ACLs on Darwin currently not supported)
+ AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
+ ;;
+ *)
+ AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
+ case "$host_os" in
+ *linux*)
+ AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
+ ;;
+ esac
+ AC_CACHE_CHECK([for POSIX ACL support],netatalk_cv_HAVE_POSIX_ACLS,[
+ acl_LIBS=$LIBS
+ LIBS="$LIBS $ACL_LIBS"
+ AC_TRY_LINK([
+ #include <sys/types.h>
+ #include <sys/acl.h>
+ ],[
+ acl_t acl;
+ int entry_id;
+ acl_entry_t *entry_p;
+ return acl_get_entry(acl, entry_id, entry_p);
+ ],
+ [netatalk_cv_HAVE_POSIX_ACLS=yes],
+ [netatalk_cv_HAVE_POSIX_ACLS=no
+ with_acl_support=no])
+ LIBS=$acl_LIBS
+ ])
+ if test x"$netatalk_cv_HAVE_POSIX_ACLS" = x"yes"; then
+ AC_MSG_NOTICE(Using POSIX ACLs)
+ AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
+ AC_CACHE_CHECK([for acl_get_perm_np],netatalk_cv_HAVE_ACL_GET_PERM_NP,[
+ acl_LIBS=$LIBS
+ LIBS="$LIBS $ACL_LIBS"
+ AC_TRY_LINK([
+ #include <sys/types.h>
+ #include <sys/acl.h>
+ ],[
+ acl_permset_t permset_d;
+ acl_perm_t perm;
+ return acl_get_perm_np(permset_d, perm);
+ ],
+ [samba_cv_HAVE_ACL_GET_PERM_NP=yes],
+ [samba_cv_HAVE_ACL_GET_PERM_NP=no])
+ LIBS=$acl_LIBS
+ ])
+ if test x"netatalk_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
+ AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
+ fi
+ else
+ AC_MSG_NOTICE(ACL support is not avaliable)
+ AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
+ fi
+ ;;
+ esac
fi
-if test x$neta_cv_nfsv4acl = xyes; then
- LIBATALK_ACLS="acl/libacl.la"
-else
- LIBATALK_ACLS=""
+
+if test x"$with_acl_support" = x"yes" ; then
+ AC_DEFINE(HAVE_ACLS,1,[Whether ACLs support is available])
fi
-AC_SUBST(LIBATALK_ACLS)
dnl --------------------- check for Extended Attributes support
neta_cv_eas="ad"
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(USE_NFSv4_ACLS, test x$neta_cv_nfsv4acl = xyes)
+AM_CONDITIONAL(HAVE_ACLS, test x"$with_acl_support" = x"yes")
AM_CONDITIONAL(USE_DHX, test x$neta_cv_compile_dhx = xyes)
AM_CONDITIONAL(USE_DHX2, test x$neta_cv_compile_dhx2 = xyes)
AM_CONDITIONAL(USE_RANDNUM, test x$neta_cv_have_openssl = xyes)
afp_config.c nfsquota.c quota.c uam.c afs.c uid.c afp_util.c \
catsearch.c afprun.c hash.c extattrs.c dircache.c
-if USE_NFSv4_ACLS
+if HAVE_ACLS
afpd_SOURCES += acls.c
endif
#ifndef ACL_MAPPINGS
#define ACL_MAPPINGS
+#ifdef HAVE_SOLARIS_ACLS
#include <sys/acl.h>
+#endif
+
#include "acls.h"
/*
u_int32_t to;
};
+#ifdef HAVE_SOLARIS_ACLS
struct ace_rights_map nfsv4_to_darwin_rights[] = {
{ACE_READ_DATA, DARWIN_ACE_READ_DATA},
{ACE_WRITE_DATA, DARWIN_ACE_WRITE_DATA},
{DARWIN_ACE_FLAGS_INHERITED, ACE_INHERITED_ACE},
{0,0}
};
+#endif /* HAVE_SOLARIS_ACLS */
#endif /* ACL_MAPPINGS */
/*
- $Id: acls.c,v 1.9 2010-03-08 19:49:59 franklahm Exp $
Copyright (c) 2008,2009 Frank Lahm <franklahm@gmail.com>
+ Copyright (c) 2010 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Takes a users name, uid and primary gid and checks if user is member of any group
Returns -1 if no or error, 0 if yes
*/
-static int check_group(char *name, uid_t uid, gid_t pgid, gid_t path_gid)
+static int check_group(char *name, uid_t uid _U_, gid_t pgid, gid_t path_gid)
{
int i;
struct group *grp;
return -1;
}
+/********************************************************
+ * Solaris funcs
+ ********************************************************/
+
+#ifdef HAVE_SOLARIS_ACLS
/*
Remove any trivial ACE "in-place". Returns no of non-trivial ACEs
*/
return mapped_aces;
}
-/********************************************************
- * 2nd level funcs
- ********************************************************/
/* Map between ACL styles (SOLARIS_2_DARWIN, DARWIN_2_SOLARIS).
Reads from 'aces' buffer, writes to 'rbuf' buffer.
LOG(log_debug9, logtype_afpd, "map_acl: END");
return mapped_aces;
}
-
-/********************************************************
- * 1st level funcs
- ********************************************************/
-
+#endif /* HAVE_SOLARIS_ACLS */
/* Get ACL from object omitting trivial ACEs. Map to Darwin ACL style and
store Darwin ACL at rbuf. Add length of ACL written to rbuf to *rbuflen.
Returns 0 on success, -1 on error. */
static int get_and_map_acl(char *name, char *rbuf, size_t *rbuflen)
{
- int ace_count, mapped_aces, err;
- ace_t *aces;
+ int ace_count = 0, mapped_aces = 0, err;
uint32_t *darwin_ace_count = (u_int32_t *)rbuf;
+#ifdef HAVE_SOLARIS_ACLS
+ ace_t *aces;
+#endif
LOG(log_debug9, logtype_afpd, "get_and_map_acl: BEGIN");
*rbuf = 0;
rbuf += 4;
+#ifdef HAVE_SOLARIS_ACLS
if ( (ace_count = get_nfsv4_acl(name, &aces)) == -1) {
LOG(log_error, logtype_afpd, "get_and_map_acl: couldnt get ACL");
return -1;
err = -1;
goto cleanup;
}
+#endif /* HAVE_SOLARIS_ACLS */
+
LOG(log_debug, logtype_afpd, "get_and_map_acl: mapped %d ACEs", mapped_aces);
err = 0;
*darwin_ace_count = htonl(mapped_aces);
*rbuflen += sizeof(darwin_acl_header_t) + (mapped_aces * sizeof(darwin_ace_t));
+#ifdef HAVE_SOLARIS_ACLS
cleanup:
- free(aces);
+ free(aces);
+#endif
LOG(log_debug9, logtype_afpd, "get_and_map_acl: END");
return err;
}
/* Removes all non-trivial ACLs from object. Returns full AFPERR code. */
-static int remove_acl_vfs(const struct vol *vol,const char *path, int dir)
+static int remove_acl(const struct vol *vol,const char *path, int dir)
{
int ret;
if ((ret = vol->vfs->vfs_remove_acl(vol, path, dir)) != AFP_OK)
return ret;
/* now the data fork or dir */
- return (remove_acl(path));
+ return (remove_acl_vfs(path));
}
/*
We will store inherited ACEs first, which is Darwins canonical order.
- returns AFPerror code
*/
-static int set_acl_vfs(const struct vol *vol, char *name, int inherit, char *ibuf)
+#ifdef HAVE_SOLARIS_ACLS
+static int set_acl(const struct vol *vol, char *name, int inherit, char *ibuf)
{
int ret, i, nfsv4_ace_count, tocopy_aces_count = 0, new_aces_count = 0, trivial_ace_count = 0;
ace_t *old_aces, *new_aces = NULL;
LOG(log_debug9, logtype_afpd, "set_acl: END");
return ret;
}
+#endif /* HAVE_SOLARIS_ACLS */
+
+#ifdef HAVE_POSIX_ACLS
+static int set_acl(const struct vol *vol, char *name, int inherit, char *ibuf)
+{
+ return AFP_OK;
+}
+#endif /* HAVE_POSIX_ACLS */
/*
Checks if a given UUID has requested_rights(type darwin_ace_rights) for path.
Note: this gets called frequently and is a good place for optimizations !
*/
+#ifdef HAVE_SOLARIS_ACLS
static int check_acl_access(const char *path, const uuidp_t uuid, uint32_t requested_darwin_rights)
{
int ret, i, ace_count, dir, checkgroup;
#endif
return ret;
}
+#endif /* HAVE_SOLARIS_ACLS */
+
+#ifdef HAVE_POSIX_ACLS
+static int check_acl_access(const char *path, const uuidp_t uuid, uint32_t requested_darwin_rights)
+{
+ return AFP_OK;
+}
+#endif /* HAVE_POSIX_ACLS */
/********************************************************
* Interface
/* Remove ACL ? */
if (bitmap & kFileSec_REMOVEACL) {
LOG(log_debug, logtype_afpd, "afp_setacl: Remove ACL request.");
- if ((ret = remove_acl_vfs(vol, s_path->u_name, S_ISDIR(s_path->st.st_mode))) != AFP_OK)
+ if ((ret = remove_acl(vol, s_path->u_name, S_ISDIR(s_path->st.st_mode))) != AFP_OK)
LOG(log_error, logtype_afpd, "afp_setacl: error from remove_acl");
}
/* Check if its our job to preserve inherited ACEs */
if (bitmap & kFileSec_Inherit)
- ret = set_acl_vfs(vol, s_path->u_name, 1, ibuf);
+ ret = set_acl(vol, s_path->u_name, 1, ibuf);
else
- ret = set_acl_vfs(vol, s_path->u_name, 0, ibuf);
+ ret = set_acl(vol, s_path->u_name, 0, ibuf);
if (ret == 0)
ret = AFP_OK;
else
{
struct passwd *pw;
uuid_t uuid;
- int dir, r_ok, w_ok, x_ok;
+ int r_ok, w_ok, x_ok;
- if ( ! (AFPobj->options.flags & OPTION_UUID))
+ if ( ! (AFPobj->options.flags & OPTION_UUID) || (AFPobj->options.flags & OPTION_ACL2OS9MODE))
return;
LOG(log_maxdebug, logtype_afpd, "acltoownermode('%s')", path);
We then inherit any explicit ACE from "." to ".AppleDouble" and ".AppleDouble/.Parent".
FIXME: add to VFS layer ?
*/
+#ifdef HAVE_SOLARIS_ACLS
void addir_inherit_acl(const struct vol *vol)
{
ace_t *diraces = NULL, *adaces = NULL, *combinedaces = NULL;
free(adaces);
free(combinedaces);
}
+#endif /* HAVE_SOLARIS_ACLS */
+
+#ifdef HAVE_POSIX_ACLS
+void addir_inherit_acl(const struct vol *vol)
+{
+ return;
+}
+#endif /* HAVE_POSIX_ACLS */
/*
- $Id: acls.h,v 1.3 2009-11-20 17:45:47 franklahm Exp $
Copyright (c) 2008,2009 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
#ifndef AFPD_ACLS_H
#define AFPD_ACLS_H
+#ifdef HAVE_SOLARIS_ACLS
#include <sys/acl.h>
+#endif
+
#include <atalk/uuid.h> /* for uuid_t */
/*
* the wire! We will ignore and spoil em.
*/
+#ifdef HAVE_SOLARIS_ACLS
/* Some stuff for the handling of NFSv4 ACLs */
#define ACE_TRIVIAL (ACE_OWNER | ACE_GROUP | ACE_EVERYONE)
+#endif /* HAVE_SOLARIS_ACLS */
/* FPGet|Set Bitmap */
enum {
/* Parse afp_ldap.conf */
extern int acl_ldap_readconfig(char *name);
+extern void acltoownermode(char *path, struct stat *st,uid_t uid, struct maccess *ma);
#endif
#ifdef USE_SRVLOC
#include <slp.h>
#endif /* USE_SRVLOC */
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
#include <atalk/ldapconfig.h>
#endif
struct afp_options options;
AFPConfig *config=NULL, *first = NULL;
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
/* Parse afp_ldap.conf first so we can set the uuid option */
LOG(log_debug, logtype_afpd, "Start parsing afp_ldap.conf");
acl_ldap_readconfig(_PATH_ACL_LDAPCONF);
LOG(log_debug, logtype_afpd, "Finished parsing afp_ldap.conf");
-#endif
+#endif /* HAVE_ACLS */
/* if config file doesn't exist, load defaults */
if ((fp = fopen(cmdline->configfile, "r")) == NULL)
if (!afp_options_parseline(p, &options))
continue;
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
/* Enable UUID support if LDAP config is complete */
if (ldap_config_valid)
options.flags |= OPTION_UUID;
-#endif
+#endif /* HAVE_ACLS */
/* this should really get a head and a tail to simplify things. */
if (!first) {
options->flags |= OPTION_CUSTOMICON;
if (strstr(buf, " -advertise_ssh"))
options->flags |= OPTION_ANNOUNCESSH;
+ if (strstr(buf, " -acl2os9mode"))
+ options->flags |= OPTION_ACL2OS9MODE;
/* passwd bits */
if (strstr(buf, " -nosavepassword"))
#include "status.h"
#include "fork.h"
#include "extattrs.h"
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
#include "acls.h"
#endif
afp_switch = postauth_switch;
switch (afp_version) {
case 32:
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
uam_afpserver_action(AFP_GETACL, UAM_AFPSERVER_POSTAUTH, afp_getacl, NULL);
uam_afpserver_action(AFP_SETACL, UAM_AFPSERVER_POSTAUTH, afp_setacl, NULL);
uam_afpserver_action(AFP_ACCESS, UAM_AFPSERVER_POSTAUTH, afp_access, NULL);
-#endif
+#endif /* HAVE_ACLS */
uam_afpserver_action(AFP_GETEXTATTR, UAM_AFPSERVER_POSTAUTH, afp_getextattr, NULL);
uam_afpserver_action(AFP_SETEXTATTR, UAM_AFPSERVER_POSTAUTH, afp_setextattr, NULL);
uam_afpserver_action(AFP_REMOVEATTR, UAM_AFPSERVER_POSTAUTH, afp_remextattr, NULL);
*rbuflen += sizeof(id);
}
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
if (bitmap & USERIBIT_UUID) {
int ret;
uuid_t uuid;
rbuf += UUID_BINSIZE;
*rbuflen += UUID_BINSIZE;
}
-#endif
+#endif /* HAVE_ACLS */
LOG(log_debug, logtype_afpd, "END afp_getuserinfo:");
return AFP_OK;
#include "mangle.h"
#include "hash.h"
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
extern void addir_inherit_acl(const struct vol *vol);
#endif
ad_close_metadata( &ad);
createdir_done:
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
/* FIXME: are we really inside the created dir? */
addir_inherit_acl(vol);
-#endif
+#endif /* HAVE_ACLS */
memcpy( rbuf, &dir->d_did, sizeof( u_int32_t ));
*rbuflen = sizeof( u_int32_t );
name = NULL;
}
break;
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
case 5 : /* UUID -> username */
case 6 : /* UUID -> groupname */
if ((afp_version < 32) || !(obj->options.flags & OPTION_UUID ))
*rbuflen = 2 * sizeof( id );
}
break;
-#endif
+#endif /* HAVE_ACLS */
default :
return( AFPERR_PARAM );
}
case 4 :
len = (unsigned char) *ibuf++;
break;
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
case 5 : /* username -> UUID */
case 6 : /* groupname -> UUID */
if ((afp_version < 32) || !(obj->options.flags & OPTION_UUID ))
len = ntohs(ulen);
ibuf += 2;
break;
-#endif
+#endif /* HAVE_ACLS */
default :
return( AFPERR_PARAM );
}
memcpy( rbuf, &id, sizeof( id ));
*rbuflen = sizeof( id );
break;
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
case 5 : /* username -> UUID */
LOG(log_debug, logtype_afpd, "afp_mapname: name: %s",ibuf);
if (0 != getuuidfromname(ibuf, UUID_USER, rbuf))
return AFPERR_NOITEM;
*rbuflen = UUID_BINSIZE;
break;
-#endif
+#endif /* HAVE_ACLS */
}
}
return( AFP_OK );
#define OPTION_NOSLP (1 << 5)
#define OPTION_ANNOUNCESSH (1 << 6)
#define OPTION_UUID (1 << 7)
+#define OPTION_ACL2OS9MODE (1 << 8)
#ifdef FORCE_UIDGID
/* set up a structure for this */
#include "filedir.h"
#include "status.h"
#include "misc.h"
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
#include "acls.h"
#endif
#include "volume.h"
#include "unix.h"
#include "fork.h"
-
-#ifdef HAVE_NFSv4_ACLS
-extern void acltoownermode(char *path, struct stat *st,uid_t uid, struct maccess *ma);
+#ifdef HAVE_ACLS
+#include "acls.h"
#endif
-
/*
* Get the free space on a partition.
*/
* dir parameter is used by AFS
*/
void accessmode(char *path, struct maccess *ma, struct dir *dir _U_, struct stat *st)
-
{
-struct stat sb;
+ struct stat sb;
ma->ma_user = ma->ma_owner = ma->ma_world = ma->ma_group = 0;
if (!st) {
st = &sb;
}
utommode( st, ma );
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
/* 10.5 Finder looks at OS 9 mode, so we must do some mapping */
acltoownermode( path, st, uuid, ma);
#endif
/*
- $Id: acl.h,v 1.1 2009-10-14 15:04:01 franklahm Exp $
Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
#include "config.h"
#endif /* HAVE_CONFIG_H */
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_SOLARIS_ACLS
#include <sys/acl.h>
-#endif /* HAVE_NFSv4_ACLS */
+#endif /* HAVE_SOLARIS_ACLS */
-/* Solaris NFSv4 ACL stuff */
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_SOLARIS_ACLS
extern int get_nfsv4_acl(const char *name, ace_t **retAces);
-extern int remove_acl(const char *name);
-#endif /* HAVE_NFSv4_ACLS */
+#endif /* HAVE_SOLARIS_ACLS */
+extern int remove_acl_vfs(const char *name);
#endif /* ATALK_ACL_H */
#include <config.h>
#endif
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_SOLARIS_ACLS
#include <sys/acl.h>
#endif
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
#ifndef LDAPCONFIG_H
#define LDAPCONFIG_H
extern struct pref_array prefs_array[];
extern int ldap_config_valid;
-#endif
+#endif /* LDAPCONFIG_H */
-#endif
+#endif /* HAVE_ACLS */
# Makefile.am for libatalk/
-SUBDIRS = acl adouble asp atp bstring compat cnid dsi nbp netddp tdb util unicode vfs
+SUBDIRS = adouble asp atp bstring compat cnid dsi nbp netddp tdb util unicode vfs
lib_LTLIBRARIES = libatalk.la
util/libutil.la \
tdb/libtdb.la \
unicode/libunicode.la \
- vfs/libvfs.la @LIBATALK_ACLS@
+ vfs/libvfs.la
libatalk_la_DEPENDENCIES = \
adouble/libadouble.la \
util/libutil.la \
tdb/libtdb.la \
unicode/libunicode.la \
- vfs/libvfs.la @LIBATALK_ACLS@
+ vfs/libvfs.la
+
+if HAVE_ACLS
+SUBDIRS += acl
+libatalk_la_DEPENDENCIES += acl/libacl.la
+libatalk_la_LIBADD += acl/libacl.la
+endif
libatalk_la_LDFLAGS = -static
noinst_HEADERS = aclldap.h cache.h
-if USE_NFSv4_ACLS
-
+if HAVE_ACLS
noinst_LTLIBRARIES = libacl.la
libacl_la_SOURCES = \
ldap.c \
cache.c \
ldap_config.c
libacl_la_LDFLAGS = -lldap
-
endif
#include "config.h"
#endif /* HAVE_CONFIG_H */
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_ACLS
#include <stdio.h>
#include <errno.h>
fclose(f);
return 0;
}
-#endif
+#endif /* HAVE_ACLS */
-
-# Makefile.am for libatalk/adouble/
+# Makefile.am for libatalk/vfs/
noinst_LTLIBRARIES = libvfs.la
libvfs_la_SOURCES = vfs.c unix.c ea.c sys_ea.c ea_sys.c
-if USE_NFSv4_ACLS
+if HAVE_ACLS
libvfs_la_SOURCES += acl.c
endif
/*
- $Id: acl.c,v 1.2 2009-11-26 18:17:12 franklahm Exp $
Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
+ Copyright (c) 2010 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <stdlib.h>
#include <string.h>
#include <errno.h>
+
+#ifdef HAVE_SOLARIS_ACLS
#include <sys/acl.h>
+#endif
#include <atalk/afp.h>
#include <atalk/util.h>
#include <atalk/logger.h>
+#ifdef HAVE_SOLARIS_ACLS
+
/* Get ACL. Allocates storage as needed. Caller must free.
* Returns no of ACEs or -1 on error. */
int get_nfsv4_acl(const char *name, ace_t **retAces)
}
/* Removes all non-trivial ACLs from object. Returns full AFPERR code. */
-int remove_acl(const char *name)
+int remove_acl_vfs(const char *name)
{
int ret,i, ace_count, trivial_aces, new_aces_count;
ace_t *old_aces = NULL;
LOG(log_debug9, logtype_afpd, "remove_acl: END");
return ret;
}
+
+#endif /* HAVE_SOLARIS_ACLS */
+
+#ifdef HAVE_POSIX_ACLS
+int remove_acl_vfs(const char *name)
+{
+ return AFP_OK;
+}
+#endif /* HAVE_POSIX_ACLS */
return 0;
}
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_SOLARIS_ACLS
static int RF_solaris_acl(VFS_FUNC_ARGS_ACL)
{
static char buf[ MAXPATHLEN + 1];
* Tertiary VFS modules for ACLs
*/
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_SOLARIS_ACLS
static struct vfs_ops netatalk_solaris_acl_adouble = {
/* validupath: */ NULL,
/* rf_chown: */ NULL,
}
/* ACLs */
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_SOLARIS_ACLS
vol->vfs_modules[2] = &netatalk_solaris_acl_adouble;
#endif
}
AC_MSG_RESULT([ dropbox kludge: $netatalk_cv_dropkludge])
AC_MSG_RESULT([ force volume uid/gid: $netatalk_cv_force_uidgid])
AC_MSG_RESULT([ Apple 2 boot support: $compile_a2boot])
- AC_MSG_RESULT([ ACL support: $neta_cv_nfsv4acl])
+ AC_MSG_RESULT([ ACL support: $with_acl_support])
if test x"$use_pam_so" = x"yes" -a x"$netatalk_cv_install_pam" = x"no"; then
AC_MSG_RESULT([])
AC_MSG_WARN([ PAM support was configured for your system, but the netatalk PAM configuration file])