Commit Graph

4626 Commits

Author SHA1 Message Date
Todd C. Miller
3a343d499c Handle getting/setting terminal attributes when the fd is in non-blocking
mode.
2009-10-11 12:24:31 +00:00
Todd C. Miller
55434759f6 Add support for pausing and changing the speed in interactive mode. 2009-10-07 01:07:54 +00:00
Todd C. Miller
50b62b694d Already define O_NOCTTY in compat.h, don't need it here 2009-10-07 00:17:38 +00:00
Todd C. Miller
c8e048c208 Add missing protos 2009-10-06 13:19:20 +00:00
Todd C. Miller
378d15f8fc Always update the stashed mtime of the temp file instead of using what
we have for the original because the time resolution of the filesystem the
temporary is on may not match that of the filesystem that holds the original.
Should fix bz #371 found by Philippe Levan.
2009-09-30 13:50:58 +00:00
Todd C. Miller
5636a93f58 Use cbreak mode instead of raw mode and add signal handlers to restore
the tty on interrupt.
2009-09-30 02:13:19 +00:00
Todd C. Miller
fe9fc5ad1b Retain NL to NLCR conversion on the real tty and skip it on the pty
we allocate.  That way, if stdout is not a pty there are no extra carriage
returns.
2009-09-30 02:12:35 +00:00
Todd C. Miller
e6331c0773 Fix log_output(); just pass in a string and a length. 2009-09-30 02:00:16 +00:00
Todd C. Miller
8e4379b264 do not use errno when complaining out lack of a tty 2009-09-28 11:44:26 +00:00
Todd C. Miller
0d9e1e7b6d Instead of messing with line endings, just set terminal to raw mode
in sudoreplay.
2009-09-27 22:39:40 +00:00
Todd C. Miller
929f13fdfc When copying the terminal attributes to the pty, be sure not to set ONLCR.
This prevents extra carriage returns from ending up in the script output file.
2009-09-27 22:12:45 +00:00
Todd C. Miller
577fb346fd Convert a do {} while into a while 2009-09-27 22:11:11 +00:00
Todd C. Miller
672d0f592e Use if then instead of test && when installing binaries that may
not exist.
2009-09-27 18:54:08 +00:00
Todd C. Miller
4283bbcb2f Add O_NOCTTY when opening a tty device.
Explicitly disconnect from old tty before associatng with new one.
2009-09-27 18:34:18 +00:00
Todd C. Miller
7d19478501 First cut at refactoring some of the selinux code so it can be used
in conjunction with sudo's transcript support.
2009-09-27 13:03:56 +00:00
Todd C. Miller
c6a8c71d2b Fix default case of transcript_enabled being unset. 2009-09-26 20:25:58 +00:00
Todd C. Miller
d111b0d9bb Use _PATH_SUDO_TRANSCRIPT instead of _PATH_SUDO_SESSDIR 2009-09-26 15:41:14 +00:00
Todd C. Miller
8a6dcebd8a Hook up --disable-transcript and --enable-transcript=DIR 2009-09-26 15:34:46 +00:00
Todd C. Miller
0e823cdad2 _PATH_SUDO_SESSDIR -> _PATH_SUDO_TRANSCRIPT
Add --enable-transcript=DIR option to specify the directory
2009-09-25 20:39:09 +00:00
Todd C. Miller
c4fa5baa1c regen 2009-09-25 01:12:16 +00:00
Todd C. Miller
104a402b6a Substitute in default value for secure_path 2009-09-25 01:11:49 +00:00
Todd C. Miller
d8422c4fff Mention that the password must be followed by a newline with the -S option. 2009-09-25 00:31:35 +00:00
Todd C. Miller
7bb38284b0 Go back to dropping out of the select() loop when the process dies; Linux
ptys apparently don't behave the same as BSD in regards to select().
No need to flush remaining output to the transcript, only to stdout.
Add back code to check the master pty for additional data when we exit
the main select loop.
2009-09-20 13:51:51 +00:00
Todd C. Miller
b008f3fda8 Add getline.o to COMMON_OBJS 2009-09-19 19:24:48 +00:00
Todd C. Miller
16a495c6c7 sudoreplay depends on libsudo.a 2009-09-19 19:21:18 +00:00
Todd C. Miller
6c4eea59e7 More pwutil.o into COMMON_OBJS 2009-09-19 19:15:34 +00:00
Todd C. Miller
e56d4af8fd Remove my_* redirection in pwutil.c for testsudoers and just use the normal
libc get{pw,gr}* names.
2009-09-19 19:13:10 +00:00
Todd C. Miller
2950b0c759 More time and date examples 2009-09-19 18:26:38 +00:00
Todd C. Miller
6794ef5323 Move nanosleep() emulation into its own file
Check librt.a for nanosleep if we don't find it in libc
2009-09-19 17:44:34 +00:00
Todd C. Miller
2752268c9b Build libsudo with the common bits and link things against that. 2009-09-19 17:21:14 +00:00
Todd C. Miller
f68a24fb3b Fix final flush. 2009-09-19 11:43:24 +00:00
Todd C. Miller
3223231b1f Keep reading from the pty master -> log file until read returns <= 0.
Do our best to write everything to stdout when flushing any remaining bits.
2009-09-19 11:35:20 +00:00
Todd C. Miller
7de6bbcfd5 Use unbuffered I/O when writing to stdout and make sure we write
the entire buffer.
2009-09-19 00:21:27 +00:00
Todd C. Miller
6744c573b9 Only use max_wait if it is non-zero 2009-09-18 14:53:51 +00:00
Todd C. Miller
b241a9e2d8 Need compat.h here 2009-09-18 13:18:56 +00:00
Todd C. Miller
680351cb9b Fix nanosleep emulation 2009-09-18 13:18:30 +00:00
Todd C. Miller
3cc02be8aa Fix comment after #endif 2009-09-18 13:18:03 +00:00
Todd C. Miller
b9f4db8951 Add protos for missing libc bits 2009-09-18 13:08:20 +00:00
Todd C. Miller
54e38658df add missing line continuation char 2009-09-18 13:04:14 +00:00
Todd C. Miller
f17c6df8e2 Implement getline() in terms of fgetln() if we have it. 2009-09-18 12:23:01 +00:00
Todd C. Miller
89fa08f7e6 Print year when formatting log line 2009-09-18 12:12:35 +00:00
Todd C. Miller
7011be08ea Document cwd, attempt to document time/date formats. 2009-09-18 02:05:41 +00:00
Todd C. Miller
fb0fb0380b Fix getline return value check. 2009-09-18 01:21:12 +00:00
Todd C. Miller
40114c9ba1 Use getline() if the system has it, else use provide our own for sudoreplay. 2009-09-18 01:16:56 +00:00
Todd C. Miller
798867ed27 Refactor code to update output and timing files. 2009-09-18 00:32:32 +00:00
Todd C. Miller
1a537514dc Make sudo_getln() behave more like glibc getline. 2009-09-17 10:22:03 +00:00
Todd C. Miller
74844b1787 When flushing remaining output, also update timing file. 2009-09-17 10:14:01 +00:00
Todd C. Miller
4421db631f Use get_timestr() and make the -l output look like the regular sudo log. 2009-09-17 09:56:04 +00:00
Todd C. Miller
3fe7ac2b95 Make get_timestr() take a time_t so we can use it properly in
sudoreplay.
2009-09-17 09:55:08 +00:00
Todd C. Miller
88a063b047 Create session dir earlier now that we update the seq number early. 2009-09-17 09:54:33 +00:00