Laurent:<br/><br/>Thanks for your reply and patience. The following is the original pure text mail just for the reference.<br/><br/>-------------------------------------------------original mail -------------------------------------------------<br/><br/>in the document of "An overview of utmps", how to understand the statement: "The main advantage, on the other hand, is that no program needs to be suid or sgid, and permissions can actually be quite fine-grained."<br/><br/>Here is my observation: after use the following command to set my application to use the same group which utmps is running.<br/>% adduser ide utmp<br/><br/>I still can't write to the utmp database. Here ide is my account name. The utmps service is running with the recommended openrc script.<br/><br/>------------------environment start<br/>openrc-ssh:~/develop/aprilsh/cmd$ whoami<br/>ide<br/>openrc-ssh:~/develop/aprilsh/cmd$ id<br/>uid=1000(ide) gid=1000(develop) groups=406(utmp),1000(develop),1000(develop)<br/>------------------environment end<br/><br/>the output of top command, show that utmps daemon is running as the utmp account.<br/><br/>-----------------------top start<br/>Mem: 4952892K used, 1132768K free, 308464K shrd, 347760K buff, 3436632K cached<br/>CPU: 0% usr 0% sys 0% nic 100% idle 0% io 0% irq 0% sirq<br/>Load average: 0.00 0.00 0.01 2/649 9376<br/> PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND<br/> 286 190 root S 6824 0% 2 0% sshd: root_at_pts/1<br/> 293 291 ide S 6748 0% 0 0% sshd: ide_at_pts/2<br/> 291 190 root S 6504 0% 5 0% sshd: ide [priv]<br/> 190 1 root S 6492 0% 2 0% sshd: /usr/sbin/sshd [listener] 0 of 10-100 startups<br/> 296 293 ide S 1728 0% 3 0% -ash<br/> 288 286 root S 1724 0% 0 0% -ash<br/> 9376 296 ide R 1624 0% 4 0% top<br/> 1 0 root S 1612 0% 4 0% /sbin/init<br/> 217 1 utmp S 1040 0% 0 0% s6-ipcserverd -- utmps-utmpd<br/> 154 1 utmp S 1040 0% 5 0% s6-ipcserverd -- utmps-wtmpd btmp<br/> 245 1 utmp S 1040 0% 0 0% s6-ipcserverd -- utmps-wtmpd wtmp<br/>-----------------------top end<br/> <br/>Original<br/><br/> <br/><br/> <br/>From:"Laurent Bercot"&lt;
ska-skaware_at_skarnet.org &gt;;<br/>Date:2023/6/25 1:53<br/>To:"skaware"&lt;
skaware_at_list.skarnet.org &gt;;<br/>Subject:Re: utmps privilege<br/><br/><br/> Please avoid using a HTML client, it looks like your converter is<br/>buggy and giving some garbled output (your top output is unreadable).<br/><br/> What's happening is that utmps-utmpd only checks the value of the<br/>*primary* gid of the client. It does not check supplementary groups.<br/>I agree that it's counter-intuitive, and will see I can fix that.<br/>Thanks for the report.<br/><br/>--<br/> Laurent
Received on Sat Jun 24 2023 - 23:55:51 CEST