Log the cwd in the script log file.

Add sudo_getln() to read arbitrarily long lines.
This commit is contained in:
Todd C. Miller
2009-09-16 11:49:40 +00:00
parent 28b3a18137
commit a418f78117
2 changed files with 63 additions and 14 deletions

View File

@@ -330,9 +330,10 @@ script_execv(path, argv)
gettimeofday(&prevtime, NULL);
/* XXX - log more stuff to idfile (like normal log line?) */
/* XXX - log more stuff? environment too? */
fprintf(idfile, "%ld:%s:%s:%s:%s\n", prevtime.tv_sec, user_name,
runas_pw->pw_name, runas_gr ? runas_gr->gr_name : "", user_tty);
fprintf(idfile, "%s\n", user_cwd);
fprintf(idfile, "%s%s%s\n", user_cmnd, user_args ? " " : "",
user_args ? user_args : "");
fclose(idfile);