mod_phpを介してWebサーバー(Apache)からSudoをマウントすると、結果はルートに表示されません。

mod_phpを介してWebサーバー(Apache)からSudoをマウントすると、結果はルートに表示されません。

初期の質問:https://stackoverflow.com/questions/19598201/umounting-through-exec-with-sudo-the-user-is-a-sudoer-with-nopasswd

デフォルトではPHPスクリプトがあります。

exec('sudo mount /dev/md/stone:supershare /mnt/supershare');

エラーなしで完了し、終了コードは0です。

root別のセッションではcat /proc/mounts私でもなく、それも私の痕跡を示していませんでしたsupsershare

努力するrootrm -r /mnt/supershare

[root@stone mnt]# rm -r supershare/
rm: cannot remove ‘supershare/’: Device or resource busy

努力するrootumount /mnt/supershare

[root@stone mnt]# umount /mnt/supershare
umount: /mnt/supershare: not mounted

努力するrootmdadm --stop /dev/md/stone:supershare

[root@stone mnt]# mdadm --stop /dev/md/stone\:supershare
mdadm: Cannot get exclusive access to /dev/md/stone:supershare:Perhaps a running process, mounted filesystem or active volume group?

Webサーバーでsudoを使用して同じコマンドを実行しようとするすべての試行は成功します(マウントポイントの表示、デバイスのマウント解除、攻撃の停止など)。

はい、私はルートです:

[root@stone mnt]# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),19(log)

rootWebサーバーで実行されたインストールについて通知されないのはなぜですか?
どのシナリオでmountローカライズが有効なユーザーになるのでしょうか?

ベストアンサー1

要するに、問題が解決しました。

これはApacheの対応するサービスですsystemdPrivateTmp=true指示する。明らかに、このコマンドは新しいファイルシステムの名前空間を使用してプロセスを実行します。

トラブルシューティングの冒険の詳細をご覧ください。ここ

おすすめ記事