util-linux/lib
Karel Zak 17d5b26436 su: (pty) change owner and mode for pty
The current situation:

 # su --pty - kzak
 $ ll $(tty)
 crw--w---- 1 root tty 136, 9 Feb 23 11:53 /dev/pts/9
 $ mesg
 mesg: cannot open /dev/pts/9: Permission denied

the pseudo-terminal is still owned by the original user.

New version:

 # su --pty - kzak
 # ll $(tty)
 crw--w---- 1 kzak tty 136, 9 Feb 23 11:56 /dev/pts/9
 # mesg
 is y

The patch follows login(1) to change the pty owner and group. It
follows "TTYPERM" and "TTYGROUP" from login.defs (or econf lib).

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-23 11:52:45 +01:00
..
Makemodule.am lib: use procutils.c on Linux only 2021-02-17 12:24:13 +01:00
blkdev.c lib/blkdev: add support for --lock and LOCK_BLOCK_DEVICE 2020-05-26 17:30:39 +02:00
buffer.c lib: add missing headers to .c files 2020-10-06 15:03:45 +02:00
canonicalize.c lib/canonicalize: fix compiler warning [-Wsign-compare] 2019-06-10 11:00:38 +02:00
caputils.c lib/caputils: split to multiple functions, add test 2020-11-20 11:21:41 +01:00
color-names.c lib/color-names: add "white" between human-readable 2020-03-10 09:45:33 +01:00
colors.c misc: fix typos [codespell] 2019-09-12 19:41:46 +01:00
cpuset.c taskset: fix cpuset list parser 2019-03-20 13:12:25 +01:00
crc32.c lib/crc32: prefix public functions 2016-10-19 12:11:59 +02:00
crc32c.c lib: Add simple crc32c() function 2017-11-16 11:44:39 +01:00
encode.c [clang-tidy] do not use else after return 2020-04-20 13:20:59 -07:00
env.c misc: fix typos [codespell] 2020-11-04 11:42:25 +00:00
exec_shell.c cast NULL to char * when using execl 2020-10-29 19:49:07 +02:00
fileutils.c lib: use ul_prefix for close_all_fds() and mkdir_p() 2021-01-28 10:27:21 +01:00
idcache.c [clang-tidy] do not return in void functions 2020-04-19 14:03:21 -07:00
ismounted.c [clang-tidy] fix wrong *cmp usage 2020-04-20 13:21:00 -07:00
jsonwrt.c libsmartcols: support arrays for JSON output 2021-01-08 13:12:57 +01:00
langinfo.c lib: add missing license headers 2019-11-08 10:40:42 +01:00
linux_version.c lib: add missing headers to .c files 2020-10-06 15:03:45 +02:00
loopdev.c lib/loopdev: make is_loopdev() more robust 2021-01-12 11:43:31 +01:00
mangle.c include: add some missing licence stuff to header files 2020-01-13 10:39:52 +01:00
match.c lib/match: make match_fstype() case insensitive 2017-08-31 14:15:23 +02:00
mbsalign.c lib/mbsalign: add function to calculate width 2020-04-22 12:22:29 +02:00
mbsedit.c lib/mbsedit: check wctomb() return code [coverity scan] 2017-10-11 14:40:37 +02:00
md5.c lib/md5: use ul_/UL_ prefix 2017-12-12 12:06:15 +01:00
monotonic.c dmesg: adjust timestamps according to suspended time 2020-06-04 10:57:36 +02:00
pager.c lib/pager: fix improper use of negative value [coverity scan] 2020-10-16 11:30:08 +02:00
path.c lib/path: add ul_path_is_accessible() 2020-07-08 08:50:07 +02:00
plymouth-ctrl.c lib: style cosmetics plymouth-ctrl.c 2017-06-15 09:13:04 +02:00
procutils.c lib/procutils: improve proc_is_procfs(), add test 2020-11-20 10:40:31 +01:00
pty-session.c su: (pty) change owner and mode for pty 2021-02-23 11:52:45 +01:00
pwdutils.c lib: add missing headers to .c files 2020-10-06 15:03:45 +02:00
randutils.c libuuid: check quality of random bytes 2020-11-08 11:48:23 +00:00
selinux-utils.c lib/selinux-utils: tiny cleanup 2021-01-13 15:04:02 +01:00
sha1.c lib/sha1: use proper WORDS_BIGENDIAN macro 2018-01-02 11:08:03 +01:00
signames.c lib/signames: change license to public domain 2020-11-19 12:04:08 +01:00
strutils.c lib/strutils: add ul_stralnumcmp() 2021-02-23 09:19:48 +01:00
strv.c lib/strv: add strv_extendv() 2015-10-01 14:43:05 +02:00
swapprober.c lib: add missing headers to .c files 2020-10-06 15:03:45 +02:00
sysfs.c lib/sysfs: fix doble free [coverity scan] 2020-10-09 13:46:35 +02:00
terminal-colors.d.5 man: make tilde and caret characters to render correctly 2020-11-14 15:22:34 +00:00
timer.c lib: add missing headers to .c files 2020-10-06 15:03:45 +02:00
timeutils.c lib: fix compiler warnings [-Wmaybe-uninitialized] 2020-12-17 11:07:38 +01:00
ttyutils.c [clang-tidy] do not use else after return 2020-04-20 13:20:59 -07:00