From ded40a0b6cdb144ae3fc59cea4cc3378d1541007 Mon Sep 17 00:00:00 2001 From: franklahm Date: Thu, 26 Nov 2009 18:17:12 +0000 Subject: [PATCH] Fix NFSv4 ACL VFS integration --- etc/afpd/acls.c | 7 ++++--- etc/afpd/directory.c | 3 ++- libatalk/vfs/acl.c | 6 +++++- libatalk/vfs/vfs.c | 10 +++++----- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/etc/afpd/acls.c b/etc/afpd/acls.c index a3310e72..a535cce9 100644 --- a/etc/afpd/acls.c +++ b/etc/afpd/acls.c @@ -1,5 +1,5 @@ /* - $Id: acls.c,v 1.5 2009-10-15 10:43:13 didg Exp $ + $Id: acls.c,v 1.6 2009-11-26 18:17:12 franklahm Exp $ Copyright (c) 2008,2009 Frank Lahm This program is free software; you can redistribute it and/or modify @@ -33,6 +33,7 @@ #include #include #include +#include #include "directory.h" #include "desktop.h" @@ -434,7 +435,7 @@ static int remove_acl_vfs(const struct vol *vol,const char *path, int dir) int ret; /* Ressource etc. first */ - if ((ret = vol->vfs->rf_remove_acl(vol, path, dir)) != AFP_OK) + if ((ret = vol->vfs->vfs_remove_acl(vol, path, dir)) != AFP_OK) return ret; /* now the data fork or dir */ return (remove_acl(path)); @@ -520,7 +521,7 @@ static int set_acl_vfs(const struct vol *vol, char *name, int inherit, char *ibu /* Ressourcefork first. Note: for dirs we set the same ACL on the .AppleDouble/.Parent _file_. This might be strange for ACE_DELETE_CHILD and for inheritance flags. */ - if ( (ret = vol->vfs->rf_acl(vol, name, ACE_SETACL, new_aces_count, new_aces)) != 0) { + if ( (ret = vol->vfs->vfs_acl(vol, name, ACE_SETACL, new_aces_count, new_aces)) != 0) { LOG(log_error, logtype_afpd, "set_acl: error setting acl: %s", strerror(errno)); if (errno == (EACCES | EPERM)) ret = AFPERR_ACCESS; diff --git a/etc/afpd/directory.c b/etc/afpd/directory.c index 810c1c24..a7362e0b 100644 --- a/etc/afpd/directory.c +++ b/etc/afpd/directory.c @@ -1,5 +1,5 @@ /* - * $Id: directory.c,v 1.119 2009-11-19 10:41:23 franklahm Exp $ + * $Id: directory.c,v 1.120 2009-11-26 18:17:12 franklahm Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -2689,6 +2689,7 @@ int afp_mapid(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *r if ((afp_version < 32) || !(obj->options.flags & OPTION_UUID )) return AFPERR_PARAM; LOG(log_debug, logtype_afpd, "afp_mapid: valid UUID request"); + uuidtype_t type; len = getnamefromuuid( ibuf, &name, &type); if (len != 0) /* its a error code, not len */ return AFPERR_NOITEM; diff --git a/libatalk/vfs/acl.c b/libatalk/vfs/acl.c index d851f706..4b118607 100644 --- a/libatalk/vfs/acl.c +++ b/libatalk/vfs/acl.c @@ -1,5 +1,5 @@ /* - $Id: acl.c,v 1.1 2009-10-02 09:32:41 franklahm Exp $ + $Id: acl.c,v 1.2 2009-11-26 18:17:12 franklahm Exp $ Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify @@ -17,9 +17,13 @@ #include "config.h" #endif /* HAVE_CONFIG_H */ +#include +#include +#include #include #include +#include #include #include diff --git a/libatalk/vfs/vfs.c b/libatalk/vfs/vfs.c index 481e269e..09684192 100644 --- a/libatalk/vfs/vfs.c +++ b/libatalk/vfs/vfs.c @@ -336,11 +336,11 @@ static int RF_solaris_acl(VFS_FUNC_ARGS_ACL) if ((acl(buf, cmd, count, aces)) != 0) return -1; /* now set ACL on ressource fork */ - if ((acl(vol->vfs->ad_path(path, ADFLAGS_DIR), cmd, count, aces)) != 0) + if ((acl(vol->ad_path(path, ADFLAGS_DIR), cmd, count, aces)) != 0) return -1; } else /* set ACL on ressource fork */ - if ((acl(vol->vfs->ad_path(path, ADFLAGS_HF), cmd, count, aces)) != 0) + if ((acl(vol->ad_path(path, ADFLAGS_HF), cmd, count, aces)) != 0) return -1; return 0; @@ -357,14 +357,14 @@ static int RF_solaris_remove_acl(VFS_FUNC_ARGS_REMOVE_ACL) if (len < 0 || len >= MAXPATHLEN) return AFPERR_MISC; /* remove ACL from .AppleDouble/.Parent first */ - if ((ret = remove_acl(vol->vfs->ad_path(path, ADFLAGS_DIR))) != AFP_OK) + if ((ret = remove_acl(vol->ad_path(path, ADFLAGS_DIR))) != AFP_OK) return ret; /* now remove from .AppleDouble dir */ if ((ret = remove_acl(buf)) != AFP_OK) return ret; } else /* remove ACL from ressource fork */ - if ((ret = remove_acl(vol->vfs->ad_path(path, ADFLAGS_HF))) != AFP_OK) + if ((ret = remove_acl(vol->ad_path(path, ADFLAGS_HF))) != AFP_OK) return ret; return AFP_OK; @@ -964,7 +964,7 @@ static struct vfs_ops netatalk_solaris_acl_adouble = { /* rf_renamefile: */ NULL, /* vfs_copyfile */ NULL, /* rf_acl: */ RF_solaris_acl, - /* rf_remove_acl */ RF_remove_acl, + /* rf_remove_acl */ RF_solaris_remove_acl, NULL }; #endif -- 2.39.2