diff -r 4ef475f992a8 trunk/src/modules/cdi/lib/fs/lostio_if.c --- a/trunk/src/modules/cdi/lib/fs/lostio_if.c Sat May 23 11:21:04 2009 +0200 +++ b/trunk/src/modules/cdi/lib/fs/lostio_if.c Sat May 23 16:53:18 2009 +0200 @@ -294,6 +294,9 @@ memset(&stream, 0, sizeof(stream)); stream.fs = parent_stream->fs; + if( !parent_stream->res->flags.create_child ) { + goto out_err; + } if (!parent_stream->res->dir->create_child(&stream, child_name, parent_stream->res)) { @@ -383,6 +386,10 @@ goto out; } + if (!dh->res->flags.read) { + goto out; + } + size = bs * bc; if (size > fh->node->size - fh->pos) { size = fh->node->size - fh->pos; @@ -418,6 +425,10 @@ goto out; } + if(!stream->res->flags.write) { + goto out; + } + result = stream->res->file->write(stream, fh->pos, size, data); fh->pos += size; @@ -486,6 +497,11 @@ */ static int cdi_remove_res(struct cdi_fs_stream* stream) { + if (!stream->res->flags.remove) + { + return -1; + } + if (stream->res->file && !stream->res->res->remove_class(stream,CDI_FS_CLASS_FILE)) { @@ -561,6 +577,10 @@ goto out; } + if (!dh->res->flags.read_link) { + goto out; + } + link = dh->res->link->read_link(dh); if (size > strlen(link) + 1) { size = strlen(link) + 1; @@ -589,6 +609,10 @@ goto out; } + if (!stream->res->flags.write_link) { + goto out; + } + if (stream->res->link->write_link(stream, data)) { result = size; }