peercast-yt icon indicating copy to clipboard operation
peercast-yt copied to clipboard

設定保存時におけるpeercast.iniの権限が変わり、パスワードがゲストユーザに漏れてしまう問題

Open meto4d opened this issue 4 years ago • 0 comments

設定保存時、参照しているpeercast.iniの権限が維持されず、peercastを実行しているUID:GIDの644権限に変更されてしまうようです。

例:peercastユーザ(peercast:peercast)で実行しているpeercastと、peercast:peercast-grpでファイルモード460のpeercast.iniが、設定保存により上書きされ、guestユーザからpasswordが見えます

~$ ls -l .config/peercast/peercast.ini
-r--rw---- 1 peercast peercast-grp 1648 Nov 23 23:53 .config/peercast/peercast.ini
~$ id
uid=7144(peercast) gid=7144(peercast) groups=7144(peercast),7140(peercast-grp)
→このユーザでpeercast実行
~$ ps -ae -o user,group,comm
USER     GROUP    COMMAND
peercast peercast peercast

→WebUIから設定保存後
~$ ls -l .config/peercast/peercast.ini
-rw-r--r-- 1 peercast peercast 1836 Dec  4 05:20 .config/peercast/peercast.ini

ServMgr::saveSettings()で作成した一時設定ファイルをrenameにより利用するため、ファイル権限が書き換わってしまうのだと思います。

meto4d avatar Dec 04 '21 06:12 meto4d