]> arthur.barton.de Git - netatalk.git/commitdiff
Fix NFSv4 ACL VFS integration
authorfranklahm <franklahm>
Thu, 26 Nov 2009 18:17:12 +0000 (18:17 +0000)
committerfranklahm <franklahm>
Thu, 26 Nov 2009 18:17:12 +0000 (18:17 +0000)
etc/afpd/acls.c
etc/afpd/directory.c
libatalk/vfs/acl.c
libatalk/vfs/vfs.c

index a3310e72a89c45902b71836686c2ac47e5633bbe..a535cce90174ea76d945cd7061f7a46d34ffd9a1 100644 (file)
@@ -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 <franklahm@gmail.com>
 
    This program is free software; you can redistribute it and/or modify
@@ -33,6 +33,7 @@
 #include <atalk/cnid.h>
 #include <atalk/logger.h>
 #include <atalk/uuid.h>
+#include <atalk/acl.h>
 
 #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;
index 810c1c248e3325ed6476d2f496c55586d2dcef9d..a7362e0b8ab8f54eceb46a4191d2854e8d19bfad 100644 (file)
@@ -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;
index d851f706d10160112c46348556606eaf9c074a03..4b118607155a7a9430e5798da1ac6b0afad6b839 100644 (file)
@@ -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 <franklahm@gmail.com>
 
   This program is free software; you can redistribute it and/or modify
 #include "config.h"
 #endif /* HAVE_CONFIG_H */
 
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
 #include <errno.h>
 #include <sys/acl.h>
 
+#include <atalk/afp.h>
 #include <atalk/util.h>
 #include <atalk/logger.h>
 
index 481e269eece56b3686c77ef956fa2d4e2d19c50b..09684192e985648e42e3ce059b168f9a3fa33c81 100644 (file)
@@ -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