XenevaOS
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
_kecred.h File Reference
#include <_xeneva.h>
#include <stdint.h>
Include dependency graph for _kecred.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GID_NUM   int
 
#define UID_NUM   int
 
#define GID_GLOBAL_NET_COUNT   4
 
#define GID_GLOBAL_IPC_COUNT   4
 
#define GID_GLOBAL_MISC_COUNT   4
 
#define GID_GLOBAL_NET   0
 
#define GID_GLOBAL_IPC   GID_GLOBAL_NET_COUNT
 
#define GID_GLOBAL_MISC   (GID_GLOBAL_NET_COUNT + GID_GLOBAL_IPC_COUNT)
 

Enumerations

enum  _gid_entries_ {
  AURORA_GID_NET_SOCKET = GID_GLOBAL_NET , AURORA_GID_NET_RAW , AURORA_GID_NET_ADMIN , AURORA_GID_NET_MONITOR ,
  AURORA_GID_IPC_POSTBOX = GID_GLOBAL_IPC , AURORA_GID_IPC_SHARED , AURORA_GID_IPC_SIGNAL , AURORA_GID_IPC_PIPE ,
  AURORA_GID_MISC_WORLD = GID_GLOBAL_MISC , AURORA_GID_MISC_USERS , AURORA_GID_MISC_ADMIN , AURORA_GID_MISC_DAEMONS
}
 

Functions

XE_LIB int _KeCredChangeID (int fd, UID_NUM uid, GID_NUM gid)
 _KeCredChangeID – change credential ids
 
XE_LIB int _KeCredAddSGroup (int proc_id, int sgid)
 _KeCredAddSGroup – add supplimentary gid to process
 
XE_LIB int _KeCredSetCap (int proc_id, int cap)
 
XE_LIB int _KeCredGetCap (int proc_id)
 
XE_LIB int _KeSetUID (int proc_id, UID_NUM uid)
 _KeSetUID – change user id of a process
 
XE_LIB int _KeSetGID (int proc_id, GID_NUM gid)
 _KeSetGID – change user id of a process
 
XE_LIB GID_NUM _KeGetGlobalGroupID (uint8_t category)
 _KeGetGlobalGroupID – return a group id number
 

Detailed Description

BSD 2-Clause License

Copyright (c) 2022-2026, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ GID_GLOBAL_IPC

#define GID_GLOBAL_IPC   GID_GLOBAL_NET_COUNT

◆ GID_GLOBAL_IPC_COUNT

#define GID_GLOBAL_IPC_COUNT   4

◆ GID_GLOBAL_MISC

#define GID_GLOBAL_MISC   (GID_GLOBAL_NET_COUNT + GID_GLOBAL_IPC_COUNT)

◆ GID_GLOBAL_MISC_COUNT

#define GID_GLOBAL_MISC_COUNT   4

◆ GID_GLOBAL_NET

#define GID_GLOBAL_NET   0

offset based category

◆ GID_GLOBAL_NET_COUNT

#define GID_GLOBAL_NET_COUNT   4

◆ GID_NUM

#define GID_NUM   int

◆ UID_NUM

#define UID_NUM   int

Enumeration Type Documentation

◆ _gid_entries_

this are category entry, each category will have its own group id

Enumerator
AURORA_GID_NET_SOCKET 
AURORA_GID_NET_RAW 
AURORA_GID_NET_ADMIN 
AURORA_GID_NET_MONITOR 
AURORA_GID_IPC_POSTBOX 
AURORA_GID_IPC_SHARED 
AURORA_GID_IPC_SIGNAL 
AURORA_GID_IPC_PIPE 
AURORA_GID_MISC_WORLD 
AURORA_GID_MISC_USERS 
AURORA_GID_MISC_ADMIN 
AURORA_GID_MISC_DAEMONS 

Function Documentation

◆ _KeCredAddSGroup()

XE_LIB int _KeCredAddSGroup ( int  proc_id,
int  sgid 
)

_KeCredAddSGroup – add supplimentary gid to process

Parameters
proc_id– process id to set
sgid– sgid number

◆ _KeCredChangeID()

XE_LIB int _KeCredChangeID ( int  fd,
UID_NUM  uid,
GID_NUM  gid 
)

_KeCredChangeID – change credential ids

Parameters
fd– file descriptor
uid– user id
gid– groupd id number

◆ _KeCredGetCap()

XE_LIB int _KeCredGetCap ( int  proc_id)

_KeCredGetCap – get capabilities of desired process

Parameters
proc_id– process id, zero for current process, zero = current

◆ _KeCredSetCap()

XE_LIB int _KeCredSetCap ( int  proc_id,
int  cap 
)

_KeCredSetCap – add capability to a process

Parameters
proc_id– process id, zero for current process, zero = current
cap– capability to add

◆ _KeGetGlobalGroupID()

XE_LIB GID_NUM _KeGetGlobalGroupID ( uint8_t  category)

_KeGetGlobalGroupID – return a group id number

Parameters
category– category id

◆ _KeSetGID()

XE_LIB int _KeSetGID ( int  proc_id,
GID_NUM  gid 
)

_KeSetGID – change user id of a process

Parameters
proc– Process id to change their uid, zero = current
uid– User id

◆ _KeSetUID()

XE_LIB int _KeSetUID ( int  proc_id,
UID_NUM  uid 
)

_KeSetUID – change user id of a process

Parameters
proc– Process id to change their uid, zero = current
uid– User id