diff options
Diffstat (limited to 'drivers/tty/tty_audit.c')
-rw-r--r-- | drivers/tty/tty_audit.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c index b0b39b823ccf..6953dc82850c 100644 --- a/drivers/tty/tty_audit.c +++ b/drivers/tty/tty_audit.c | |||
@@ -23,7 +23,7 @@ struct tty_audit_buf { | |||
23 | }; | 23 | }; |
24 | 24 | ||
25 | static struct tty_audit_buf *tty_audit_buf_alloc(int major, int minor, | 25 | static struct tty_audit_buf *tty_audit_buf_alloc(int major, int minor, |
26 | int icanon) | 26 | unsigned icanon) |
27 | { | 27 | { |
28 | struct tty_audit_buf *buf; | 28 | struct tty_audit_buf *buf; |
29 | 29 | ||
@@ -239,7 +239,8 @@ int tty_audit_push_task(struct task_struct *tsk, kuid_t loginuid, u32 sessionid) | |||
239 | * if TTY auditing is disabled or out of memory. Otherwise, return a new | 239 | * if TTY auditing is disabled or out of memory. Otherwise, return a new |
240 | * reference to the buffer. | 240 | * reference to the buffer. |
241 | */ | 241 | */ |
242 | static struct tty_audit_buf *tty_audit_buf_get(struct tty_struct *tty) | 242 | static struct tty_audit_buf *tty_audit_buf_get(struct tty_struct *tty, |
243 | unsigned icanon) | ||
243 | { | 244 | { |
244 | struct tty_audit_buf *buf, *buf2; | 245 | struct tty_audit_buf *buf, *buf2; |
245 | 246 | ||
@@ -257,7 +258,7 @@ static struct tty_audit_buf *tty_audit_buf_get(struct tty_struct *tty) | |||
257 | 258 | ||
258 | buf2 = tty_audit_buf_alloc(tty->driver->major, | 259 | buf2 = tty_audit_buf_alloc(tty->driver->major, |
259 | tty->driver->minor_start + tty->index, | 260 | tty->driver->minor_start + tty->index, |
260 | tty->icanon); | 261 | icanon); |
261 | if (buf2 == NULL) { | 262 | if (buf2 == NULL) { |
262 | audit_log_lost("out of memory in TTY auditing"); | 263 | audit_log_lost("out of memory in TTY auditing"); |
263 | return NULL; | 264 | return NULL; |
@@ -287,7 +288,7 @@ static struct tty_audit_buf *tty_audit_buf_get(struct tty_struct *tty) | |||
287 | * Audit @data of @size from @tty, if necessary. | 288 | * Audit @data of @size from @tty, if necessary. |
288 | */ | 289 | */ |
289 | void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, | 290 | void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, |
290 | size_t size) | 291 | size_t size, unsigned icanon) |
291 | { | 292 | { |
292 | struct tty_audit_buf *buf; | 293 | struct tty_audit_buf *buf; |
293 | int major, minor; | 294 | int major, minor; |
@@ -299,7 +300,7 @@ void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, | |||
299 | && tty->driver->subtype == PTY_TYPE_MASTER) | 300 | && tty->driver->subtype == PTY_TYPE_MASTER) |
300 | return; | 301 | return; |
301 | 302 | ||
302 | buf = tty_audit_buf_get(tty); | 303 | buf = tty_audit_buf_get(tty, icanon); |
303 | if (!buf) | 304 | if (!buf) |
304 | return; | 305 | return; |
305 | 306 | ||
@@ -307,11 +308,11 @@ void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, | |||
307 | major = tty->driver->major; | 308 | major = tty->driver->major; |
308 | minor = tty->driver->minor_start + tty->index; | 309 | minor = tty->driver->minor_start + tty->index; |
309 | if (buf->major != major || buf->minor != minor | 310 | if (buf->major != major || buf->minor != minor |
310 | || buf->icanon != tty->icanon) { | 311 | || buf->icanon != icanon) { |
311 | tty_audit_buf_push_current(buf); | 312 | tty_audit_buf_push_current(buf); |
312 | buf->major = major; | 313 | buf->major = major; |
313 | buf->minor = minor; | 314 | buf->minor = minor; |
314 | buf->icanon = tty->icanon; | 315 | buf->icanon = icanon; |
315 | } | 316 | } |
316 | do { | 317 | do { |
317 | size_t run; | 318 | size_t run; |