]> granicus.if.org Git - sudo/log
sudo
15 years agoremove vestiges of ZLDFLAGS
Todd C. Miller [Thu, 22 Oct 2009 23:46:40 +0000 (23:46 +0000)]
remove vestiges of ZLDFLAGS

15 years agoAdd missing variable declaration for when TIOCSCTTY is not defined.
Todd C. Miller [Thu, 22 Oct 2009 14:53:13 +0000 (14:53 +0000)]
Add missing variable declaration for when TIOCSCTTY is not defined.
Need to include sys/termio.h for TIOCSCTTY on some systems.

15 years agowhen resuming command, send SIGCONT to its pgrp not just pid
Todd C. Miller [Thu, 22 Oct 2009 13:52:59 +0000 (13:52 +0000)]
when resuming command, send SIGCONT to its pgrp not just pid

15 years agoremove unused variable
Todd C. Miller [Thu, 22 Oct 2009 13:47:43 +0000 (13:47 +0000)]
remove unused variable

15 years agoinclude selinux.h for is_selinux_enabled() proto
Todd C. Miller [Thu, 22 Oct 2009 13:47:32 +0000 (13:47 +0000)]
include selinux.h for is_selinux_enabled() proto

15 years agoDon't use log_error() in the child process.
Todd C. Miller [Thu, 22 Oct 2009 13:40:41 +0000 (13:40 +0000)]
Don't use log_error() in the child process.

15 years agoDo I/O in parent instead of child since the parent can have both
Todd C. Miller [Thu, 22 Oct 2009 00:58:41 +0000 (00:58 +0000)]
Do I/O in parent instead of child since the parent can have both
/dev/tty as well as the pty fds open.  The child just sets things
up and waits for its grandchild and writes the signal description
to the pty master if the command was killed by a signal.

15 years agoMove two struct forward declarations from sudo.h to missing.h
Todd C. Miller [Sun, 18 Oct 2009 17:45:21 +0000 (17:45 +0000)]
Move two struct forward declarations from sudo.h to missing.h

15 years agoMake comment at the top of script_exec() match reality.
Todd C. Miller [Sun, 18 Oct 2009 17:32:44 +0000 (17:32 +0000)]
Make comment at the top of script_exec() match reality.

15 years agoif neither stdin nor stdout is a tty, check stderr
Todd C. Miller [Sun, 18 Oct 2009 15:38:06 +0000 (15:38 +0000)]
if neither stdin nor stdout is a tty, check stderr

15 years agoAdd back dependecy of gram.h on gram.y
Todd C. Miller [Sun, 18 Oct 2009 15:11:59 +0000 (15:11 +0000)]
Add back dependecy of gram.h on gram.y

15 years agoMake transcript mode work as long as we can figure out our tty, even if
Todd C. Miller [Sun, 18 Oct 2009 14:46:01 +0000 (14:46 +0000)]
Make transcript mode work as long as we can figure out our tty, even if
it is not stdin.  We'd like to use /dev/tty but that won't be valid after
the setsid().

15 years agoAdd support for IRIX-style dynamic ptys
Todd C. Miller [Sat, 17 Oct 2009 12:54:07 +0000 (12:54 +0000)]
Add support for IRIX-style dynamic ptys

15 years agoMove alloc.c protos into alloc.h
Todd C. Miller [Sat, 17 Oct 2009 12:17:16 +0000 (12:17 +0000)]
Move alloc.c protos into alloc.h

15 years agoMove prototypes for missing libc functions to missing.h
Todd C. Miller [Sat, 17 Oct 2009 12:14:21 +0000 (12:14 +0000)]
Move prototypes for missing libc functions to missing.h

15 years agoMove prototypes for missing libc functions to missing.h
Todd C. Miller [Sat, 17 Oct 2009 00:03:00 +0000 (00:03 +0000)]
Move prototypes for missing libc functions to missing.h

15 years agoDisable transcript support if no tcsetpgrp until we support older BSD-style
Todd C. Miller [Fri, 16 Oct 2009 13:52:47 +0000 (13:52 +0000)]
Disable transcript support if no tcsetpgrp until we support older BSD-style
job control.

15 years agoBreak out pty code into pty.c
Todd C. Miller [Fri, 16 Oct 2009 13:29:38 +0000 (13:29 +0000)]
Break out pty code into pty.c

15 years agoadd killpg macro if no killpg function
Todd C. Miller [Fri, 16 Oct 2009 12:11:10 +0000 (12:11 +0000)]
add killpg macro if no killpg function

15 years agoPush ptem and ldterm for STERAMS-based systems when allocating a pty.
Todd C. Miller [Fri, 16 Oct 2009 00:07:11 +0000 (00:07 +0000)]
Push ptem and ldterm for STERAMS-based systems when allocating a pty.

15 years agoSprinkle some more O_NOCTTY and call grantpt() before unlockpt()
Todd C. Miller [Thu, 15 Oct 2009 21:48:19 +0000 (21:48 +0000)]
Sprinkle some more O_NOCTTY and call grantpt() before unlockpt()

15 years agoCall tcgetpgrp() in the parent, not the child and have the child spin
Todd C. Miller [Thu, 15 Oct 2009 13:46:11 +0000 (13:46 +0000)]
Call tcgetpgrp() in the parent, not the child and have the child spin
until it is granted.  Fixes a race on darwin.

15 years agoOnly use TIOCNOTTY in the non-setsid case. If no TIOCSCTTY, just
Todd C. Miller [Thu, 15 Oct 2009 13:38:11 +0000 (13:38 +0000)]
Only use TIOCNOTTY in the non-setsid case.  If no TIOCSCTTY, just
reopen slave.

15 years agoIn script mode, if the command is killed by a signal, print the
Todd C. Miller [Wed, 14 Oct 2009 20:04:16 +0000 (20:04 +0000)]
In script mode, if the command is killed by a signal, print the
signal description as well as a core dump notification like the
shell does.

15 years agoAdd check for strsignal() and a simple implementation if it is not there but sys_sigl...
Todd C. Miller [Wed, 14 Oct 2009 20:04:04 +0000 (20:04 +0000)]
Add check for strsignal() and a simple implementation if it is not there but sys_siglist is

15 years agoAdd missing WUNTRACED and store the signal that stopped the grandchild
Todd C. Miller [Wed, 14 Oct 2009 13:37:23 +0000 (13:37 +0000)]
Add missing WUNTRACED and store the signal that stopped the grandchild
in suspended, not signo.

15 years agog/c unused code
Todd C. Miller [Wed, 14 Oct 2009 13:20:24 +0000 (13:20 +0000)]
g/c unused code

15 years agoAssociate the grandchild's pgrp with the tty instead of the child's
Todd C. Miller [Wed, 14 Oct 2009 13:01:04 +0000 (13:01 +0000)]
Associate the grandchild's pgrp with the tty instead of the child's
and just get suspend notifications via SIGCHLD instead of directly.
This fixes a hang with programs that try to set terminal attributes
and is more consistent with how the shell handles things.

15 years agoMove setpgid() of child into the parent side of the fork() where it
Todd C. Miller [Mon, 12 Oct 2009 14:30:46 +0000 (14:30 +0000)]
Move setpgid() of child into the parent side of the fork() where it
belongs.

15 years agofix typo
Todd C. Miller [Sun, 11 Oct 2009 22:02:02 +0000 (22:02 +0000)]
fix typo

15 years agoRun command in its own pgrp (like the shell does) for easier signalling.
Todd C. Miller [Sun, 11 Oct 2009 21:41:36 +0000 (21:41 +0000)]
Run command in its own pgrp (like the shell does) for easier signalling.
No need to relay SIGINT or SIGQUIT to parent, just send to grandchild.
Don't want grandchild stopped events in the child (only termination).
Flush output after suspending grandchild before signalling parent.

15 years agoBack out revision 1.34; the problem lies elsewhere.
Todd C. Miller [Sun, 11 Oct 2009 14:16:22 +0000 (14:16 +0000)]
Back out revision 1.34; the problem lies elsewhere.

15 years agoDon't set stdout to blocking mode when flushing remaining output. It
Todd C. Miller [Sun, 11 Oct 2009 14:13:35 +0000 (14:13 +0000)]
Don't set stdout to blocking mode when flushing remaining output.  It
can cause us to hang when trying to exit.  Need to investigate why.

15 years agoHandle SIGTTOU and remove some debugging.
Todd C. Miller [Sun, 11 Oct 2009 13:25:23 +0000 (13:25 +0000)]
Handle SIGTTOU and remove some debugging.

15 years agoBack out revision 1.10 as the signal that interrupts us may be
Todd C. Miller [Sun, 11 Oct 2009 13:02:06 +0000 (13:02 +0000)]
Back out revision 1.10 as the signal that interrupts us may be
SIGTTOU or SIGTTIN which the caller must handle.

15 years agoApparently we need to send SIGSTOP to the command as well as ourself
Todd C. Miller [Sun, 11 Oct 2009 12:42:03 +0000 (12:42 +0000)]
Apparently we need to send SIGSTOP to the command as well as ourself
when we get SIGTSTP, the kernel doesn't automatically stop the process
for us.

15 years agoUse an extra process to act as the glue bewteen the sessions
Todd C. Miller [Sun, 11 Oct 2009 12:27:11 +0000 (12:27 +0000)]
Use an extra process to act as the glue bewteen the sessions
associated with the user's controlling tty (what the shell uses)
and the tty that sudo is using to do its logging.  Basically, this
means that if we get, e.g. SIGTSTP from the process sudo is running,
we relay the signal to the parent so it's shell can do the job control.

15 years agoHandle getting/setting terminal attributes when the fd is in non-blocking
Todd C. Miller [Sun, 11 Oct 2009 12:24:31 +0000 (12:24 +0000)]
Handle getting/setting terminal attributes when the fd is in non-blocking
mode.

15 years agoAdd support for pausing and changing the speed in interactive mode.
Todd C. Miller [Wed, 7 Oct 2009 01:07:54 +0000 (01:07 +0000)]
Add support for pausing and changing the speed in interactive mode.

15 years agoAlready define O_NOCTTY in compat.h, don't need it here
Todd C. Miller [Wed, 7 Oct 2009 00:17:38 +0000 (00:17 +0000)]
Already define O_NOCTTY in compat.h, don't need it here

15 years agoAdd missing protos
Todd C. Miller [Tue, 6 Oct 2009 13:19:20 +0000 (13:19 +0000)]
Add missing protos

15 years agoAlways update the stashed mtime of the temp file instead of using what
Todd C. Miller [Wed, 30 Sep 2009 13:50:58 +0000 (13:50 +0000)]
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.

15 years agoUse cbreak mode instead of raw mode and add signal handlers to restore
Todd C. Miller [Wed, 30 Sep 2009 02:13:19 +0000 (02:13 +0000)]
Use cbreak mode instead of raw mode and add signal handlers to restore
the tty on interrupt.

15 years agoRetain NL to NLCR conversion on the real tty and skip it on the pty
Todd C. Miller [Wed, 30 Sep 2009 02:12:35 +0000 (02:12 +0000)]
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.

15 years agoFix log_output(); just pass in a string and a length.
Todd C. Miller [Wed, 30 Sep 2009 02:00:16 +0000 (02:00 +0000)]
Fix log_output(); just pass in a string and a length.

15 years agodo not use errno when complaining out lack of a tty
Todd C. Miller [Mon, 28 Sep 2009 11:44:26 +0000 (11:44 +0000)]
do not use errno when complaining out lack of a tty

15 years agoInstead of messing with line endings, just set terminal to raw mode
Todd C. Miller [Sun, 27 Sep 2009 22:39:40 +0000 (22:39 +0000)]
Instead of messing with line endings, just set terminal to raw mode
in sudoreplay.

15 years agoWhen copying the terminal attributes to the pty, be sure not to set ONLCR.
Todd C. Miller [Sun, 27 Sep 2009 22:12:45 +0000 (22:12 +0000)]
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.

15 years agoConvert a do {} while into a while
Todd C. Miller [Sun, 27 Sep 2009 22:11:11 +0000 (22:11 +0000)]
Convert a do {} while into a while

15 years agoUse if then instead of test && when installing binaries that may
Todd C. Miller [Sun, 27 Sep 2009 18:54:08 +0000 (18:54 +0000)]
Use if then instead of test && when installing binaries that may
not exist.

15 years agoAdd O_NOCTTY when opening a tty device.
Todd C. Miller [Sun, 27 Sep 2009 18:34:18 +0000 (18:34 +0000)]
Add O_NOCTTY when opening a tty device.
Explicitly disconnect from old tty before associatng with new one.

15 years agoFirst cut at refactoring some of the selinux code so it can be used
Todd C. Miller [Sun, 27 Sep 2009 13:03:56 +0000 (13:03 +0000)]
First cut at refactoring some of the selinux code so it can be used
in conjunction with sudo's transcript support.

15 years agoFix default case of transcript_enabled being unset.
Todd C. Miller [Sat, 26 Sep 2009 20:25:58 +0000 (20:25 +0000)]
Fix default case of transcript_enabled being unset.

15 years agoUse _PATH_SUDO_TRANSCRIPT instead of _PATH_SUDO_SESSDIR
Todd C. Miller [Sat, 26 Sep 2009 15:41:14 +0000 (15:41 +0000)]
Use _PATH_SUDO_TRANSCRIPT instead of _PATH_SUDO_SESSDIR

15 years agoHook up --disable-transcript and --enable-transcript=DIR
Todd C. Miller [Sat, 26 Sep 2009 15:34:46 +0000 (15:34 +0000)]
Hook up --disable-transcript and --enable-transcript=DIR

15 years ago_PATH_SUDO_SESSDIR -> _PATH_SUDO_TRANSCRIPT
Todd C. Miller [Fri, 25 Sep 2009 20:39:09 +0000 (20:39 +0000)]
_PATH_SUDO_SESSDIR -> _PATH_SUDO_TRANSCRIPT
Add --enable-transcript=DIR option to specify the directory

15 years agoregen
Todd C. Miller [Fri, 25 Sep 2009 01:12:16 +0000 (01:12 +0000)]
regen

15 years agoSubstitute in default value for secure_path
Todd C. Miller [Fri, 25 Sep 2009 01:11:49 +0000 (01:11 +0000)]
Substitute in default value for secure_path

15 years agoMention that the password must be followed by a newline with the -S option.
Todd C. Miller [Fri, 25 Sep 2009 00:31:35 +0000 (00:31 +0000)]
Mention that the password must be followed by a newline with the -S option.

15 years agoGo back to dropping out of the select() loop when the process dies; Linux
Todd C. Miller [Sun, 20 Sep 2009 13:51:51 +0000 (13:51 +0000)]
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.

15 years agoAdd getline.o to COMMON_OBJS
Todd C. Miller [Sat, 19 Sep 2009 19:24:48 +0000 (19:24 +0000)]
Add getline.o to COMMON_OBJS

15 years agosudoreplay depends on libsudo.a
Todd C. Miller [Sat, 19 Sep 2009 19:21:18 +0000 (19:21 +0000)]
sudoreplay depends on libsudo.a

15 years agoMore pwutil.o into COMMON_OBJS
Todd C. Miller [Sat, 19 Sep 2009 19:15:34 +0000 (19:15 +0000)]
More pwutil.o into COMMON_OBJS

15 years agoRemove my_* redirection in pwutil.c for testsudoers and just use the normal
Todd C. Miller [Sat, 19 Sep 2009 19:13:10 +0000 (19:13 +0000)]
Remove my_* redirection in pwutil.c for testsudoers and just use the normal
libc get{pw,gr}* names.

15 years agoMore time and date examples
Todd C. Miller [Sat, 19 Sep 2009 18:26:38 +0000 (18:26 +0000)]
More time and date examples

15 years agoMove nanosleep() emulation into its own file
Todd C. Miller [Sat, 19 Sep 2009 17:44:34 +0000 (17:44 +0000)]
Move nanosleep() emulation into its own file
Check librt.a for nanosleep if we don't find it in libc

15 years agoBuild libsudo with the common bits and link things against that.
Todd C. Miller [Sat, 19 Sep 2009 17:21:14 +0000 (17:21 +0000)]
Build libsudo with the common bits and link things against that.

15 years agoFix final flush.
Todd C. Miller [Sat, 19 Sep 2009 11:43:24 +0000 (11:43 +0000)]
Fix final flush.

15 years agoKeep reading from the pty master -> log file until read returns <= 0.
Todd C. Miller [Sat, 19 Sep 2009 11:35:20 +0000 (11:35 +0000)]
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.

15 years agoUse unbuffered I/O when writing to stdout and make sure we write
Todd C. Miller [Sat, 19 Sep 2009 00:21:27 +0000 (00:21 +0000)]
Use unbuffered I/O when writing to stdout and make sure we write
the entire buffer.

15 years agoOnly use max_wait if it is non-zero
Todd C. Miller [Fri, 18 Sep 2009 14:53:51 +0000 (14:53 +0000)]
Only use max_wait if it is non-zero

15 years agoNeed compat.h here
Todd C. Miller [Fri, 18 Sep 2009 13:18:56 +0000 (13:18 +0000)]
Need compat.h here

15 years agoFix nanosleep emulation
Todd C. Miller [Fri, 18 Sep 2009 13:18:30 +0000 (13:18 +0000)]
Fix nanosleep emulation

15 years agoFix comment after #endif
Todd C. Miller [Fri, 18 Sep 2009 13:18:03 +0000 (13:18 +0000)]
Fix comment after #endif

15 years agoAdd protos for missing libc bits
Todd C. Miller [Fri, 18 Sep 2009 13:08:20 +0000 (13:08 +0000)]
Add protos for missing libc bits

15 years agoadd missing line continuation char
Todd C. Miller [Fri, 18 Sep 2009 13:04:14 +0000 (13:04 +0000)]
add missing line continuation char

15 years agoImplement getline() in terms of fgetln() if we have it.
Todd C. Miller [Fri, 18 Sep 2009 12:23:01 +0000 (12:23 +0000)]
Implement getline() in terms of fgetln() if we have it.

15 years agoPrint year when formatting log line
Todd C. Miller [Fri, 18 Sep 2009 12:12:35 +0000 (12:12 +0000)]
Print year when formatting log line

15 years agoDocument cwd, attempt to document time/date formats.
Todd C. Miller [Fri, 18 Sep 2009 02:05:41 +0000 (02:05 +0000)]
Document cwd, attempt to document time/date formats.

15 years agoFix getline return value check.
Todd C. Miller [Fri, 18 Sep 2009 01:21:12 +0000 (01:21 +0000)]
Fix getline return value check.

15 years agoUse getline() if the system has it, else use provide our own for sudoreplay.
Todd C. Miller [Fri, 18 Sep 2009 01:16:56 +0000 (01:16 +0000)]
Use getline() if the system has it, else use provide our own for sudoreplay.

15 years agoRefactor code to update output and timing files.
Todd C. Miller [Fri, 18 Sep 2009 00:32:32 +0000 (00:32 +0000)]
Refactor code to update output and timing files.

15 years agoMake sudo_getln() behave more like glibc getline.
Todd C. Miller [Thu, 17 Sep 2009 10:22:03 +0000 (10:22 +0000)]
Make sudo_getln() behave more like glibc getline.

15 years agoWhen flushing remaining output, also update timing file.
Todd C. Miller [Thu, 17 Sep 2009 10:14:01 +0000 (10:14 +0000)]
When flushing remaining output, also update timing file.

15 years agoUse get_timestr() and make the -l output look like the regular sudo log.
Todd C. Miller [Thu, 17 Sep 2009 09:56:04 +0000 (09:56 +0000)]
Use get_timestr() and make the -l output look like the regular sudo log.

15 years agoMake get_timestr() take a time_t so we can use it properly in
Todd C. Miller [Thu, 17 Sep 2009 09:55:08 +0000 (09:55 +0000)]
Make get_timestr() take a time_t so we can use it properly in
sudoreplay.

15 years agoCreate session dir earlier now that we update the seq number early.
Todd C. Miller [Thu, 17 Sep 2009 09:54:33 +0000 (09:54 +0000)]
Create session dir earlier now that we update the seq number early.

15 years agoUse fromdate and todate as the keywords instead of from and to; the short
Todd C. Miller [Wed, 16 Sep 2009 13:36:29 +0000 (13:36 +0000)]
Use fromdate and todate as the keywords instead of from and to; the short
forms will still be accepted.

15 years agoFix reading long liensin sudo_getln()
Todd C. Miller [Wed, 16 Sep 2009 12:01:32 +0000 (12:01 +0000)]
Fix reading long liensin sudo_getln()

15 years agoLog the cwd in the script log file.
Todd C. Miller [Wed, 16 Sep 2009 11:49:40 +0000 (11:49 +0000)]
Log the cwd in the script log file.
Add sudo_getln() to read arbitrarily long lines.

15 years agoMove get_timestr() into its own source file so sudoreplay can use it.
Todd C. Miller [Wed, 16 Sep 2009 11:48:34 +0000 (11:48 +0000)]
Move get_timestr() into its own source file so sudoreplay can use it.

15 years agoAdd to and from perdicates (date ranges); needs documentation
Todd C. Miller [Tue, 15 Sep 2009 00:24:43 +0000 (00:24 +0000)]
Add to and from perdicates (date ranges); needs documentation

15 years agoFix warning and add generated getdate.c
Todd C. Miller [Mon, 14 Sep 2009 13:19:47 +0000 (13:19 +0000)]
Fix warning and add generated getdate.c

15 years agoAdd getdate.y to be used for sudoreplay date parsing.
Todd C. Miller [Mon, 14 Sep 2009 13:16:06 +0000 (13:16 +0000)]
Add getdate.y to be used for sudoreplay date parsing.

15 years agoCheck more than just the first character of a predicate
Todd C. Miller [Sun, 13 Sep 2009 22:36:34 +0000 (22:36 +0000)]
Check more than just the first character of a predicate

15 years agoAdd examples, sort predicates
Todd C. Miller [Sun, 13 Sep 2009 22:30:48 +0000 (22:30 +0000)]
Add examples, sort predicates

15 years agoImplement search expressions in sudoreplay similar in concept to
Todd C. Miller [Sun, 13 Sep 2009 22:02:07 +0000 (22:02 +0000)]
Implement search expressions in sudoreplay similar in concept to
what find or tcpdump uses.  TODO: date ranges

15 years agoRemove vhangup as it was hanging up the wrong tty. Should really
Todd C. Miller [Mon, 7 Sep 2009 15:07:48 +0000 (15:07 +0000)]
Remove vhangup as it was hanging up the wrong tty.  Should really
vhangup in the child after it as set its tty.

15 years agoFix cut at documenting transcript support.
Todd C. Miller [Mon, 7 Sep 2009 14:21:09 +0000 (14:21 +0000)]
Fix cut at documenting transcript support.

15 years agoID= -> TSID= for transcript ID
Todd C. Miller [Mon, 7 Sep 2009 14:18:06 +0000 (14:18 +0000)]
ID= -> TSID= for transcript ID