const char *iolog_path;
struct passwd *runas_pw;
struct group *runas_gr;
+ int lines;
+ int cols;
int iolog_stdin;
int iolog_stdout;
int iolog_stderr;
debug_decl(iolog_deserialize_info, SUDO_DEBUG_UTIL)
memset(details, 0, sizeof(*details));
+ details->lines = 24;
+ details->cols = 80;
for (cur = user_info; *cur != NULL; cur++) {
switch (**cur) {
case 'c':
+ if (strncmp(*cur, "cols=", sizeof("cols=") - 1) == 0) {
+ details->cols = atoi(*cur + sizeof("cols=") - 1);
+ continue;
+ }
if (strncmp(*cur, "cwd=", sizeof("cwd=") - 1) == 0) {
details->cwd = *cur + sizeof("cwd=") - 1;
continue;
}
break;
+ case 'l':
+ if (strncmp(*cur, "lines=", sizeof("lines=") - 1) == 0) {
+ details->lines = atoi(*cur + sizeof("lines=") - 1);
+ continue;
+ }
+ break;
case 't':
if (strncmp(*cur, "tty=", sizeof("tty=") - 1) == 0) {
details->tty = *cur + sizeof("tty=") - 1;
gettimeofday(&last_time, NULL);
- fprintf(io_logfile, "%ld:%s:%s:%s:%s\n", (long)last_time.tv_sec,
+ fprintf(io_logfile, "%ld:%s:%s:%s:%s:%d:%d\n", (long)last_time.tv_sec,
details.user ? details.user : "unknown", details.runas_pw->pw_name,
details.runas_gr ? details.runas_gr->gr_name : "",
- details.tty ? details.tty : "unknown");
+ details.tty ? details.tty : "unknown", details.lines, details.cols);
fputs(details.cwd ? details.cwd : "unknown", io_logfile);
fputc('\n', io_logfile);
fputs(details.command ? details.command : "unknown", io_logfile);