Kaynağa Gözat

Kernel: Change unveil state to dropped even when node already exists

This also changes the UnveilState to Dropped when the path unveil() is
called for already has a node.

This fixes a bug where unveiling "/" would previously keep the
UnveilState as None, which meant that everything was still accessible
until unveil() was called with any non-root path (or nullptr).
Max Wipfli 4 yıl önce
ebeveyn
işleme
8930db0900
1 değiştirilmiş dosya ile 1 ekleme ve 0 silme
  1. 1 0
      Kernel/Syscalls/unveil.cpp

+ 1 - 0
Kernel/Syscalls/unveil.cpp

@@ -116,6 +116,7 @@ KResultOr<int> Process::sys$unveil(Userspace<const Syscall::SC_unveil_params*> u
             update_intermediate_node_permissions(matching_node, (UnveilAccess)new_permissions);
             update_intermediate_node_permissions(matching_node, (UnveilAccess)new_permissions);
 
 
         matching_node.set_metadata({ matching_node.path(), (UnveilAccess)new_permissions, true });
         matching_node.set_metadata({ matching_node.path(), (UnveilAccess)new_permissions, true });
+        m_veil_state = VeilState::Dropped;
         return 0;
         return 0;
     }
     }