s4:kdc: Implement KDC plugin hardware authentication policy
[samba.git] / source3 / modules / vfs_zfsacl.c
index 69a1db59249841276faf81512951ec0ff47e343d..695abf1e0df62f06fc3dfab9c88312b22a1af007 100644 (file)
@@ -245,9 +245,9 @@ static bool zfs_process_smbacl(vfs_handle_struct *handle, files_struct *fsp,
                if(errno == ENOSYS) {
                        DEBUG(9, ("acl(ACE_SETACL, %s): Operation is not "
                                  "supported on the filesystem where the file "
-                                 "reside", fsp_str_dbg(fsp)));
+                                 "resides\n", fsp_str_dbg(fsp)));
                } else {
-                       DEBUG(9, ("acl(ACE_SETACL, %s): %s ", fsp_str_dbg(fsp),
+                       DEBUG(9, ("acl(ACE_SETACL, %s): %s\n", fsp_str_dbg(fsp),
                                  strerror(errno)));
                }
                return false;
@@ -278,41 +278,6 @@ static NTSTATUS zfs_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
                                zfs_process_smbacl);
 }
 
-static int get_zfsacl(TALLOC_CTX *mem_ctx,
-                     const struct smb_filename *smb_fname,
-                     ace_t **outbuf)
-{
-       int naces, rv;
-       ace_t *acebuf = NULL;
-
-       naces = acl(smb_fname->base_name, ACE_GETACLCNT, 0, NULL);
-       if (naces == -1) {
-               int dbg_level = 10;
-
-               if (errno == ENOSYS) {
-                       dbg_level = 1;
-               }
-               DEBUG(dbg_level, ("acl(ACE_GETACLCNT, %s): %s ",
-                                 smb_fname->base_name, strerror(errno)));
-               return naces;
-       }
-       acebuf = talloc_size(mem_ctx, sizeof(ace_t)*naces);
-       if (acebuf == NULL) {
-               errno = ENOMEM;
-               return -1;
-       }
-
-       rv = acl(smb_fname->base_name, ACE_GETACL, naces, acebuf);
-       if (rv == -1) {
-               DBG_DEBUG("acl(ACE_GETACL, %s) failed: %s ",
-                         smb_fname->base_name, strerror(errno));
-               return -1;
-       }
-
-       *outbuf = acebuf;
-       return naces;
-}
-
 static int fget_zfsacl(TALLOC_CTX *mem_ctx,
                       struct files_struct *fsp,
                       ace_t **outbuf)
@@ -333,7 +298,7 @@ static int fget_zfsacl(TALLOC_CTX *mem_ctx,
                if (errno == ENOSYS) {
                        dbg_level = 1;
                }
-               DEBUG(dbg_level, ("facl(ACE_GETACLCNT, %s): %s ",
+               DEBUG(dbg_level, ("facl(ACE_GETACLCNT, %s): %s\n",
                                  fsp_str_dbg(fsp), strerror(errno)));
                return naces;
        }
@@ -346,7 +311,7 @@ static int fget_zfsacl(TALLOC_CTX *mem_ctx,
 
        rv = facl(fd, ACE_GETACL, naces, acebuf);
        if (rv == -1) {
-               DBG_DEBUG("acl(ACE_GETACL, %s): %s ",
+               DBG_DEBUG("acl(ACE_GETACL, %s): %s\n",
                          fsp_str_dbg(fsp), strerror(errno));
                return -1;
        }
@@ -361,6 +326,7 @@ static NTSTATUS zfsacl_fget_nt_acl(struct vfs_handle_struct *handle,
                                   TALLOC_CTX *mem_ctx,
                                   struct security_descriptor **ppdesc)
 {
+       TALLOC_CTX *frame = NULL;
        struct SMB4ACL_T *pacl;
        NTSTATUS status;
        struct zfsacl_config_data *config = NULL;
@@ -371,7 +337,7 @@ static NTSTATUS zfsacl_fget_nt_acl(struct vfs_handle_struct *handle,
                                struct zfsacl_config_data,
                                return NT_STATUS_INTERNAL_ERROR);
 
-       TALLOC_CTX *frame = talloc_stackframe();
+       frame = talloc_stackframe();
 
        naces = fget_zfsacl(talloc_tos(), fsp, &acebuf);
        if (naces == -1) {
@@ -521,6 +487,10 @@ static int zfsacl_connect(struct vfs_handle_struct *handle,
 
 static struct vfs_fn_pointers zfsacl_fns = {
        .connect_fn = zfsacl_connect,
+       .stat_fn = nfs4_acl_stat,
+       .fstat_fn = nfs4_acl_fstat,
+       .lstat_fn = nfs4_acl_lstat,
+       .fstatat_fn = nfs4_acl_fstatat,
        .sys_acl_get_fd_fn = zfsacl_fail__sys_acl_get_fd,
        .sys_acl_blob_get_fd_fn = zfsacl_fail__sys_acl_blob_get_fd,
        .sys_acl_set_fd_fn = zfsacl_fail__sys_acl_set_fd,