Displaying 1 result from an estimated 1 matches for "inform_cmdlin".
Did you mean:
inform_cmdline
2007 Aug 21
1
ssh-agent security
...lifetime = 0;
+static int run_inform = 0;
+char inform_cmd[MAXPATHLEN];
+
static void
close_socket(SocketEntry *e)
{
@@ -247,6 +250,28 @@
MD5_CTX md;
Key *key;
+#if defined(SO_PEERCRED)
+ if (AUTH_CONNECTION == e->type) {
+ struct ucred cred;
+ socklen_t len = sizeof(cred);
+ char inform_cmdline[MAXPATHLEN];
+
+ if (run_inform && getsockopt(e->fd, SOL_SOCKET, SO_PEERCRED, &cred, &len) >= 0) {
+ int ret;
+
+ snprintf(inform_cmdline, sizeof inform_cmdline, "%s %d",
+ inform_cmd, cred.pid);
+ ret = system(inform_cmdline);
+ if (ret != 0) {
+ cl...