Store information about a client connection
#include <sys/neutrino.h>
int ConnectClientInfo( int scoid,
struct _client_info * info
int ngroups );
int ConnectClientInfo_r( int scoid,
struct _client_info * info
int ngroups );
libc
The ConnectClientInfo() and ConnectClientInfo_r() functions are identical except in the way they indicate errors. See the Returns section for details.
These calls store information about a client connection identified by process scoid in the info buffer. Each scoid refers to a particular process. The scoid is obtained from the struct _msg_info argument to MsgReceivev() or MsgInfo().
The parameters returned in info have at least the following members:
| Member | Description |
|---|---|
| uint32_t nd | Client's node ID |
| pid_t pid | Client's process ID |
| struct _cred_info cred | User and group ID credentials |
The cred member has at least the following members:
| Member | Description |
|---|---|
| uid_t ruid | Real user-ID of sending process. |
| uid_t euid | Effective user-ID of sending process. |
| uid_t suid | Saved user-ID of sending process. |
| gid_t rgid | Real group-ID of sending process. |
| gid_t egid | Effective group-ID of sending process. |
| gid_t sgid | Saved group-ID of sending process. |
| uint32_t ngroups | Number of groups in grouplist. |
| gid_t grouplist[NGROUPS_MAX] | Supplementary group-IDs of sending process. |
The ngroups argument indicates the size of the callers grouplist in the credential. Making it smaller than NGROUPS_MAX may result in a subset of the groups being returned. If the group array size is zero, the number of groups available in info.cred.ngroups is returned.
This call is used by a server to check if a client has permissions to access a resource. In a resource manager, it would be called on an open() request.
The nd (node descriptor) is a magic cookie.
| To: | Use this function: |
|---|---|
| Compare two nd objects | ND_NODE_CMP() |
| Convert a nd to text | netmgr_ndtostr() |
| Convert text to a nd | netmgr_strtond() |
The only difference between these functions is the way they indicate errors:
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |
ConnectServerInfo(), MsgInfo(), MsgReceivev(), ND_NODE_CMP(), netmgr_ndtostr(), netmgr_remote_nd(), netmgr_strtond()