File: sudoreplay.cat

package info (click to toggle)
sudo 1.7.4p4-2.squeeze.6
  • links: PTS
  • area: main
  • in suites: squeeze-lts
  • size: 8,948 kB
  • ctags: 4,726
  • sloc: ansic: 22,982; sh: 15,240; yacc: 1,481; lex: 1,033; makefile: 547; perl: 366
file content (330 lines) | stat: -rw-r--r-- 12,306 bytes parent folder | download | duplicates (2)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330



SUDOREPLAY(1m)         MAINTENANCE COMMANDS        SUDOREPLAY(1m)


NNAAMMEE
       sudoreplay - replay sudo session logs

SSYYNNOOPPSSIISS
       ssuuddoorreeppllaayy [--dd _d_i_r_e_c_t_o_r_y] [--ff _f_i_l_t_e_r] [--mm _m_a_x___w_a_i_t] [--ss _s_p_e_e_d___f_a_c_t_o_r]
       ID

       ssuuddoorreeppllaayy [--dd _d_i_r_e_c_t_o_r_y] -l [search expression]

DDEESSCCRRIIPPTTIIOONN
       ssuuddoorreeppllaayy plays back or lists the session logs created by ssuuddoo.  When
       replaying, ssuuddoorreeppllaayy can play the session back in real-time, or the
       playback speed may be adjusted (faster or slower) based on the command
       line options.  The _I_D should be a six character sequence of digits and
       upper case letters, e.g.  0100A5, which is logged by ssuuddoo when a
       command is run with session logging enabled.

       In list mode, ssuuddoorreeppllaayy can be used to find the ID of a session based
       on a number of criteria such as the user, tty or command run.

       In replay mode, if the standard output has not been redirected,
       ssuuddoorreeppllaayy will act on the following keys:

       ' ' (space)
               Pause output; press any key to resume.

       '<'     Reduce the playback speed by one half.

       '>'     Double the playback speed.

OOPPTTIIOONNSS
       ssuuddoorreeppllaayy accepts the following command line options:

       -d _d_i_r_e_c_t_o_r_y
                   Use _d_i_r_e_c_t_o_r_y to for the session logs instead of the
                   default, _/_v_a_r_/_l_o_g_/_s_u_d_o_-_i_o.

       -f _f_i_l_t_e_r   By default, ssuuddoorreeppllaayy will play back the command's
                   standard output, standard error and tty output.  The _-_f
                   option can be used to select which of these to output.  The
                   _f_i_l_t_e_r argument is a comma-separated list, consisting of
                   one or more of following: _s_t_d_o_u_t, _s_t_d_e_r_r, and _t_t_y_o_u_t.

       -l          Enable "list mode".  In this mode, ssuuddoorreeppllaayy will list
                   available session IDs.  If a _s_e_a_r_c_h _e_x_p_r_e_s_s_i_o_n is
                   specified, it will be used to restrict the IDs that are
                   displayed.  An expression is composed of the following
                   predicates:

                   command _c_o_m_m_a_n_d _p_a_t_t_e_r_n
                           Evaluates to true if the command run matches
                           _c_o_m_m_a_n_d _p_a_t_t_e_r_n.  On systems with POSIX regular
                           expression support, the pattern may be an extended
                           regular expression.  On systems without POSIX



1.7.4                     July 12, 2010                         1





SUDOREPLAY(1m)         MAINTENANCE COMMANDS        SUDOREPLAY(1m)


                           regular expression support, a simple substring
                           match is performed instead.

                   cwd _d_i_r_e_c_t_o_r_y
                           Evaluates to true if the command was run with the
                           specified current working directory.

                   fromdate _d_a_t_e
                           Evaluates to true if the command was run on or
                           after _d_a_t_e.  See "Date and time format" for a
                           description of supported date and time formats.

                   group _r_u_n_a_s___g_r_o_u_p
                           Evaluates to true if the command was run with the
                           specified _r_u_n_a_s___g_r_o_u_p.  Note that unless a
                           _r_u_n_a_s___g_r_o_u_p was explicitly specified when ssuuddoo was
                           run this field will be empty in the log.

                   runas _r_u_n_a_s___u_s_e_r
                           Evaluates to true if the command was run as the
                           specified _r_u_n_a_s___u_s_e_r.  Note that ssuuddoo runs commands
                           as user _r_o_o_t by default.

                   todate _d_a_t_e
                           Evaluates to true if the command was run on or
                           prior to _d_a_t_e.  See "Date and time format" for a
                           description of supported date and time formats.

                   tty _t_t_y Evaluates to true if the command was run on the
                           specified terminal device.  The _t_t_y should be
                           specified without the _/_d_e_v_/ prefix, e.g.  _t_t_y_0_1
                           instead of _/_d_e_v_/_t_t_y_0_1.

                   user _u_s_e_r _n_a_m_e
                           Evaluates to true if the ID matches a command run
                           by _u_s_e_r _n_a_m_e.

                   Predicates may be abbreviated to the shortest unique string
                   (currently all predicates may be shortened to a single
                   character).

                   Predicates may be combined using _a_n_d, _o_r and _! operators as
                   well as '(' and ')' for grouping (note that parentheses
                   must generally be escaped from the shell).  The _a_n_d
                   operator is optional, adjacent predicates have an implied
                   _a_n_d unless separated by an _o_r.

       -m _m_a_x___w_a_i_t Specify an upper bound on how long to wait between key
                   presses or output data.  By default, ssuuddoo__rreeppllaayy will
                   accurately reproduce the delays between key presses or
                   program output.  However, this can be tedious when the
                   session includes long pauses.  When the _-_m option is
                   specified, ssuuddoorreeppllaayy will limit these pauses to at most
                   _m_a_x___w_a_i_t seconds.  The value may be specified as a floating



1.7.4                     July 12, 2010                         2





SUDOREPLAY(1m)         MAINTENANCE COMMANDS        SUDOREPLAY(1m)


                   point number, .e.g. _2_._5.

       -s _s_p_e_e_d___f_a_c_t_o_r
                   This option causes ssuuddoorreeppllaayy to adjust the number of
                   seconds it will wait between key presses or program output.
                   This can be used to slow down or speed up the display.  For
                   example, a _s_p_e_e_d___f_a_c_t_o_r of _2 would make the output twice as
                   fast whereas a _s_p_e_e_d___f_a_c_t_o_r of <.5> would make the output
                   twice as slow.

       -V          The --VV (version) option causes ssuuddoorreeppllaayy to print its
                   version number and exit.

   DDaattee aanndd ttiimmee ffoorrmmaatt
       The time and date may be specified multiple ways, common formats
       include:

       HH:MM:SS am MM/DD/CCYY timezone
               24 hour time may be used in place of am/pm.

       HH:MM:SS am Month, Day Year timezone
               24 hour time may be used in place of am/pm, and month and day
               names may be abbreviated.  Note that month and day of the week
               names must be specified in English.

       CCYY-MM-DD HH:MM:SS
               ISO time format

       DD Month CCYY HH:MM:SS
               The month name may be abbreviated.

       Either time or date may be omitted, the am/pm and timezone are
       optional.  If no date is specified, the current day is assumed; if no
       time is specified, the first second of the specified date is used.  The
       less significant parts of both time and date may also be omitted, in
       which case zero is assumed.  For example, the following are all valid:

       The following are all valid time and date specifications:

       now     The current time and date.

       tomorrow
               Exactly one day from now.

       yesterday
               24 hours ago.

       2 hours ago
               2 hours ago.

       next Friday
               The first second of the next Friday.





1.7.4                     July 12, 2010                         3





SUDOREPLAY(1m)         MAINTENANCE COMMANDS        SUDOREPLAY(1m)


       this week
               The current time but the first day of the coming week.

       a fortnight ago
               The current time but 14 days ago.

       10:01 am 9/17/2009
               10:01 am, September 17, 2009.

       10:01 am
               10:01 am on the current day.

       10      10:00 am on the current day.

       9/17/2009
               00:00 am, September 17, 2009.

       10:01 am Sep 17, 2009
               10:01 am, September 17, 2009.

FFIILLEESS
       _/_v_a_r_/_l_o_g_/_s_u_d_o_-_i_o        The default I/O log directory.

       _/_v_a_r_/_l_o_g_/_s_u_d_o_-_i_o_/_0_0_/_0_0_/_0_1_/_l_o_g
                               Example session log info.

       _/_v_a_r_/_l_o_g_/_s_u_d_o_-_i_o_/_0_0_/_0_0_/_0_1_/_s_t_d_i_n
                               Example session standard input log.

       _/_v_a_r_/_l_o_g_/_s_u_d_o_-_i_o_/_0_0_/_0_0_/_0_1_/_s_t_d_o_u_t
                               Example session standard output log.

       _/_v_a_r_/_l_o_g_/_s_u_d_o_-_i_o_/_0_0_/_0_0_/_0_1_/_s_t_d_e_r_r
                               Example session standard error log.

       _/_v_a_r_/_l_o_g_/_s_u_d_o_-_i_o_/_0_0_/_0_0_/_0_1_/_t_t_y_i_n
                               Example session tty input file.

       _/_v_a_r_/_l_o_g_/_s_u_d_o_-_i_o_/_0_0_/_0_0_/_0_1_/_t_t_y_o_u_t
                               Example session tty output file.

       _/_v_a_r_/_l_o_g_/_s_u_d_o_-_i_o_/_0_0_/_0_0_/_0_1_/_t_i_m_i_n_g
                               Example session timing file.

       Note that the _s_t_d_i_n, _s_t_d_o_u_t and _s_t_d_e_r_r files will be empty unless ssuuddoo
       was used as part of a pipeline for a particular command.

EEXXAAMMPPLLEESS
       List sessions run by user _m_i_l_l_e_r_t:

        sudoreplay -l user millert

       List sessions run by user _b_o_b with a command containing the string vi:




1.7.4                     July 12, 2010                         4





SUDOREPLAY(1m)         MAINTENANCE COMMANDS        SUDOREPLAY(1m)


        sudoreplay -l user bob command vi

       List sessions run by user _j_e_f_f that match a regular expression:

        sudoreplay -l user jeff command '/bin/[a-z]*sh'

       List sessions run by jeff or bob on the console:

        sudoreplay -l ( user jeff or user bob ) tty console

SSEEEE AALLSSOO
       _s_u_d_o(1m), _s_c_r_i_p_t(1)

AAUUTTHHOORR
       Todd C. Miller

BBUUGGSS
       If you feel you have found a bug in ssuuddoorreeppllaayy, please submit a bug
       report at http://www.sudo.ws/sudo/bugs/

SSUUPPPPOORRTT
       Limited free support is available via the sudo-users mailing list, see
       http://www.sudo.ws/mailman/listinfo/sudo-users to subscribe or search
       the archives.

DDIISSCCLLAAIIMMEERR
       ssuuddoorreeppllaayy is provided ``AS IS'' and any express or implied warranties,
       including, but not limited to, the implied warranties of
       merchantability and fitness for a particular purpose are disclaimed.
       See the LICENSE file distributed with ssuuddoo or
       http://www.sudo.ws/sudo/license.html for complete details.


























1.7.4                     July 12, 2010                         5