1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
diff -uNr -r sudo-1.6.9p13.orig/logging.c sudo-1.6.9p13/logging.c
--- sudo-1.6.9p13.orig/logging.c 2007-11-25 14:07:38.000000000 +0100
+++ sudo-1.6.9p13/logging.c 2008-05-22 14:40:04.000000000 +0200
@@ -313,9 +313,9 @@
strlcat(evstr, " ", len); /* NOTE: last one will fail */
}
}
- easprintf(&logline, "%sTTY=%s ; PWD=%s ; USER=%s%s ; COMMAND=%s%s%s",
+ easprintf(&logline, "%sTTY=%s ; PWD=%s ; USER=%s%s ; COMMAND=%s%s%s ; SSH_CLIENT=%s",
message, user_tty, user_cwd, *user_runas, evstr ? evstr : "",
- user_cmnd, user_args ? " " : "", user_args ? user_args : "");
+ user_cmnd, user_args ? " " : "", user_args ? user_args : "", user_ssh_client ? user_ssh_client : "" );
mail_auth(status, logline); /* send mail based on status */
diff -uNr -r sudo-1.6.9p13.orig/sudo.c sudo-1.6.9p13/sudo.c
--- sudo-1.6.9p13.orig/sudo.c 2008-02-09 15:44:48.000000000 +0100
+++ sudo-1.6.9p13/sudo.c 2008-05-22 14:37:03.000000000 +0200
@@ -568,6 +568,8 @@
user_prompt = *ep + 12;
else if (strncmp("SUDO_USER=", *ep, 10) == 0)
prev_user = *ep + 10;
+ else if (strncmp("SSH_CLIENT=", *ep, 11) == 0)
+ user_ssh_client = *ep + 11;
break;
}
diff -uNr -r sudo-1.6.9p13.orig/sudo.h sudo-1.6.9p13/sudo.h
--- sudo-1.6.9p13.orig/sudo.h 2008-02-09 15:44:48.000000000 +0100
+++ sudo-1.6.9p13/sudo.h 2008-05-22 14:40:36.000000000 +0200
@@ -38,6 +38,7 @@
struct stat *cmnd_stat;
char *path;
char *shell;
+ char *user_ssh_client;
char *tty;
char *ttypath;
char cwd[PATH_MAX];
@@ -136,6 +137,7 @@
#define user_gid (sudo_user.pw->pw_gid)
#define user_dir (sudo_user.pw->pw_dir)
#define user_shell (sudo_user.shell)
+#define user_ssh_client (sudo_user.user_ssh_client)
#define user_ngroups (sudo_user.ngroups)
#define user_groups (sudo_user.groups)
#define user_tty (sudo_user.tty)
|