Better permission handling, add chmod/chown

This commit is contained in:
Mark
2020-01-14 14:07:57 +02:00
parent b47a465770
commit 94aee57638
10 changed files with 123 additions and 27 deletions
+3
View File
@@ -22,3 +22,6 @@ int sys_access(const char *path, int mode);
// TODO: const struct termios *termp, const struct winsize *winp
int sys_openpty(int *master, int *slave);
int sys_chmod(const char *path, mode_t mode);
int sys_chown(const char *path, uid_t uid, gid_t gid);
+2
View File
@@ -45,6 +45,8 @@ struct vnode_operations {
int (*stat) (struct vnode *at, struct stat *st);
int (*access) (struct vnode *node, uid_t *uid, gid_t *gid, mode_t *mode);
int (*chmod) (struct vnode *node, mode_t mode);
int (*chown) (struct vnode *node, uid_t uid, gid_t gid);
int (*readlink) (struct vnode *at, char *buf, size_t lim);
+2
View File
@@ -39,6 +39,8 @@ int vfs_readdir(struct vfs_ioctx *ctx, struct ofile *fd, struct dirent *ent);
int vfs_unlink(struct vfs_ioctx *ctx, const char *path);
int vfs_rmdir(struct vfs_ioctx *ctx, const char *path);
int vfs_mkdir(struct vfs_ioctx *ctx, const char *path, mode_t mode);
int vfs_chmod(struct vfs_ioctx *ctx, const char *path, mode_t mode);
int vfs_chown(struct vfs_ioctx *ctx, const char *path, uid_t uid, gid_t gid);
int vfs_access(struct vfs_ioctx *ctx, const char *path, int accmode);
int vfs_stat(struct vfs_ioctx *ctx, const char *path, struct stat *st);
+2
View File
@@ -13,6 +13,8 @@
#define SYSCALL_NR_CREAT 85
#define SYSCALL_NR_UNLINK 87
#define SYSCALL_NR_READDIR 89
#define SYSCALL_NR_CHMOD 90
#define SYSCALL_NR_CHOWN 92
#define SYSCALL_NR_BRK 12
#define SYSCALL_NR_NANOSLEEP 35