Re: No subshell ifnot root, delayed start with no internet connection



Am 20.12.2016 um 11:45 schrieb Yury V. Zaytsev:
On Tue, 20 Dec 2016, Joerg Thuemmler wrote:

thx. Do you know, how mc detects the shell?

https://github.com/MidnightCommander/mc/blob/0cc22928afbc6e23eb0fa5c85fd95518d8151edc/lib/shell.c


It's in both cases (root and user) classical login with bash, never
manipulated there anything...

I seriously doubt it, because otherwise it would have worked out of the
box. A good test is to create a brand new fresh user, log in as this new
user and start mc. If it works, then it means that you've botched your
user profile. If it doesn't work, maybe you've botched system profile.


Hi,

don't think it's kind of this. No change for a brand new user.
I strace'd the mc running under root and user. Found a classic rights problem:

at users side:
===============
statfs("/dev/pts", {f_type="DEVPTS_SUPER_MAGIC", f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, ioctl(4, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(4, TIOCGPTN, [1])                 = 0
stat("/dev/pts/1", {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 1), ...}) = 0
getuid()                                = 26
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 5
connect(5, {sa_family=AF_FILE, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(5)                                = 0
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 5
connect(5, {sa_family=AF_FILE, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(5)                                = 0
open("/etc/group", O_RDONLY|O_CLOEXEC)  = 5
lseek(5, 0, SEEK_CUR)                   = 0
fstat(5, {st_mode=S_IFREG|0644, st_size=669, ...}) = 0
mmap(NULL, 669, PROT_READ, MAP_SHARED, 5, 0) = 0x7f8a243b1000
lseek(5, 669, SEEK_SET)                 = 669
munmap(0x7f8a243b1000, 669)             = 0
close(5)
chown("/dev/pts/1", 26, 5)              = -1 EPERM (Operation not permitted)
close(4)                                = 0
write(2, "Cannot open master side of pty: "..., 69) = 69
write(1, "\33[?1001s\33[?1002h\33[?1006h", 24) = 24
write(1, "\33[?2004h", 8)               = 8

the last lines on root's side
=============================
open("/etc/group", O_RDONLY|O_CLOEXEC)  = 5
lseek(5, 0, SEEK_CUR)                   = 0
fstat(5, {st_mode=S_IFREG|0644, st_size=669, ...}) = 0
mmap(NULL, 669, PROT_READ, MAP_SHARED, 5, 0) = 0x7facc5f95000
lseek(5, 669, SEEK_SET)                 = 669
munmap(0x7facc5f95000, 669)             = 0
close(5)                                = 0
chown("/dev/pts/1", 0, 5)               = 0
chmod("/dev/pts/1", 0620)               = 0
ioctl(4, TIOCSPTLCK, [0])               = 0
ioctl(4, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(4, TIOCGPTN, [1])                 = 0
stat("/dev/pts/1", {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
open("/dev/pts/1", O_RDWR)              = 5

seems to me that's normal a user usually should not be allowed to chown or chmod a /dev/pts/... but I don't have a clue, why that's working on other people's machines.

Redirecting stderr to a file shows exactly the EPERM thats in the strace lines of user.

--
www.teddylinx.de


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]