]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: acl_tdb.c: Add fget_acl_blob().
authorJeremy Allison <jra@samba.org>
Mon, 13 Apr 2020 19:19:03 +0000 (12:19 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 7 May 2020 19:27:34 +0000 (19:27 +0000)
Separate from get_acl_blob() which took both an fsp and a pathname.
Commented out so we still compile.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_acl_tdb.c

index ed88b2bc4a6a6fee887c75ece083b0d532504a99..3f855549774cb2f23f25062c6eec9588abe1b451 100644 (file)
@@ -108,6 +108,54 @@ static NTSTATUS acl_tdb_delete(vfs_handle_struct *handle,
        return status;
 }
 
+#if 0
+/*******************************************************************
+ Pull a security descriptor from an fsp into a DATA_BLOB from a tdb store.
+*******************************************************************/
+
+static NTSTATUS fget_acl_blob(TALLOC_CTX *ctx,
+                       vfs_handle_struct *handle,
+                       files_struct *fsp,
+                       DATA_BLOB *pblob)
+{
+       uint8_t id_buf[16];
+       TDB_DATA data;
+       struct file_id id;
+       struct db_context *db = acl_db;
+       NTSTATUS status = NT_STATUS_OK;
+
+       status = vfs_stat_fsp(fsp);
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
+       id = vfs_file_id_from_sbuf(handle->conn, &fsp->fsp_name->st);
+
+       /* For backwards compatibility only store the dev/inode. */
+       push_file_id_16((char *)id_buf, &id);
+
+       status = dbwrap_fetch(db,
+                             ctx,
+                             make_tdb_data(id_buf, sizeof(id_buf)),
+                             &data);
+       if (!NT_STATUS_IS_OK(status)) {
+               return NT_STATUS_INTERNAL_DB_CORRUPTION;
+       }
+
+       pblob->data = data.dptr;
+       pblob->length = data.dsize;
+
+       DBG_DEBUG("returned %u bytes from file %s\n",
+               (unsigned int)data.dsize,
+               fsp_str_dbg(fsp));
+
+       if (pblob->length == 0 || pblob->data == NULL) {
+               return NT_STATUS_NOT_FOUND;
+       }
+       return NT_STATUS_OK;
+}
+#endif
+
 /*******************************************************************
  Pull a security descriptor into a DATA_BLOB from a tdb store.
 *******************************************************************/