ladybird/Libraries/LibCore
Brian Gianforcaro 64ba289cfb LibCore: ConfFile::read_entry should not sneakily write default entries
I noticed on boot, WindowServer was getting an veil error:

    [WindowServer(13:13)]: Rejecting path '/res/themes/Default.ini' since it hasn't been unveiled with 'c' permission.
    [WindowServer(13:13)]: 0xc014367f  _ZN6Kernel3VFS34validate_path_against_process_veilEN2AK10StringViewEi +681
    [WindowServer(13:13)]: 0xc01439d7  _ZN6Kernel3VFS12resolve_pathEN2AK10StringViewERNS_7CustodyEPNS1_6RefPtrIS3_EEii +163
    [WindowServer(13:13)]: 0xc0143d03  _ZN6Kernel3VFS4openEN2AK10StringViewEitRNS_7CustodyENS1_8OptionalINS_9UidAndGidEEE +121
    [WindowServer(13:13)]: 0xc016fbc4  _ZN6Kernel7Process8sys$openEPKNS_7Syscall14SC_open_paramsE +854
    [WindowServer(13:13)]: 0xc0164af8  syscall_handler +1320
    [WindowServer(13:13)]: 0xc0164541  syscall_asm_entry +49
    [WindowServer(13:13)]: 0x08097ca0  open_with_path_length +24
    [WindowServer(13:13)]: 0x08097cf8  open +63
    [WindowServer(13:13)]: 0x080a3c59  fopen +31
    [WindowServer(13:13)]: 0x0806abf0  _ZN4Core10ConfigFile4syncEv +48
    [WindowServer(13:13)]: 0x0806af6a  _ZN4Core10ConfigFileD2Ev +16
    [WindowServer(13:13)]: 0x08093e2a  _ZN3Gfx17load_system_themeERKN2AK6StringE +1869
    [WindowServer(13:13)]: 0x08048633  main +491
    [WindowServer(13:13)]: 0x08048dae  _start +94

With some digging I found out that the ConfigFile class was causing
trying to flush writes of default values, not present in the .ini
file back to disk on destruction of the object.

This sneaky behavior from ConfigFile seems to violate the public facing
semantics of the function (it's const). It also makes it very hard to reason
about the system with technologies like unveil where we are trying to
explicitly state what is exposed to apps, how those exposed items can be
used.

The functionality also doesn't seem to be all that useful, as we'll just
return the default value from the API's anyway.

This change removes the write back of default values.
2020-08-02 21:11:28 +02:00
..
ArgsParser.cpp AK: Make string-to-number conversion helpers return Optional 2020-06-12 21:28:55 +02:00
ArgsParser.h LibCore: Allow ArgsParser::parse() to not exit on failure 2020-05-17 11:58:08 +02:00
CMakeLists.txt LibCore: Rename puff.c => puff.cpp 2020-07-29 14:41:57 +02:00
ConfigFile.cpp LibCore: ConfFile::read_entry should not sneakily write default entries 2020-08-02 21:11:28 +02:00
ConfigFile.h LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
DateTime.cpp LibCore: Add a primitive comparison function to DateTime 2020-05-07 10:23:58 +02:00
DateTime.h LibCore: Add a primitive comparison function to DateTime 2020-05-07 10:23:58 +02:00
DirIterator.cpp Misc: Replace "String(string_view)" with "string_view.to_string()" 2020-05-06 19:28:59 +02:00
DirIterator.h Userspace: Add missing #includes now that AK/StdLibExtras.h is smaller 2020-03-08 13:06:51 +01:00
ElapsedTimer.cpp LibCore: Use monotonic time when handling timers 2020-03-19 15:48:00 +01:00
ElapsedTimer.h LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Event.cpp LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Event.h LibCore: Add a forward declaration header 2020-02-14 23:31:18 +01:00
EventLoop.cpp LibCore: Add register_signal and unregister_signal to EventLoop 2020-07-09 21:58:07 +02:00
EventLoop.h LibCore: Add register_signal and unregister_signal to EventLoop 2020-07-09 21:58:07 +02:00
File.cpp Kernel: Move headers intended for userspace use into Kernel/API/ 2020-07-04 17:22:23 +02:00
File.h LibCore: Add File::read_link() :^) 2020-06-17 15:02:03 +02:00
Forward.h LibCore: Fix typo in Forward.h 2020-06-11 22:44:54 +02:00
GetPassword.cpp LibCore: add get_password(). 2020-07-28 17:07:22 +02:00
GetPassword.h LibCore: add get_password(). 2020-07-28 17:07:22 +02:00
Gzip.cpp LibCore: Trim decompressed Gzip output to size 2020-04-28 09:32:33 +02:00
Gzip.h Meta: Add a script check the presence of "#pragma once" in header files 2020-05-29 07:59:45 +02:00
IODevice.cpp LibCore: Make IODevice::can_read_line() const 2020-05-15 09:50:48 +02:00
IODevice.h LibCore: Make IODevice::can_read_line() const 2020-05-15 09:50:48 +02:00
IODeviceStreamReader.h LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
LocalServer.cpp LibCore: Remove some debug spam in Local{Server,Socket} 2020-06-22 21:21:38 +02:00
LocalServer.h LibCore: Remove a bunch of unnecessary forward declarations 2020-02-15 00:32:33 +01:00
LocalSocket.cpp LibCore: Remove some debug spam in Local{Server,Socket} 2020-06-22 21:21:38 +02:00
LocalSocket.h LibCore: Add API for taking over an accepted socket from SystemServer 2020-06-21 21:54:30 +02:00
MimeData.cpp LibCore+LibWeb: Move guess-mimetype-based-on-filename logic to LibCore 2020-07-27 19:57:20 +02:00
MimeData.h LibCore+LibWeb: Move guess-mimetype-based-on-filename logic to LibCore 2020-07-27 19:57:20 +02:00
NetworkJob.cpp ProtocolServer: Implement and handle download progress 2020-05-03 12:59:26 +02:00
NetworkJob.h ProtocolServer: Implement and handle download progress 2020-05-03 12:59:26 +02:00
NetworkResponse.cpp LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
NetworkResponse.h LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Notifier.cpp LibCore: Add a forward declaration header 2020-02-14 23:31:18 +01:00
Notifier.h LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Object.cpp LibCore: Turns some heap-allocated events into stack-allocated ones 2020-07-16 20:46:44 +02:00
Object.h LibCore+LibGUI: Switch to using AK::is and AK::downcast 2020-07-26 17:51:00 +02:00
ProcessStatisticsReader.cpp Kernel/LibCore: Expose processor id where a thread last ran 2020-07-01 12:07:01 +02:00
ProcessStatisticsReader.h Kernel/LibCore: Expose processor id where a thread last ran 2020-07-01 12:07:01 +02:00
puff.cpp LibCore: Rename puff.c => puff.cpp 2020-07-29 14:41:57 +02:00
puff.h Meta: Add a script check the presence of "#pragma once" in header files 2020-05-29 07:59:45 +02:00
Socket.cpp LibCore: Change the signature of Socket::send() to use Span. 2020-07-27 19:58:09 +02:00
Socket.h LibCore: Change the signature of Socket::send() to use Span. 2020-07-27 19:58:09 +02:00
SocketAddress.cpp LibCore: Move LogStream::operator<< overloads into cpp files 2020-02-15 00:58:52 +01:00
SocketAddress.h Userspace: Add missing #includes now that AK/StdLibExtras.h is smaller 2020-03-08 13:06:51 +01:00
StandardPaths.cpp AK: Rename FileSystemPath -> LexicalPath 2020-05-26 14:35:10 +02:00
StandardPaths.h LibCore: Add a standard downloads directory (~/Downloads) 2020-05-05 23:56:57 +02:00
SyscallUtils.h LibCore: Put safe_syscall() debug spam behind #ifdef 2020-06-22 21:19:10 +02:00
TCPServer.cpp Build: Make Lagom build under macOS (#2341) 2020-05-23 15:31:30 +02:00
TCPServer.h LibCore: Remove a bunch of unnecessary forward declarations 2020-02-15 00:32:33 +01:00
TCPSocket.cpp Build: Make Lagom build under macOS (#2341) 2020-05-23 15:31:30 +02:00
TCPSocket.h LibCore: Remove a bunch of unnecessary forward declarations 2020-02-15 00:32:33 +01:00
Timer.cpp LibCore: Add Timer::restart() convenience API 2020-06-11 22:35:37 +02:00
Timer.h LibCore: Add Timer::restart() convenience API 2020-06-11 22:35:37 +02:00
UDPServer.cpp Build: Make Lagom build under macOS (#2341) 2020-05-23 15:31:30 +02:00
UDPServer.h LibCore: Fix UDPServer up to properly receive data 2020-04-04 12:25:33 +02:00
UDPSocket.cpp Build: Make Lagom build under macOS (#2341) 2020-05-23 15:31:30 +02:00
UDPSocket.h LibCore: Rename Udp classes to UDP 2020-03-14 23:56:12 +01:00