agent: Add option to open socket as specific user

This can prevent an attack where user A passes the path to user B's
ssh-agent socket to the daemon that is running as root.
This commit is contained in:
Tobias Brunner
2025-12-10 18:34:19 +01:00
parent a768f57286
commit 8b467ad39a
5 changed files with 100 additions and 12 deletions
+6
View File
@@ -50,6 +50,12 @@ typedef struct capabilities_t capabilities_t;
#ifndef CAP_SETPCAP
# define CAP_SETPCAP 8
#endif
#ifndef CAP_SETUID
# define CAP_SETUID 7
#endif
#ifndef CAP_SETGID
# define CAP_SETGID 6
#endif
/**
* POSIX capability dropping abstraction layer.