ファイルシステムアクセス以外の権限

ファイルシステムアクセス以外の権限

この回答で引用プロセスのファイルシステムユーザーIDと有効ユーザーIDの違いについては、次のように言います。

FSUIDはファイルシステムへのアクセスに使用され、EUIDは他の目的に使用されます。

この「他のもの」とは何ですか?ソケットへの接続などのシステムコールのみを考えることができますが、ファイルシステムの対話以外のものはプロセスにスーパーユーザー権限が必要です。私の考えでは、uids(およびgids)はルートでない限り非常に効果的であるため、ほとんど意味がありません。

システムコール以外に何かありますか?また、ユーザー/グループ権限がプロセス間で転送できる信号に影響を与えることに気付いていますが、これがどのように機能するのかわかりません。共有メモリなどの他の種類のプロセス間通信を追加できますか?

そして、ユーザーがファイル実行権限を持っている場合、それを実行することは「ファイルシステム権限」と見なされますか?実行可能ファイルがスクリプトであるか(スクリプトを1行ずつ読み取るユーザー所有プロセスを実行するにはSOが必要なため、ファイルシステムの読み取り操作を暗示する)かバイナリか(ファイルの内容を直接コピーして貼り付ける)かどうかによって異なります。 SOを介してRAMとして推測してください)?ファイルに実行権限があるが読み取り権限(バイナリまたはテキスト実行ファイル)がない場合はどうなりますか?

ベストアンサー1

有効なIDはいくつかの方法で使用されます。

信号は次の説明に従って送信されます。殺す(2):

   For  a process to have permission to send a signal, it must either
   be privileged (under Linux: have the CAP_KILL  capability  in  the
   user  namespace  of  the target process), or the real or effective
   user ID of the sending process must equal the real or  saved  set-
   user-ID  of  the  target process.  In the case of SIGCONT, it suf‐
   fices when the sending and receiving processes belong to the  same
   session.

(たとえば)の説明に従ってSystem V IPCオブジェクトを作成するときメッセージ制御(2):

   If a new message queue is created, then its associated data struc‐
   ture msqid_ds (see msgctl(2)) is initialized as follows:

          msg_perm.cuid  and  msg_perm.uid  are  set to the effective
          user ID of the calling process.

          msg_perm.cgid and msg_perm.gid are  set  to  the  effective
          group ID of the calling process.

次の説明に従って、プロセスのnice値を設定するとき優先順位の設定(2):

   EPERM  A  process  was  located, but its effective user ID did not
          match either the effective or the real user ID of the call‐
          er,  and  was  not  privileged  (on Linux: did not have the
          CAP_SYS_NICE capability).  But see NOTES below.

同様に、CPUアフィニティを設定するときsched_setaffinity(2):

   EPERM  (sched_setaffinity()) The  calling  thread  does  not  have
          appropriate privileges.  The caller needs an effective user
          ID equal to the real user ID or effective user  ID  of  the
          thread   identified   by   pid,  or  it  must  possess  the
          CAP_SYS_NICE capability in the user namespace of the thread
          pid.

別の例には、次のシステムコールがあります。制限事項(2)そしてボタンコントロール(2)

おすすめ記事