mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:22:45 +00:00 
			
		
		
		
	Applications: Use new global variables at /sys/kernel/ directory
This commit is contained in:
		
							parent
							
								
									6e508573a0
								
							
						
					
					
						commit
						5dfb2b18f3
					
				
					 28 changed files with 33 additions and 32 deletions
				
			
		|  | @ -360,7 +360,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::pledge("stdio thread recvfd sendfd rpath unix prot_exec")); |     TRY(Core::System::pledge("stdio thread recvfd sendfd rpath unix prot_exec")); | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); | ||||||
|     TRY(Core::System::unveil("/home/anon/Documents/3D Models", "r")); |     TRY(Core::System::unveil("/home/anon/Documents/3D Models", "r")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|  |  | ||||||
|  | @ -92,7 +92,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|         TRY(Core::System::unveil(webdriver_ipc_path.view(), "rw"sv)); |         TRY(Core::System::unveil(webdriver_ipc_path.view(), "rw"sv)); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/image", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/image", "rw")); | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     TRY(Core::System::pledge("stdio recvfd sendfd rpath unix")); |     TRY(Core::System::pledge("stdio recvfd sendfd rpath unix")); | ||||||
|     auto app = TRY(GUI::Application::try_create(arguments)); |     auto app = TRY(GUI::Application::try_create(arguments)); | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil("/usr/share/man", "r")); |     TRY(Core::System::unveil("/usr/share/man", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); | ||||||
|  |  | ||||||
|  | @ -43,7 +43,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|         return GUI::Window::CloseRequestDecision::StayOpen; |         return GUI::Window::CloseRequestDecision::StayOpen; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil(nullptr, nullptr)); |     TRY(Core::System::unveil(nullptr, nullptr)); | ||||||
|  |  | ||||||
|  | @ -154,7 +154,7 @@ KeyboardSettingsWidget::KeyboardSettingsWidget() | ||||||
| { | { | ||||||
|     load_from_gml(keyboard_widget_gml); |     load_from_gml(keyboard_widget_gml); | ||||||
| 
 | 
 | ||||||
|     auto proc_keymap = Core::File::construct("/proc/keymap"); |     auto proc_keymap = Core::File::construct("/sys/kernel/keymap"); | ||||||
|     if (!proc_keymap->open(Core::OpenMode::ReadOnly)) |     if (!proc_keymap->open(Core::OpenMode::ReadOnly)) | ||||||
|         VERIFY_NOT_REACHED(); |         VERIFY_NOT_REACHED(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -29,7 +29,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     TRY(Core::System::pledge("stdio rpath recvfd sendfd proc exec")); |     TRY(Core::System::pledge("stdio rpath recvfd sendfd proc exec")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil("/bin/keymap", "x")); |     TRY(Core::System::unveil("/bin/keymap", "x")); | ||||||
|     TRY(Core::System::unveil("/proc/keymap", "r")); |     TRY(Core::System::unveil("/sys/kernel/keymap", "r")); | ||||||
|     TRY(Core::System::unveil("/etc/Keyboard.ini", "r")); |     TRY(Core::System::unveil("/etc/Keyboard.ini", "r")); | ||||||
|     TRY(Core::System::unveil(nullptr, nullptr)); |     TRY(Core::System::unveil(nullptr, nullptr)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -40,7 +40,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd unix")); |     TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd unix")); | ||||||
|     auto app = TRY(GUI::Application::try_create(arguments)); |     auto app = TRY(GUI::Application::try_create(arguments)); | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil(nullptr, nullptr)); |     TRY(Core::System::unveil(nullptr, nullptr)); | ||||||
|  |  | ||||||
|  | @ -24,7 +24,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
| 
 | 
 | ||||||
|     Config::pledge_domain("Mail"); |     Config::pledge_domain("Mail"); | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil("/etc", "r")); |     TRY(Core::System::unveil("/etc", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/webcontent", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/webcontent", "rw")); | ||||||
|  |  | ||||||
|  | @ -63,7 +63,7 @@ NetworkSettingsWidget::NetworkSettingsWidget() | ||||||
| 
 | 
 | ||||||
|     auto config_file = Core::ConfigFile::open_for_system("Network").release_value_but_fixme_should_propagate_errors(); |     auto config_file = Core::ConfigFile::open_for_system("Network").release_value_but_fixme_should_propagate_errors(); | ||||||
| 
 | 
 | ||||||
|     auto proc_net_adapters_file = Core::Stream::File::open("/proc/net/adapters"sv, Core::Stream::OpenMode::Read).release_value_but_fixme_should_propagate_errors(); |     auto proc_net_adapters_file = Core::Stream::File::open("/sys/kernel/net/adapters"sv, Core::Stream::OpenMode::Read).release_value_but_fixme_should_propagate_errors(); | ||||||
|     auto data = proc_net_adapters_file->read_all().release_value_but_fixme_should_propagate_errors(); |     auto data = proc_net_adapters_file->read_all().release_value_but_fixme_should_propagate_errors(); | ||||||
|     JsonParser parser(data); |     JsonParser parser(data); | ||||||
|     JsonValue proc_net_adapters_json = parser.parse().release_value_but_fixme_should_propagate_errors(); |     JsonValue proc_net_adapters_json = parser.parse().release_value_but_fixme_should_propagate_errors(); | ||||||
|  |  | ||||||
|  | @ -21,8 +21,8 @@ ErrorOr<int> serenity_main(Main::Arguments args) | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/bin/NetworkServer", "x")); |     TRY(Core::System::unveil("/bin/NetworkServer", "x")); | ||||||
|     TRY(Core::System::unveil("/etc/Network.ini", "rwc")); |     TRY(Core::System::unveil("/etc/Network.ini", "rwc")); | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/proc/net/adapters", "r")); |     TRY(Core::System::unveil("/sys/kernel/net/adapters", "r")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/clipboard", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/clipboard", "rw")); | ||||||
|     TRY(Core::System::unveil("/tmp/portal/window", "rw")); |     TRY(Core::System::unveil("/tmp/portal/window", "rw")); | ||||||
|  |  | ||||||
|  | @ -34,7 +34,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::pledge("stdio recvfd sendfd rpath unix")); |     TRY(Core::System::pledge("stdio recvfd sendfd rpath unix")); | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil(nullptr, nullptr)); |     TRY(Core::System::unveil(nullptr, nullptr)); | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     args_parser.add_positional_argument(image_file, "Image file to open", "path", Core::ArgsParser::Required::No); |     args_parser.add_positional_argument(image_file, "Image file to open", "path", Core::ArgsParser::Required::No); | ||||||
|     args_parser.parse(arguments); |     args_parser.parse(arguments); | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/clipboard", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/clipboard", "rw")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); | ||||||
|  |  | ||||||
|  | @ -79,7 +79,7 @@ struct MountInfo { | ||||||
| static void fill_mounts(Vector<MountInfo>& output) | static void fill_mounts(Vector<MountInfo>& output) | ||||||
| { | { | ||||||
|     // Output info about currently mounted filesystems.
 |     // Output info about currently mounted filesystems.
 | ||||||
|     auto file = Core::File::construct("/proc/df"); |     auto file = Core::File::construct("/sys/kernel/df"); | ||||||
|     if (!file->open(Core::OpenMode::ReadOnly)) { |     if (!file->open(Core::OpenMode::ReadOnly)) { | ||||||
|         warnln("Failed to open {}: {}", file->name(), file->error_string()); |         warnln("Failed to open {}: {}", file->name(), file->error_string()); | ||||||
|         return; |         return; | ||||||
|  |  | ||||||
|  | @ -44,7 +44,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/webcontent", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/webcontent", "rw")); | ||||||
|     // For writing temporary files when exporting.
 |     // For writing temporary files when exporting.
 | ||||||
|     TRY(Core::System::unveil("/tmp", "crw")); |     TRY(Core::System::unveil("/tmp", "crw")); | ||||||
|  |  | ||||||
|  | @ -105,7 +105,7 @@ static inline u64 page_count_to_bytes(size_t count) | ||||||
| 
 | 
 | ||||||
| void MemoryStatsWidget::refresh() | void MemoryStatsWidget::refresh() | ||||||
| { | { | ||||||
|     auto proc_memstat = Core::File::construct("/proc/memstat"); |     auto proc_memstat = Core::File::construct("/sys/kernel/memstat"); | ||||||
|     if (!proc_memstat->open(Core::OpenMode::ReadOnly)) |     if (!proc_memstat->open(Core::OpenMode::ReadOnly)) | ||||||
|         VERIFY_NOT_REACHED(); |         VERIFY_NOT_REACHED(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -69,7 +69,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget() | ||||||
|         net_adapters_fields.empend("packets_out", "Pkt Out", Gfx::TextAlignment::CenterRight); |         net_adapters_fields.empend("packets_out", "Pkt Out", Gfx::TextAlignment::CenterRight); | ||||||
|         net_adapters_fields.empend("bytes_in", "Bytes In", Gfx::TextAlignment::CenterRight); |         net_adapters_fields.empend("bytes_in", "Bytes In", Gfx::TextAlignment::CenterRight); | ||||||
|         net_adapters_fields.empend("bytes_out", "Bytes Out", Gfx::TextAlignment::CenterRight); |         net_adapters_fields.empend("bytes_out", "Bytes Out", Gfx::TextAlignment::CenterRight); | ||||||
|         m_adapter_model = GUI::JsonArrayModel::create("/proc/net/adapters", move(net_adapters_fields)); |         m_adapter_model = GUI::JsonArrayModel::create("/sys/kernel/net/adapters", move(net_adapters_fields)); | ||||||
|         m_adapter_table_view->set_model(MUST(GUI::SortingProxyModel::create(*m_adapter_model))); |         m_adapter_table_view->set_model(MUST(GUI::SortingProxyModel::create(*m_adapter_model))); | ||||||
| 
 | 
 | ||||||
|         auto& tcp_sockets_group_box = add<GUI::GroupBox>("TCP Sockets"sv); |         auto& tcp_sockets_group_box = add<GUI::GroupBox>("TCP Sockets"sv); | ||||||
|  | @ -90,7 +90,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget() | ||||||
|         net_tcp_fields.empend("packets_out", "Pkt Out", Gfx::TextAlignment::CenterRight); |         net_tcp_fields.empend("packets_out", "Pkt Out", Gfx::TextAlignment::CenterRight); | ||||||
|         net_tcp_fields.empend("bytes_in", "Bytes In", Gfx::TextAlignment::CenterRight); |         net_tcp_fields.empend("bytes_in", "Bytes In", Gfx::TextAlignment::CenterRight); | ||||||
|         net_tcp_fields.empend("bytes_out", "Bytes Out", Gfx::TextAlignment::CenterRight); |         net_tcp_fields.empend("bytes_out", "Bytes Out", Gfx::TextAlignment::CenterRight); | ||||||
|         m_tcp_socket_model = GUI::JsonArrayModel::create("/proc/net/tcp", move(net_tcp_fields)); |         m_tcp_socket_model = GUI::JsonArrayModel::create("/sys/kernel/net/tcp", move(net_tcp_fields)); | ||||||
|         m_tcp_socket_table_view->set_model(MUST(GUI::SortingProxyModel::create(*m_tcp_socket_model))); |         m_tcp_socket_table_view->set_model(MUST(GUI::SortingProxyModel::create(*m_tcp_socket_model))); | ||||||
| 
 | 
 | ||||||
|         auto& udp_sockets_group_box = add<GUI::GroupBox>("UDP Sockets"sv); |         auto& udp_sockets_group_box = add<GUI::GroupBox>("UDP Sockets"sv); | ||||||
|  | @ -104,7 +104,7 @@ NetworkStatisticsWidget::NetworkStatisticsWidget() | ||||||
|         net_udp_fields.empend("peer_port", "Port", Gfx::TextAlignment::CenterRight); |         net_udp_fields.empend("peer_port", "Port", Gfx::TextAlignment::CenterRight); | ||||||
|         net_udp_fields.empend("local_address", "Local", Gfx::TextAlignment::CenterLeft); |         net_udp_fields.empend("local_address", "Local", Gfx::TextAlignment::CenterLeft); | ||||||
|         net_udp_fields.empend("local_port", "Port", Gfx::TextAlignment::CenterRight); |         net_udp_fields.empend("local_port", "Port", Gfx::TextAlignment::CenterRight); | ||||||
|         m_udp_socket_model = GUI::JsonArrayModel::create("/proc/net/udp", move(net_udp_fields)); |         m_udp_socket_model = GUI::JsonArrayModel::create("/sys/kernel/net/udp", move(net_udp_fields)); | ||||||
|         m_udp_socket_table_view->set_model(MUST(GUI::SortingProxyModel::create(*m_udp_socket_model))); |         m_udp_socket_table_view->set_model(MUST(GUI::SortingProxyModel::create(*m_udp_socket_model))); | ||||||
| 
 | 
 | ||||||
|         m_update_timer = add<Core::Timer>( |         m_update_timer = add<Core::Timer>( | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ ProcessModel::ProcessModel() | ||||||
|     VERIFY(!s_the); |     VERIFY(!s_the); | ||||||
|     s_the = this; |     s_the = this; | ||||||
| 
 | 
 | ||||||
|     auto file = Core::File::construct("/proc/cpuinfo"); |     auto file = Core::File::construct("/sys/kernel/cpuinfo"); | ||||||
|     if (file->open(Core::OpenMode::ReadOnly)) { |     if (file->open(Core::OpenMode::ReadOnly)) { | ||||||
|         auto buffer = file->read_all(); |         auto buffer = file->read_all(); | ||||||
|         auto json = JsonValue::from_string({ buffer }); |         auto json = JsonValue::from_string({ buffer }); | ||||||
|  |  | ||||||
|  | @ -202,7 +202,7 @@ public: | ||||||
|             df_fields.empend("total_inode_count", "Total inodes", Gfx::TextAlignment::CenterRight); |             df_fields.empend("total_inode_count", "Total inodes", Gfx::TextAlignment::CenterRight); | ||||||
|             df_fields.empend("block_size", "Block size", Gfx::TextAlignment::CenterRight); |             df_fields.empend("block_size", "Block size", Gfx::TextAlignment::CenterRight); | ||||||
| 
 | 
 | ||||||
|             fs_table_view.set_model(MUST(GUI::SortingProxyModel::create(GUI::JsonArrayModel::create("/proc/df", move(df_fields))))); |             fs_table_view.set_model(MUST(GUI::SortingProxyModel::create(GUI::JsonArrayModel::create("/sys/kernel/df", move(df_fields))))); | ||||||
| 
 | 
 | ||||||
|             fs_table_view.set_column_painting_delegate(3, make<ProgressbarPaintingDelegate>()); |             fs_table_view.set_column_painting_delegate(3, make<ProgressbarPaintingDelegate>()); | ||||||
| 
 | 
 | ||||||
|  | @ -243,6 +243,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     TRY(Core::System::unveil("/etc/passwd", "r")); |     TRY(Core::System::unveil("/etc/passwd", "r")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil("/proc", "r")); |     TRY(Core::System::unveil("/proc", "r")); | ||||||
|  |     TRY(Core::System::unveil("/sys/kernel", "r")); | ||||||
|     TRY(Core::System::unveil("/dev", "r")); |     TRY(Core::System::unveil("/dev", "r")); | ||||||
|     TRY(Core::System::unveil("/bin", "r")); |     TRY(Core::System::unveil("/bin", "r")); | ||||||
|     TRY(Core::System::unveil("/usr/lib", "r")); |     TRY(Core::System::unveil("/usr/lib", "r")); | ||||||
|  |  | ||||||
|  | @ -423,7 +423,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|         return GUI::Window::CloseRequestDecision::StayOpen; |         return GUI::Window::CloseRequestDecision::StayOpen; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil("/bin", "r")); |     TRY(Core::System::unveil("/bin", "r")); | ||||||
|     TRY(Core::System::unveil("/proc", "r")); |     TRY(Core::System::unveil("/proc", "r")); | ||||||
|  |  | ||||||
|  | @ -31,7 +31,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     parser.add_positional_argument(file_to_edit, "File to edit, with optional starting line and column number", "file[:line[:column]]", Core::ArgsParser::Required::No); |     parser.add_positional_argument(file_to_edit, "File to edit, with optional starting line and column number", "file[:line[:column]]", Core::ArgsParser::Required::No); | ||||||
|     parser.parse(arguments); |     parser.parse(arguments); | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/webcontent", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/webcontent", "rw")); | ||||||
|  |  | ||||||
|  | @ -39,7 +39,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|         path = Core::File::absolute_path(file_to_edit); |         path = Core::File::absolute_path(file_to_edit); | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::pledge("stdio recvfd sendfd thread rpath unix")); |     TRY(Core::System::pledge("stdio recvfd sendfd thread rpath unix")); | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil(nullptr, nullptr)); |     TRY(Core::System::unveil(nullptr, nullptr)); | ||||||
|  |  | ||||||
|  | @ -19,7 +19,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
| 
 | 
 | ||||||
|     Config::pledge_domain("SystemServer"); |     Config::pledge_domain("SystemServer"); | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/webcontent", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/webcontent", "rw")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|  |  | ||||||
|  | @ -126,7 +126,7 @@ private: | ||||||
| 
 | 
 | ||||||
|     CatDog() |     CatDog() | ||||||
|         : m_temp_pos { 0, 0 } |         : m_temp_pos { 0, 0 } | ||||||
|         , m_proc_all(MUST(Core::File::open("/proc/all", Core::OpenMode::ReadOnly))) |         , m_proc_all(MUST(Core::File::open("/sys/kernel/processes", Core::OpenMode::ReadOnly))) | ||||||
|     { |     { | ||||||
|         set_image_by_main_state(); |         set_image_by_main_state(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -26,8 +26,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::pledge("stdio recvfd sendfd rpath")); |     TRY(Core::System::pledge("stdio recvfd sendfd rpath")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     // FIXME: For some reason, this is needed in the /proc/all shenanigans.
 |     // FIXME: For some reason, this is needed in the /sys/kernel/processes shenanigans.
 | ||||||
|     TRY(Core::System::unveil("/etc/passwd", "r")); |     TRY(Core::System::unveil("/etc/passwd", "r")); | ||||||
|     TRY(Core::System::unveil(nullptr, nullptr)); |     TRY(Core::System::unveil(nullptr, nullptr)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -40,7 +40,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
| 
 | 
 | ||||||
|     auto app = TRY(GUI::Application::try_create(arguments)); |     auto app = TRY(GUI::Application::try_create(arguments)); | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil(nullptr, nullptr)); |     TRY(Core::System::unveil(nullptr, nullptr)); | ||||||
|  |  | ||||||
|  | @ -17,7 +17,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     TRY(Core::System::pledge("stdio recvfd sendfd rpath unix thread")); |     TRY(Core::System::pledge("stdio recvfd sendfd rpath unix thread")); | ||||||
|     auto app = TRY(GUI::Application::try_create(arguments, Core::EventLoop::MakeInspectable::Yes)); |     auto app = TRY(GUI::Application::try_create(arguments, Core::EventLoop::MakeInspectable::Yes)); | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil("/etc/FileIconProvider.ini", "r")); |     TRY(Core::System::unveil("/etc/FileIconProvider.ini", "r")); | ||||||
|  |  | ||||||
|  | @ -40,7 +40,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil("/bin", "r")); |     TRY(Core::System::unveil("/bin", "r")); | ||||||
|     TRY(Core::System::unveil("/tmp", "rwc")); |     TRY(Core::System::unveil("/tmp", "rwc")); | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/etc/passwd", "r")); |     TRY(Core::System::unveil("/etc/passwd", "r")); | ||||||
|     TRY(Core::System::unveil(nullptr, nullptr)); |     TRY(Core::System::unveil(nullptr, nullptr)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -36,7 +36,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
|     auto window = TRY(GUI::Window::try_create()); |     auto window = TRY(GUI::Window::try_create()); | ||||||
|     auto widget = TRY(window->try_set_main_widget<ChessWidget>()); |     auto widget = TRY(window->try_set_main_widget<ChessWidget>()); | ||||||
| 
 | 
 | ||||||
|     TRY(Core::System::unveil("/proc/all", "r")); |     TRY(Core::System::unveil("/sys/kernel/processes", "r")); | ||||||
|     TRY(Core::System::unveil("/res", "r")); |     TRY(Core::System::unveil("/res", "r")); | ||||||
|     TRY(Core::System::unveil("/bin/ChessEngine", "x")); |     TRY(Core::System::unveil("/bin/ChessEngine", "x")); | ||||||
|     TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw")); |     TRY(Core::System::unveil("/tmp/session/%sid/portal/launch", "rw")); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Liav A
						Liav A