diff options
Diffstat (limited to 'src/client.c')
-rw-r--r-- | src/client.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/client.c b/src/client.c index 5b3b161b5..f3e2b32a4 100644 --- a/src/client.c +++ b/src/client.c @@ -72,8 +72,13 @@ struct client { char buffer[CLIENT_MAX_BUFFER_LENGTH]; size_t bufferLength; size_t bufferPos; + int fd; /* file descriptor; -1 if expired */ int permission; + + /** the uid of the client process, or -1 if unknown */ + int uid; + time_t lastTime; struct strnode *cmd_list; /* for when in list mode */ struct strnode *cmd_list_tail; /* for when in list mode */ @@ -147,6 +152,11 @@ int client_is_expired(const struct client *client) return client->fd < 0; } +int client_get_uid(const struct client *client) +{ + return client->uid; +} + int client_get_permission(const struct client *client) { return client->permission; @@ -323,7 +333,7 @@ sockaddr_to_tmp_string(const struct sockaddr *addr) return hostname; } -void client_new(int fd, const struct sockaddr *addr) +void client_new(int fd, const struct sockaddr *addr, int uid) { struct client *client; @@ -337,6 +347,7 @@ void client_new(int fd, const struct sockaddr *addr) list_add(&client->siblings, &clients); ++num_clients; client_init(client, fd); + client->uid = uid; SECURE("client %i: opened from %s\n", client->num, sockaddr_to_tmp_string(addr)); } |