Solved Can't `write` another logged in user

Code:
root@host0:~ # who
user1        pts/0        Sep 18 13:08 (1.2.3.4)
user2          pts/1        Sep 18 13:09 (1.2.3.5)
root@host0:~ # write user2
write: user2 is not logged in

The truss(1) follows:

Code:
root@host0:~ # truss write user2
mmap(0x0,131072,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 541208576 (0x20423000)
issetugid()                     = 0 (0x0)
openat(AT_FDCWD,"/etc/libmap.conf",O_RDONLY|O_CLOEXEC,00) = 3 (0x3)
fstat(3,{ mode=-rw-r--r-- ,inode=1444703,size=122,blksize=32768 }) = 0 (0x0)
read(3,"# $FreeBSD: releng/12.0/libexec/"...,122) = 122 (0x7a)
close(3)                     = 0 (0x0)
open("/usr/local/etc/libmap.d",O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC,00) ERR#2 'No such file or directory'
openat(AT_FDCWD,"/var/run/ld-elf.so.hints",O_RDONLY|O_CLOEXEC,00) = 3 (0x3)
read(3,"Ehnt\^A\0\0\0\M^@\0\0\0-\0\0\0\0"...,128) = 128 (0x80)
fstat(3,{ mode=-r--r--r-- ,inode=825896,size=173,blksize=32768 }) = 0 (0x0)
pread(3,"/lib:/usr/lib:/usr/lib/compat:/u"...,45,0x80) = 45 (0x2d)
close(3)                     = 0 (0x0)
openat(AT_FDCWD,"/lib/libc.so.7",O_RDONLY|O_CLOEXEC|O_VERIFY,00) = 3 (0x3)
fstat(3,{ mode=-r--r--r-- ,inode=882837,size=1681348,blksize=32768 }) = 0 (0x0)
mmap(0x0,4096,PROT_READ,MAP_PRIVATE|MAP_PREFAULT_READ,3,0x0) = 541339648 (0x20443000)
mmap(0x0,1740800,PROT_NONE,MAP_GUARD,-1,0x0)     = 541343744 (0x20444000)
mmap(0x20444000,249856,PROT_READ,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x0) = 541343744 (0x20444000)
mmap(0x20481000,1331200,PROT_READ|PROT_EXEC,MAP_PRIVATE|MAP_FIXED|MAP_NOCORE|MAP_PREFAULT_READ,3,0x3d000) = 541593600 (0x20481000)
mmap(0x205c6000,36864,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_PREFAULT_READ,3,0x182000) = 542924800 (0x205c6000)
mmap(0x205cf000,122880,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|MAP_ANON,-1,0x0) = 542961664 (0x205cf000)
munmap(0x20443000,4096)                 = 0 (0x0)
close(3)                     = 0 (0x0)
mprotect(0x205ca000,20480,PROT_READ)         = 0 (0x0)
sysarch(I386_SET_GSBASE,0xffbfe29c)         = 0 (0x0)
mprotect(0x404000,4096,PROT_READ)         = 0 (0x0)
sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
sigprocmask(SIG_SETMASK,{ },0x0)         = 0 (0x0)
readlink("/etc/malloc.conf",0xffbfda17,1024)     ERR#2 'No such file or directory'
issetugid()                     = 0 (0x0)
__sysctl(0xffbfd984,0x2,0xffbfd980,0xffbfd97c,0x0,0x0) = 0 (0x0)
mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 541339648 (0x20443000)
madvise(0x20443000,4096,MADV_FREE)         = 0 (0x0)
munmap(0x20443000,4096)                 = 0 (0x0)
mmap(0x0,2097152,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 543084544 (0x205ed000)
munmap(0x205ed000,2097152)             = 0 (0x0)
mmap(0x0,4190208,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 543084544 (0x205ed000)
munmap(0x205ed000,77824)             = 0 (0x0)
munmap(0x20800000,2015232)             = 0 (0x0)
clock_gettime(4,{ 30664.305723065 })         = 0 (0x0)
clock_gettime(4,{ 30664.306472602 })         = 0 (0x0)
clock_gettime(4,{ 30664.307442837 })         = 0 (0x0)
mmap(0x0,28672,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 543084544 (0x205ed000)
mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 541339648 (0x20443000)
sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
sigprocmask(SIG_SETMASK,{ },0x0)         = 0 (0x0)
sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
sigprocmask(SIG_SETMASK,{ },0x0)         = 0 (0x0)
openat(AT_FDCWD,"/dev/",O_RDONLY,00)         = 3 (0x3)
cap_rights_limit(3,{ CAP_WRITE,CAP_SEEK_TELL,CAP_LOOKUP,CAP_FCNTL,CAP_FSTAT,CAP_IOCTL }) = 0 (0x0)
cap_rights_limit(0,{ CAP_READ,CAP_WRITE,CAP_FCNTL,CAP_FSTAT,CAP_IOCTL }) = 0 (0x0)
cap_rights_limit(1,{ CAP_READ,CAP_WRITE,CAP_FCNTL,CAP_FSTAT,CAP_IOCTL }) = 0 (0x0)
cap_rights_limit(2,{ CAP_READ,CAP_WRITE,CAP_FCNTL,CAP_FSTAT,CAP_IOCTL }) = 0 (0x0)
cap_ioctls_limit(0x0,0xffbfe884,0x3)         = 0 (0x0)
cap_ioctls_limit(0x1,0xffbfe884,0x3)         = 0 (0x0)
cap_ioctls_limit(0x2,0xffbfe884,0x3)         = 0 (0x0)
cap_fcntls_limit(0,CAP_FCNTL_GETFL)         = 0 (0x0)
cap_fcntls_limit(1,CAP_FCNTL_GETFL)         = 0 (0x0)
cap_fcntls_limit(2,CAP_FCNTL_GETFL)         = 0 (0x0)
mmap(0x0,28672,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 543113216 (0x205f4000)
fstatat(AT_FDCWD,"/usr/share/nls/C/libc.cat",0xffbfe750,0x0) ERR#2 'No such file or directory'
fstatat(AT_FDCWD,"/usr/share/nls/libc/C",0xffbfe750,0x0) ERR#2 'No such file or directory'
fstatat(AT_FDCWD,"/usr/local/share/nls/C/libc.cat",0xffbfe750,0x0) ERR#2 'No such file or directory'
fstatat(AT_FDCWD,"/usr/local/share/nls/libc/C",0xffbfe750,0x0) ERR#2 'No such file or directory'
mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 543141888 (0x205fb000)
mmap(0x0,20480,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 545259520 (0x20800000)
access("/etc/localtime",R_OK)             = 0 (0x0)
open("/etc/localtime",O_RDONLY,037757763560)     = 4 (0x4)
fstat(4,{ mode=-r--r--r-- ,inode=1444657,size=3519,blksize=32768 }) = 0 (0x0)
mmap(0x0,36864,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 545280000 (0x20805000)
read(4,"TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0"...,29000) = 3519 (0xdbf)
close(4)                     = 0 (0x0)
open("/var/run/utx.active",O_RDONLY|O_CLOEXEC,0666) = 4 (0x4)
fstat(4,{ mode=-rw-r--r-- ,inode=825918,size=591,blksize=32768 }) = 0 (0x0)
fstat(4,{ mode=-rw-r--r-- ,inode=825918,size=591,blksize=32768 }) = 0 (0x0)
mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 543145984 (0x205fc000)
mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 543150080 (0x205fd000)
mmap(0x0,4096,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 543154176 (0x205fe000)
getuid()                     = 0 (0x0)
getlogin(0x205db770,0x21)             = 0 (0x0)
cap_enter()                     = 0 (0x0)
ioctl(0,TIOCGETA,0xffbfe800)             = 0 (0x0)
ioctl(0,TIOCGETA,0xffbfe7e0)             = 0 (0x0)
ioctl(0,FIODGNAME,0xffbfe7f8)             = 0 (0x0)
fstatat(3,"pts/0",{ mode=crw--w---- ,inode=96,size=0,blksize=4096 },0x0) = 0 (0x0)
close(4)                     = 0 (0x0)
open("/var/run/utx.active",O_RDONLY|O_CLOEXEC,0666) ERR#94 'Not permitted in capability mode'
open("/var/run/utx.active",O_RDONLY|O_CLOEXEC,0666) ERR#94 'Not permitted in capability mode'
write: write(2,"write: ",7)                 = 7 (0x7)
user2 is not logged inwrite(2,"user2 is not logged in",24)         = 24 (0x18)

write(2,"\n",1)                     = 1 (0x1)
sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
sigprocmask(SIG_SETMASK,{ },0x0)         = 0 (0x0)
sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
sigprocmask(SIG_SETMASK,{ },0x0)         = 0 (0x0)
sigprocmask(SIG_BLOCK,{ SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2 },{ }) = 0 (0x0)
sigprocmask(SIG_SETMASK,{ },0x0)         = 0 (0x0)
exit(0x1)                 
process exit, rval = 1

The open(2) system call right before the program output seems to be outputting an error:
Code:
ERR#94 'Not permitted in capability mode'

Googling around, I could not find anything relevant to this problem. Any ideas what the underlying issue might be?

Thanks in advance for your help!
 
Hmm. I tried it on my FreeBSD 12.0 machine and first needed to enable "write permission":
Code:
tom:~/ $ write tom
write: you have write permission turned off
tom:~/ $ write tom
write: tom is not logged in
 
Hmm. I tried it on my FreeBSD 12.0 machine and first needed to enable "write permission":
Code:
tom:~/ $ write tom
write: you have write permission turned off
tom:~/ $ write tom
write: tom is not logged in

Yes, I checked that write permissions were on.

It appears that you are still getting the same error I am even after you enable write permission: you are logged in, but write(1) can't tell.
 
Did you enable any of the security features? Or running on a high(er) security level?

Code:
dice@maelcum:~ % write dice

Message from dice@maelcum.dicelan.home on pts/1 at 16:53 ...
hello
hello
EOF
 
Did you enable any of the security features? Or running on a high(er) security level?

No, I made a vanilla install yesterday evening. I haven't done anything except change shell prompt, send a couple of emails to another local user, and get public-key SSH authentication working.
 
Back
Top