summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_acl_tdb.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-12-07 14:36:12 -0800
committerJeremy Allison <jra@samba.org>2009-12-07 14:36:12 -0800
commit12bac42a93cd6afd3cd29460b97bbd61852a9d44 (patch)
treeb0258097d58eecf03f7cab0c46c704c8992cdbe2 /source3/modules/vfs_acl_tdb.c
parent909cd2617fa1c170183664af1fc4253af2dc2f21 (diff)
downloadsamba-12bac42a93cd6afd3cd29460b97bbd61852a9d44.tar.gz
samba-12bac42a93cd6afd3cd29460b97bbd61852a9d44.tar.bz2
samba-12bac42a93cd6afd3cd29460b97bbd61852a9d44.zip
Hopefullt final fix for 6802 - acl_xattr.c module: A created folder does not properly inherit permissions from parent and 6938 - No hook exists to check creation rights when using acl_xattr module
Volker was right (dammit :-). It's much easier to catch this case in the create_file() vfs call instead of trying to do everything inside open() and mkdir(). Hook all these functions to gain the desired effect. Jeremy.
Diffstat (limited to 'source3/modules/vfs_acl_tdb.c')
-rw-r--r--source3/modules/vfs_acl_tdb.c51
1 files changed, 1 insertions, 50 deletions
diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c
index dcd323a148..a1088ab63c 100644
--- a/source3/modules/vfs_acl_tdb.c
+++ b/source3/modules/vfs_acl_tdb.c
@@ -235,56 +235,6 @@ static NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle,
return rec->store(rec, data, 0);
}
-/*******************************************************************
- Store a DATA_BLOB into a tdb record given a pathname.
-*******************************************************************/
-
-static NTSTATUS store_acl_blob_pathname(vfs_handle_struct *handle,
- const char *fname,
- DATA_BLOB *pblob)
-{
- uint8 id_buf[16];
- struct file_id id;
- TDB_DATA data;
- SMB_STRUCT_STAT sbuf;
- struct db_context *db;
- struct db_record *rec;
- int ret = -1;
-
- DEBUG(10,("store_acl_blob_pathname: storing blob "
- "length %u on file %s\n",
- (unsigned int)pblob->length, fname));
-
- SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context,
- return NT_STATUS_INTERNAL_DB_CORRUPTION);
-
- if (lp_posix_pathnames()) {
- ret = vfs_lstat_smb_fname(handle->conn, fname, &sbuf);
- } else {
- ret = vfs_stat_smb_fname(handle->conn, fname, &sbuf);
- }
-
- if (ret == -1) {
- return map_nt_error_from_unix(errno);
- }
-
- id = vfs_file_id_from_sbuf(handle->conn, &sbuf);
-
- /* For backwards compatibility only store the dev/inode. */
- push_file_id_16((char *)id_buf, &id);
-
- rec = db->fetch_locked(db, talloc_tos(),
- make_tdb_data(id_buf,
- sizeof(id_buf)));
- if (rec == NULL) {
- DEBUG(0, ("store_acl_blob_pathname_tdb: fetch_lock failed\n"));
- return NT_STATUS_INTERNAL_DB_CORRUPTION;
- }
- data.dptr = pblob->data;
- data.dsize = pblob->length;
- return rec->store(rec, data, 0);
-}
-
/*********************************************************************
On unlink we need to delete the tdb record (if using tdb).
*********************************************************************/
@@ -464,6 +414,7 @@ static struct vfs_fn_pointers vfs_acl_tdb_fns = {
.opendir = opendir_acl_common,
.mkdir = mkdir_acl_common,
.open = open_acl_common,
+ .create_file = create_file_acl_common,
.unlink = unlink_acl_tdb,
.rmdir = rmdir_acl_tdb,
.fget_nt_acl = fget_nt_acl_common,