mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-29 21:58:20 +00:00
vfs: pass cred to ioctl
This commit is contained in:
@@ -132,7 +132,7 @@ static int write(int minor, void *buffer, size_t size, uintmax_t offset, int fla
|
||||
return rwblock(minor, buffer, size, offset, flags, true, writec);
|
||||
}
|
||||
|
||||
static int ioctl(int minor, unsigned long request, void *arg, int *result) {
|
||||
static int ioctl(int minor, unsigned long request, void *arg, int *result, cred_t *cred) {
|
||||
blockdesc_t *desc = getdesc(minor);
|
||||
if (desc == NULL)
|
||||
return ENODEV;
|
||||
|
||||
+1
-1
@@ -169,7 +169,7 @@ static int munmap(int minor, void *addr, uintmax_t offset, int flags) {
|
||||
#define FBIOGET_FSCREENINFO 0x4602
|
||||
#define FBIOBLANK 0x4611
|
||||
|
||||
static int ioctl(int minor, unsigned long request, void *arg, int *result){
|
||||
static int ioctl(int minor, unsigned long request, void *arg, int *result, cred_t *cred){
|
||||
if (minor >= count)
|
||||
return ENODEV;
|
||||
|
||||
|
||||
+2
-2
@@ -192,7 +192,7 @@ static int poll(int minor, polldata_t *data, int events) {
|
||||
return revents;
|
||||
}
|
||||
#define TIOCGPTN 0x80045430
|
||||
static int ioctl(int minor, unsigned long request, void *_arg, int *result) {
|
||||
static int ioctl(int minor, unsigned long request, void *_arg, int *result, cred_t *cred) {
|
||||
pty_t *pty = ptyget(minor);
|
||||
if (pty == NULL)
|
||||
return ENODEV;
|
||||
@@ -202,7 +202,7 @@ static int ioctl(int minor, unsigned long request, void *_arg, int *result) {
|
||||
return USERCOPY_POSSIBLY_TO_USER(_arg, &pty->minor, sizeof(int));
|
||||
}
|
||||
default:
|
||||
return tty_ioctl(pty->tty, request, _arg, result);
|
||||
return tty_ioctl(pty->tty, request, _arg, result, cred);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
+3
-3
@@ -299,7 +299,7 @@ static int poll(int minor, polldata_t *data, int events) {
|
||||
#define TTY_IOCTL_NAME 0x771101141113l
|
||||
#define TTY_NAME_MAX 32
|
||||
|
||||
int tty_ioctl(tty_t *tty, unsigned long req, void *arg, int *result) {
|
||||
int tty_ioctl(tty_t *tty, unsigned long req, void *arg, int *result, cred_t *cred) {
|
||||
switch (req) {
|
||||
case TIOCGWINSZ:
|
||||
return USERCOPY_POSSIBLY_TO_USER(arg, &tty->winsize, sizeof(winsize_t));
|
||||
@@ -359,12 +359,12 @@ int tty_ioctl(tty_t *tty, unsigned long req, void *arg, int *result) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ioctl(int minor, unsigned long req, void *arg, int *result) {
|
||||
static int ioctl(int minor, unsigned long req, void *arg, int *result, cred_t *cred) {
|
||||
tty_t *tty = ttyget(minor);
|
||||
if (tty == NULL)
|
||||
return ENODEV;
|
||||
|
||||
return tty_ioctl(tty, req, arg, result);
|
||||
return tty_ioctl(tty, req, arg, result, cred);
|
||||
}
|
||||
|
||||
static int isatty(int minor) {
|
||||
|
||||
Reference in New Issue
Block a user