s3: Add extid to the dev/inode pair
[samba.git] / source3 / modules / vfs_acl_tdb.c
index 9cb887ae5184020997f9f30bbaba099b91d0bb7b..909de9d7c85cd6278ff6c9742254852fe08bc12a 100644 (file)
@@ -36,7 +36,7 @@ static struct db_context *acl_db;
 
 static bool acl_tdb_init(struct db_context **pp_db)
 {
-       const char *dbname;
+       char *dbname;
 
        if (acl_db) {
                *pp_db = acl_db;
@@ -44,7 +44,7 @@ static bool acl_tdb_init(struct db_context **pp_db)
                return true;
        }
 
-       dbname = lock_path("file_ntacls.tdb");
+       dbname = state_path("file_ntacls.tdb");
 
        if (dbname == NULL) {
                errno = ENOSYS;
@@ -61,10 +61,12 @@ static bool acl_tdb_init(struct db_context **pp_db)
 #else
                errno = ENOSYS;
 #endif
+               TALLOC_FREE(dbname);
                return false;
        }
 
        ref_count++;
+       TALLOC_FREE(dbname);
        return true;
 }
 
@@ -92,6 +94,8 @@ static struct db_record *acl_tdb_lock(TALLOC_CTX *mem_ctx,
                                        const struct file_id *id)
 {
        uint8 id_buf[16];
+
+       /* For backwards compatibility only store the dev/inode. */
        push_file_id_16((char *)id_buf, id);
        return db->fetch_locked(db,
                                mem_ctx,
@@ -198,6 +202,7 @@ static NTSTATUS get_acl_blob(TALLOC_CTX *ctx,
        }
        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);
 
        if (db->fetch(db,
@@ -283,6 +288,7 @@ static NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle,
        }
        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,
@@ -323,6 +329,8 @@ static NTSTATUS store_acl_blob_pathname(vfs_handle_struct *handle,
        }
 
        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(),
@@ -433,10 +441,7 @@ static NTSTATUS inherit_new_acl(vfs_handle_struct *handle,
        size_t size;
        char *parent_name;
 
-       if (!parent_dirname_talloc(ctx,
-                               fname,
-                               &parent_name,
-                               NULL)) {
+       if (!parent_dirname(ctx, fname, &parent_name, NULL)) {
                return NT_STATUS_NO_MEMORY;
        }