royzah commented on code in PR #20417: URL: https://github.com/apache/nuttx/pull/20417#discussion_r4162883609
########## include/nuttx/fs/fs.h: ########## @@ -147,6 +147,11 @@ #define INODE_IS_NAMEDEVENT(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_NAMEDEVENT) #define INODE_IS_HARDLINK(i) INODE_IS_TYPE(i,FSNODEFLAG_TYPE_HARDLINK) +#define FSNODEFLAG_RAWIO 0x00000010 /* Raw storage access */ Review Comment: yep, dropped it already. open() just checks BLOCK or MTD now ########## drivers/bch/bchdev_driver.c: ########## @@ -122,6 +123,11 @@ static int bch_open(FAR struct file *filep) FAR struct bchlib_s *bch; int ret = OK; + if (!nxsched_capable(PR_CAP_RAWIO)) Review Comment: hmm that one only catches BLOCK/MTD. a node from bchdev_register() is a plain char driver, so file_vopen can't tell its raw storage. so bch_open() covers that case ########## fs/mount/fs_umount2.c: ########## @@ -62,6 +63,11 @@ int nx_umount2(FAR const char *target, unsigned int flags) struct inode_search_s desc; int ret; + if (!nxsched_capable(PR_CAP_RAWIO)) Review Comment: good call, done. all RAWIO is one commit now (open, BCH, mount, umount2), same for SPAWN and ADMIN ########## fs/mount/fs_mount.c: ########## @@ -304,6 +305,11 @@ int nx_mount(FAR const char *source, FAR const char *target, FAR void *fshandle = NULL; int ret; + if (!nxsched_capable(PR_CAP_RAWIO)) Review Comment: same commit now ########## binfmt/binfmt_exec.c: ########## @@ -86,6 +87,11 @@ static int exec_internal(FAR const char *filename, int pid; int ret; + if (!nxsched_capable(PR_CAP_SPAWN)) Review Comment: exec_internal is the one spot posix_spawn, execve and exec() all hit. if it go to sched/posix_spawn, exec() need its own copy -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
