Commit fd3ff3a
committed
Check the controlling tty to determine if a tty belongs to the user.
Previously, we compared the terminal device number returned by
get_process_ttyname() with that of stdin, stdout and stderr. This
causes problems on Linux if the user is logged in on the console,
which is a virtual device that may correspond to one of several
different terminal devices. In this specific case, there is a
mismatch between the controlling terminal listed in /proc/self/stat
(which corresponds to the underlying terminal device) and the device
number of stdin, stdout and stderr (which is that of /dev/console).1 parent a3cd820 commit fd3ff3a
4 files changed
+20
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
380 | | - | |
381 | | - | |
382 | | - | |
| 380 | + | |
| 381 | + | |
383 | 382 | | |
384 | 383 | | |
385 | 384 | | |
386 | | - | |
| 385 | + | |
387 | 386 | | |
388 | | - | |
| 387 | + | |
389 | 388 | | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
| 389 | + | |
396 | 390 | | |
397 | 391 | | |
398 | | - | |
399 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
400 | 397 | | |
401 | 398 | | |
402 | 399 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
474 | 473 | | |
| 474 | + | |
475 | 475 | | |
| 476 | + | |
476 | 477 | | |
477 | 478 | | |
478 | 479 | | |
| |||
496 | 497 | | |
497 | 498 | | |
498 | 499 | | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | 500 | | |
503 | | - | |
| 501 | + | |
504 | 502 | | |
505 | 503 | | |
506 | 504 | | |
| |||
510 | 508 | | |
511 | 509 | | |
512 | 510 | | |
513 | | - | |
| 511 | + | |
514 | 512 | | |
515 | 513 | | |
516 | 514 | | |
| |||
520 | 518 | | |
521 | 519 | | |
522 | 520 | | |
523 | | - | |
| 521 | + | |
524 | 522 | | |
525 | 523 | | |
526 | 524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1095 | 1095 | | |
1096 | 1096 | | |
1097 | 1097 | | |
1098 | | - | |
| 1098 | + | |
1099 | 1099 | | |
1100 | 1100 | | |
1101 | 1101 | | |
| |||
1203 | 1203 | | |
1204 | 1204 | | |
1205 | 1205 | | |
1206 | | - | |
1207 | | - | |
1208 | | - | |
1209 | | - | |
| 1206 | + | |
1210 | 1207 | | |
1211 | 1208 | | |
1212 | 1209 | | |
| |||
1253 | 1250 | | |
1254 | 1251 | | |
1255 | 1252 | | |
1256 | | - | |
| 1253 | + | |
1257 | 1254 | | |
1258 | 1255 | | |
1259 | 1256 | | |
| |||
1277 | 1274 | | |
1278 | 1275 | | |
1279 | 1276 | | |
1280 | | - | |
| 1277 | + | |
1281 | 1278 | | |
1282 | 1279 | | |
1283 | 1280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
0 commit comments