[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tyndur-devel] [PATCH] ramdisk: Berechtigungsflags auf Ressourcen setzen
! ramdisk: Berechtigungsflags auf Ressourcen setzen, sonst tut das
nicht, wenn die CDI-Implementierung das vernuenftig prueft.
Signed-off-by: Antoine Kaufmann <toni@xxxxxxxxxx>
---
src/modules/cdi/ramdisk/init.c | 5 +++++
src/modules/cdi/ramdisk/res.c | 19 +++++++++++++++++++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/src/modules/cdi/ramdisk/init.c b/src/modules/cdi/ramdisk/init.c
index 568ed24..00e3b7e 100644
--- a/src/modules/cdi/ramdisk/init.c
+++ b/src/modules/cdi/ramdisk/init.c
@@ -46,6 +46,11 @@ int ramdisk_fs_init(struct cdi_fs_filesystem* cdi_fs)
root_res->res.name = strdup("/");
root_res->res.res = &ramdisk_fs_res;
root_res->res.dir = &ramdisk_fs_dir;
+ root_res->res.flags.remove = 1;
+ root_res->res.flags.rename = 1;
+ root_res->res.flags.move = 1;
+ root_res->res.flags.browse = 1;
+ root_res->res.flags.create_child = 1;
root_res->res.loaded = 1;
root_res->res.children = cdi_list_create();
root_res->creation_time = 0;
diff --git a/src/modules/cdi/ramdisk/res.c b/src/modules/cdi/ramdisk/res.c
index 81eac68..d37c894 100644
--- a/src/modules/cdi/ramdisk/res.c
+++ b/src/modules/cdi/ramdisk/res.c
@@ -131,14 +131,33 @@ int ramdisk_fs_res_assign_class(struct cdi_fs_stream* stream,
switch (class) {
case CDI_FS_CLASS_FILE:
res->res.file = &ramdisk_fs_file;
+
+ res->res.flags.remove = 1;
+ res->res.flags.rename = 1;
+ res->res.flags.move = 1;
+ res->res.flags.read = 1;
+ res->res.flags.write = 1;
+ res->res.flags.execute = 1;
break;
case CDI_FS_CLASS_DIR:
res->res.dir = &ramdisk_fs_dir;
+
+ res->res.flags.remove = 1;
+ res->res.flags.rename = 1;
+ res->res.flags.move = 1;
+ res->res.flags.browse = 1;
+ res->res.flags.create_child = 1;
break;
case CDI_FS_CLASS_LINK:
res->res.link = &ramdisk_fs_link;
+
+ res->res.flags.remove = 1;
+ res->res.flags.rename = 1;
+ res->res.flags.move = 1;
+ res->res.flags.read_link = 1;
+ res->res.flags.write_link = 1;
break;
case CDI_FS_CLASS_SPECIAL:
--
1.6.0.6