mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
auth: network
This commit is contained in:
@@ -4,12 +4,14 @@
|
||||
#include <kernel/cred.h>
|
||||
#include <kernel/vfs.h>
|
||||
#include <kernel/scheduler.h>
|
||||
#include <kernel/sock.h>
|
||||
|
||||
#define AUTH_SCOPE_COUNT 4
|
||||
#define AUTH_SCOPE_COUNT 5
|
||||
#define AUTH_SCOPE_SYSTEM 0
|
||||
#define AUTH_SCOPE_FILESYSTEM 1
|
||||
#define AUTH_SCOPE_CRED 2
|
||||
#define AUTH_SCOPE_PROCESS 3
|
||||
#define AUTH_SCOPE_NETWORK 4
|
||||
|
||||
#define AUTH_LISTENER_LIMIT 8
|
||||
|
||||
@@ -37,6 +39,8 @@
|
||||
|
||||
#define AUTH_ACTIONS_PROCESS_SIGNAL 1
|
||||
|
||||
#define AUTH_ACTIONS_NETWORK_CONFIGURE 1
|
||||
|
||||
typedef int (*authlistener_t)(cred_t *cred, int actions, void *arg0, void *arg1, void *arg2);
|
||||
|
||||
typedef struct {
|
||||
@@ -62,6 +66,10 @@ static inline int auth_process_check(cred_t *cred, int actions, proc_t *proc) {
|
||||
return auth_check(AUTH_SCOPE_PROCESS, cred, actions, proc, NULL, NULL);
|
||||
}
|
||||
|
||||
static inline int auth_network_check(cred_t *cred, int actions, socket_t *socket, netdev_t *netdev) {
|
||||
return auth_check(AUTH_SCOPE_NETWORK, cred, actions, socket, netdev, NULL);
|
||||
}
|
||||
|
||||
static inline int auth_filesystem_convertaccess(int access) {
|
||||
int r = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user