Commit Graph

746 Commits

Author SHA1 Message Date
Mustafa Quraish
07419b8931 diff: Only color output when stdout is a tty
If we're redirecting the output somewhere, we likely don't want to
have ANSI codes in the middle of our diff output.
2021-09-24 14:32:52 +02:00
Mustafa Quraish
4173f2ffad diff: Show start/end of line ranges in source/target files
This behaves very much like the regular diff command, showing the
start lines and ranges of additions/changes/deletions in both the
source and target files.
2021-09-24 14:32:52 +02:00
Idan Horowitz
e12a707ca1 checksum: Stop reusing the same Core::File for multiple files
Since we were just repeatedly calling `->open()` on the same Core::File
no one was clearing it's internal buffer, which means hashing multiple
files in one go would result in different hashes than hashing each file
separately.
2021-09-21 20:36:19 +03:00
David Isaksson
5a91f5b320 Utilities: Fix asctl volume units
A while back the internal volume representation was changed from int to
double, but asctl was apparently never changed. This patch fixes that
issue.
2021-09-19 21:52:32 +02:00
Ali Mohammad Pur
436693c0c9 LibTLS: Use a setter for on_tls_ready_to_write with some more smarts
The callback should be called as soon as the connection is established,
and if we actually set the callback when it already is, we expect it to
be called immediately.
2021-09-19 21:10:23 +04:30
Andreas Kling
1be4cbd639 AK: Make Utf8View constructors inline and remove C string constructor
Using StringView instead of C strings is basically always preferable.
The only reason to use a C string is because you are calling a C API.
2021-09-18 19:54:24 +02:00
Mustafa Quraish
f552c26c79 Utilities: Add a basic diff utility 2021-09-17 16:56:59 +00:00
Ben Wiederhake
c680ef0a09 crash: Run automatically during CI 2021-09-16 20:51:24 +00:00
Ben Wiederhake
e8d37b7b17 crash: Check whether the msyscall mitigation actually works 2021-09-16 20:51:24 +00:00
Andreas Kling
63a0ebcc90 js: Add a simple loadJSON(path) built-in to load JSON from a file
This is very handy when you want to load data from /proc, for example.
2021-09-16 21:49:50 +02:00
Brian Gianforcaro
5df74c99ab Utilities: Use ElapsedTimer::start_new in allocate 2021-09-12 17:24:44 +00:00
Brian Gianforcaro
74ee7cabf2 Utilities: Use ElapsedTimer::start_new() in disk_bechmark 2021-09-12 17:24:44 +00:00
Brian Gianforcaro
df04283d61 LibCore: Make Account::authenticate take a SecretString
To encourage users to use the SecretString API, change the API so that
Account::authenticate only accepts a SecretString.
2021-09-12 16:36:52 +02:00
Brian Gianforcaro
9e667453c7 LibCore: Make get_password return SecretString instead of String
We shouldn't let secrets sit around in memory, as they could potentially
be retrieved by an attacker, or left in memory during a core dump.
2021-09-12 16:36:52 +02:00
Brian Gianforcaro
3590c55b69 Utilities: Fix incorrect error handling in traceroute
The result will be -1 on error, and the error value will be stored in
errno. PVS-Studio found this because result it saw result < 0 and new
EFAULT is < 0, so this could never be true.
2021-09-12 16:36:52 +02:00
Linus Groh
2b8d5696ab LibJS: Allocate a Realm next to GlobalObject in Interpreter::create()
Also pass a Realm reference to the Bytecode::Interpreter constructor,
just like we pass the GlobalObject.
2021-09-12 11:10:20 +01:00
Liav A
8d0dbdeaac Kernel+Userland: Introduce a new way to reboot and poweroff the machine
This change removes the halt and reboot syscalls, and create a new
mechanism to change the power state of the machine.
Instead of how power state was changed until now, put a SysFS node as
writable only for the superuser, that with a defined value, can result
in either reboot or poweroff.
In the future, a power group can be assigned to this node (which will be
the GroupID responsible for power management).

This opens an opportunity to permit to shutdown/reboot without superuser
permissions, so in the future, a userspace daemon can take control of
this node to perform power management operations without superuser
permissions, if we enforce different UserID/GroupID on that node.
2021-09-12 11:52:16 +02:00
Idan Horowitz
6704961c82 AK: Replace the mutable String::replace API with an immutable version
This removes the awkward String::replace API which was the only String
API which mutated the String and replaces it with a new immutable
version that returns a new String with the replacements applied. This
also fixes a couple of UAFs that were caused by the use of this API.

As an optimization an equivalent StringView::replace API was also added
to remove an unnecessary String allocations in the format of:
`String { view }.replace(...);`
2021-09-11 20:36:43 +03:00
Liav A
04ba31b8c5 Kernel+Userland: Remove loadable kernel moduless
These interfaces are broken for about 9 months, maybe longer than that.
At this point, this is just a dead code nobody tests or tries to use, so
let's remove it instead of keeping a stale code just for the sake of
keeping it and hoping someone will fix it.

To better justify this, I read that OpenBSD removed loadable kernel
modules in 5.7 release (2014), mainly for the same reason we do -
nobody used it so they had no good reason to maintain it.
Still, OpenBSD had LKMs being effectively working, which is not the
current state in our project for a long time.
An arguably better approach to minimize the Kernel image size is to
allow dropping drivers and features while compiling a new image.
2021-09-11 19:05:00 +02:00
Andreas Kling
c364520c24 LibJS+js+test-js: Add GC debug mode that keeps cells "alive" as zombies
This patch adds a `-z` option to js and test-js. When run in this mode,
garbage cells are never actually destroyed. We instead keep them around
in a special zombie state.

This allows us to validate that zombies don't get marked in future GC
scans (since there were not supposed to be any more references!) :^)

Cells get notified when they become a zombie (via did_become_zombie())
and this is used by WeakContainer cells to deregister themselves from
the heap.
2021-09-11 16:52:03 +02:00
Ben Wiederhake
2e4ec891da Everywhere: Fix format-vulnerabilities
Command used:
grep -Pirn '(out|warn)ln\((?!["\)]|format,|stderr,|stdout,|output, ")' \
     AK Kernel/ Tests/ Userland/
(Plus some manual reviewing.)

Let's pick ArgsParser as an example:
    outln(file, m_general_help);
This will fail at runtime if the general help happens to contain braces.

Even if this transformation turns out to be unnecessary in a place or
two, this way the code is "more obviously" correct.
2021-09-11 15:16:26 +01:00
Rodrigo Tobar
73e42917f9 Utilities: Show dynamic ELF info with "show all" option 2021-09-11 15:37:38 +03:00
Ben Wiederhake
e118ad3273 wasm: Avoid making StringView of temporary ByteBuffer 2021-09-11 13:22:51 +03:00
Ben Wiederhake
d9c1162a20 nproc: Avoid making StringView of temporary ByteBuffer 2021-09-11 13:22:51 +03:00
Timothy Flynn
cf1923edeb js: Implement pretty-printing of Intl.NumberFormat 2021-09-11 11:05:50 +01:00
Andreas Kling
6ad427993a Everywhere: Behaviour => Behavior 2021-09-07 13:53:14 +02:00
Liav A
25ea7461a0 Kernel/PCI: Simplify the entire subsystem
A couple of things were changed:
1. Semantic changes - PCI segments are now called PCI domains, to better
match what they are really. It's also the name that Linux gave, and it
seems that Wikipedia also uses this name.
We also remove PCI::ChangeableAddress, because it was used in the past
but now it's no longer being used.
2. There are no WindowedMMIOAccess or MMIOAccess classes anymore, as
they made a bunch of unnecessary complexity. Instead, Windowed access is
removed entirely (this was tested, but never was benchmarked), so we are
left with IO access and memory access options. The memory access option
is essentially mapping the PCI bus (from the chosen PCI domain), to
virtual memory as-is. This means that unless needed, at any time, there
is only one PCI bus being mapped, and this is changed if access to
another PCI bus in the same PCI domain is needed. For now, we don't
support mapping of different PCI buses from different PCI domains at the
same time, because basically it's still a non-issue for most machines
out there.
2. OOM-safety is increased, especially when constructing the Access
object. It means that we pre-allocating any needed resources, and we try
to find PCI domains (if requested to initialize memory access) after we
attempt to construct the Access object, so it's possible to fail at this
point "gracefully".
3. All PCI API functions are now separated into a different header file,
which means only "clients" of the PCI subsystem API will need to include
that header file.
4. Functional changes - we only allow now to enumerate the bus after
a hardware scan. This means that the old method "enumerate_hardware"
is removed, so, when initializing an Access object, the initializing
function must call rescan on it to force it to find devices. This makes
it possible to fail rescan, and also to defer it after construction from
both OOM-safety terms and hotplug capabilities.
2021-09-07 13:47:37 +02:00
Timothy Flynn
1a7443bec7 js: Implement pretty-printing of Intl.ListFormat 2021-09-06 23:49:56 +01:00
Linus Groh
fd895c7a24 js: Include calendar in pretty-printing output of more Temporal objects
We were only showing it for ZonedDateTime so far.
2021-09-06 23:10:16 +01:00
Linus Groh
cc8644ce34 js: Implement pretty-printing of Temporal.PlainMonthDay objects 2021-09-06 23:10:16 +01:00
Linus Groh
651feb6866 js: Implement pretty-printing of Temporal.PlainYearMonth objects 2021-09-06 23:10:16 +01:00
Ali Mohammad Pur
97e97bccab Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safe 2021-09-06 01:53:26 +02:00
Ali Mohammad Pur
3a9f00c59b Everywhere: Use OOM-safe ByteBuffer APIs where possible
If we can easily communicate failure, let's avoid asserting and report
failure instead.
2021-09-06 01:53:26 +02:00
Brian Gianforcaro
3e45c3ed90 Userland: Switch static_assert of type sizes to AK::AssertSize 2021-09-05 20:08:57 +02:00
Ralf Donau
4f0e2f2584 Utilities: Modernize output and comparison in the sort utility
Use the comparison operator of AK/String instead of strcmp(3) and
replace fput* by outln.
2021-09-05 00:15:26 +02:00
Karol Kosek
791309a3d2 Utilities: Support grepping recursively from paths in the argument
Previously, the recursive flag always searched for file contents from
the current directory, ignoring the path argument entirely.
2021-09-04 15:36:31 +04:30
Timothy Flynn
128779938d js: Implement pretty-printing of Intl.Locale 2021-09-02 17:56:42 +01:00
sin-ack
c93c54c656 js: Use CodepointOriented spans and use the codepoint length of token
We were previously using byte-oriented spans. This would work if not for
token.line_column() being in codepoints.
2021-09-01 23:04:26 +02:00
Andreas Kling
51ae913bfe LibIMAP: Stop leaking a Core::Promise<bool> in IMAP::Client::connect() 2021-09-01 23:02:18 +02:00
Peter Elliott
33d7fdca28 Everywhere: Use my cool new @serenityos.org email address 2021-09-01 11:37:25 +04:30
Mustafa Quraish
b0bd4be59a Config CLI: Handle missing config values correctly
If the domain/group/key doesn't exist in the config, exit with
non-zero status and don't print out anything.

Previously the CLI would print a single empty line if the config
value was not found with LibConfig. Now, we use the proper
`Config::Client::the().read_string()` API which can return an
`Optional` type indicating failure.`
2021-08-31 16:52:58 +02:00
TheFightingCatfish
c9b384da92 echo: Support octal, hexadecimal and unicode escape sequences 2021-08-31 16:49:45 +02:00
Jesse Buhagiar
59eab8148d Kernel/Userland: Expose usb device address and use it in lsusb
We now expose the `USBDevice`'s address in the SysFS object. This means
that device addresses are no longer determined by the name of the file
in the `/bus/usb/` directory. This was an incorrect way of determining
device address, as a standard PC can have multiple USB controllers
(and hence multiple buses) that can have overlapping device IDs.
2021-08-31 16:38:49 +02:00
Mahmoud Mandour
ac7c83689b ps: Sort using input order in case of -q
Now the output of `ps -q <list>` is sorted according to the order the
user specified.
2021-08-28 15:08:00 +04:30
Mahmoud Mandour
259ecb3d11 ps: Select specific processes by their PIDs
This adds a `-q` option, which expects a comma-separated list of PIDs as
a value. On using it, only the processes associated with the supplied
PIDs are output.
2021-08-28 15:08:00 +04:30
Ralf Donau
e36931fffe Utilities: Add a command line client for ConfigServer
This is an alternative to the ini utility which accesses the
configuration files through the newly introduced ConfigServer.
2021-08-28 08:24:48 +01:00
Mustafa Quraish
2dea772d48 shot: Get only cropped region from WindowServer
Previously, we were always getting the full screen(s) bitmap from
the WindowServer and cropping it manually. The `get_screen_bitmap`
function already took in a `crop_region`, so we are now utilizing
that.
2021-08-28 08:18:41 +01:00
kleines Filmröllchen
7d7d310df6 Base+Utilities: Add the asctl audio utility, replacing avol
The new asctl (audio server control) utility expands on avol with a
completely new command line interface (documented in the man page) that
supports retrieving and setting all exposed audio server settings, like
volume and sample rate. This is currently the only user-facing way of
changing the sample rate.
2021-08-27 23:35:27 +04:30
kleines Filmröllchen
d049626f40 Userland+LibAudio: Make audio applications support dynamic sample rate
All audio applications (aplay, Piano, Sound Player) respect the ability
of the system to have theoretically any sample rate. Therefore, they
resample their own audio into the system sample rate.

LibAudio previously had its loaders resample their own audio, even
though they expose their sample rate. This is now changed. The loaders
output audio data in their file's sample rate, which the user has to
query and resample appropriately. Resampling code from Buffer, WavLoader
and FlacLoader is removed.

Note that these applications only check the sample rate at startup,
which is reasonable (the user has to restart applications when changing
the sample rate). Fully dynamic adaptation could both lead to errors and
will require another IPC interface. This seems to be enough for now.
2021-08-27 23:35:27 +04:30
Timothy Flynn
1c2ac69e3c js: Implement pretty-printing of Intl.DisplayNames 2021-08-26 22:04:09 +01:00
Itamar
f5b69dce0b Utilities: Add -d option to gzip
This option specifies that we should perform decompression instead of
compression.
2021-08-22 16:51:18 +02:00
Ralf Donau
60a4da8e20 Utilities: Use File.error_string() instead of perror(3) in cpp-* 2021-08-22 02:01:58 +02:00
networkException
acde7d12b0 Everywhere: Rename get in ConfigFile::get_for_{lib,app,system} to open
This patch brings the ConfigFile helpers for opening lib, app and system
configs more inline with the regular ConfigFile::open functions.
2021-08-22 01:32:25 +02:00
networkException
938051feb8 Everywhere: Use Core::ConfigFile::AllowWriting::Yes to allow writing 2021-08-22 01:32:25 +02:00
Itamar
f91974677c LibCpp: Use lex_iterable() where applicable 2021-08-21 22:09:56 +02:00
Itamar
feab5e8a3e Utilities: Add cpp-lexer 2021-08-21 22:09:56 +02:00
Jan de Visser
9e43508d30 Utilities: Some minor changes in sql REPL tool
- Added a connection banner
- Added '.quit' synonym for '.exit'
- Do not display updated/created/deleted banner if there were no changes
2021-08-21 22:03:30 +02:00
Timothy Flynn
02e3633b7f AK: Move FormatParser definition from header to implementation file
This is primarily to be able to remove the GenericLexer include out of
Format.h as well. A subsequent commit will add AK::Result to
GenericLexer, which will cause naming conflicts with other structures
named Result. This can be avoided (for now) by preventing nearly every
file in the system from implicitly including GenericLexer.

Other changes in this commit are to add the GenericLexer include to
files where it is missing.
2021-08-19 23:49:25 +02:00
Andrew Kaster
332b29c741 LibTest+Utilities: Print a start message before each test in run-tests
It can sometimes be difficult to tell from the debug.log and test stdout
which test was the last to run before the test runner hangs or exits the
QEMU instance unexpectedly.

Print out a start message before each test is executed, along with a
progress message indicating which test out of how many tests we're about
to run.
2021-08-19 18:42:34 +02:00
Jean-Baptiste Boric
5a8de62a1a Utilities: Remove memset calls inside ls 2021-08-18 20:30:46 +02:00
Jean-Baptiste Boric
58cebf1b6f Utilities: Implement -p flag for cp 2021-08-18 20:30:46 +02:00
Jean-Baptiste Boric
91bcff2994 Utilities: Properly sort files in ls 2021-08-18 20:30:46 +02:00
kleines Filmröllchen
a9cbdcbcd0 Utilities: Make aplay respect loader errors
aplay would previously just retry a couple of times when the loader
encountered an error, even though there is a standard mechanism for
loaders to report errors. Now, aplay outputs these errors to the user
and exits.
2021-08-18 18:16:48 +02:00
Sergey Bugaev
6c9343e262 Userland: Also cache d_type in find(1)
Since readdir() actually gives us the file type, we don't have
to stat it again to know whether it's a directory! This means that
'find /' can process the majority of files without ever calling
stat() on them, simply by reading directories.

In addition, the TypeCommand (-t) can make use of this info too,
so, for instance, a 'find / -t d' does not need to stat anything
either.

This gives us a final huge speedup :^)
2021-08-18 18:13:59 +02:00
Sergey Bugaev
548a880310 Userland: Cache stat in find(1)
We have multiple commands that are implemented in terms of stat.
Let's cache the stat in FileData after we query it once.

This gives us another large speed-up :^)
2021-08-18 18:13:59 +02:00
Sergey Bugaev
d4232d5ee2 Userland: Simplify recursion in find(1)
Now walk_tree() itself checks whether it should descend into a file
(if the file is a directory) or not.
2021-08-18 18:13:59 +02:00
Sergey Bugaev
ad15d0c880 Userland: Ditch Core::DirIterator for readdir() in find(1)
While Core::DirIterator is nice C++ API, we want more low-level
control here. In particular, we want to open the directory using
openat(), to also not pay the cost of re-traversing the path
components we have already resolved previously.

This gives us another nice speedup :^)

Also, in the future commits this will allow us to make use of more
data from the returned struct dirent, to speed things up even further.
2021-08-18 18:13:59 +02:00
Sergey Bugaev
4c126ea908 Userland: Use fstatat() in find(1)
This speeds things up noticeably :^)

The idea here is that a directory fd is a way to hold onto
the results of path resolution that the kernel has already done
for us. This way we don't ask the kernel to resolve the same
parent directories over and over.
2021-08-18 18:13:59 +02:00
Sergey Bugaev
e526a7641f Userland: Wrap path a into struct in find(1)
Also, replace the raw string by a LexicalPath.

Both are weird changes to make on their own; but they set
the stage for what's to come next.
2021-08-18 18:13:59 +02:00
Nico Weber
9fd2f97d27 echo: Implement -e flag
This lets you do things like `echo -e '\e[31mhello\e[m'` to print
red text, without having to resort to the tyranny of printf(1).
2021-08-17 19:59:23 +01:00
pyunbiwi
68d07320cf Userland: Add as-user execution to the pls utility
Commands may be executed as a specific user by passing the user's UID to
the '-u' flag in pls.
2021-08-16 21:16:30 +02:00
davidot
7613c22b06 LibJS: Add a mode to parse JS as a module
In a module strict mode should be enabled at the start of parsing and we
allow import and export statements.
2021-08-15 23:51:47 +01:00
Andreas Kling
1b739a72c2 Kernel+Userland: Remove chroot functionality
We are not using this for anything and it's just been sitting there
gathering dust for well over a year, so let's stop carrying all this
complexity around for no good reason.
2021-08-15 12:44:35 +02:00
Brian Gianforcaro
188e5f018f ddate: Use DateTime::now() for time 2021-08-15 12:20:38 +02:00
Brian Gianforcaro
3870f4160d date: Use DateTime::now() for time, cleanup duplicate returns 2021-08-15 12:20:38 +02:00
Andreas Kling
661bd992b0 Kernel+LibC: Share definitions for net/{if,if_arp,route}.h 2021-08-14 19:58:11 +02:00
Itamar
fd864fbb74 Utilities: Add 'file' and 'definitions' arguments to cpp-preprocessor
The 'file' argument allows specifying a file path.
The 'definitions' flag controls whether preprocessor definitions are
printed.
2021-08-14 12:40:55 +02:00
Itamar
8505fcb8ae LibCpp: Understand preprocessor macro definition and invocation
The preprocessor now understands when a function-like macro is defined,
and can also parse calls to such macros.

The actual evaluation of function-like macros will be done in a
separate commit.
2021-08-14 12:40:55 +02:00
Itamar
06e47ce7aa Utilities: Rename PreprocessorTest=>cpp-preprocessor 2021-08-14 12:40:55 +02:00
brapru
8059f28977 Utilities: Add program argument for netstat to display connection pid
Adds netstat command line argument to display slash-separated pair of
the id and name of the process that owns the socket. User must have
superuser privileges to see information on non-owned sockets.
2021-08-13 20:03:57 +04:30
Liav A
bf1adc2d5d Kernel+LibC: Use 64 bit values for ino_t
Since the InodeIndex encapsulates a 64 bit value, it is correct to
ensure that the Kernel is exposing the entire value and the LibC is
aware of it.

This commit requires an entire re-compile because it's essentially a
change in the Kernel ABI, together with a corresponding change in LibC.
2021-08-12 20:57:32 +02:00
TheFightingCatfish
fdde19d616 Utilities: Add option to control when to use colored output for grep
Fixes #9351.
2021-08-12 18:57:21 +02:00
Jean-Baptiste Boric
9b2cc9580b Userland: Add partial support for complex specifications to tr 2021-08-12 00:41:13 +02:00
Jean-Baptiste Boric
310eb72f72 Userland: Add support for --delete flag as alias of -d to tr 2021-08-12 00:41:13 +02:00
Jean-Baptiste Boric
89ba022ede Userland: Add support for -c/--complement flag to tr 2021-08-12 00:41:13 +02:00
Jean-Baptiste Boric
7f2d3df906 Userland: Add support for multiple character translations to tr 2021-08-12 00:41:13 +02:00
Andreas Kling
9ae8cd823c profile: Always enable PERF_EVENT_SIGNPOST 2021-08-12 00:03:38 +02:00
Jean-Baptiste Boric
0286160b62 Kernel: Add syscall performance event type
This allows tracing the syscalls made by a thread through the kernel's
performance event framework, which is similar in principle to strace.

Currently, this merely logs a stack backtrace to the current thread's
performance event buffer whenever a syscall is made, if profiling is
enabled. Future improvements could include tracing the arguments and
the return value, for example.
2021-08-10 21:55:48 +02:00
Itamar
4673a517f6 LibCpp: Do lexing in the Preprocessor
We now call Preprocessor::process_and_lex() and pass the result to the
parser.

Doing the lexing in the preprocessor will allow us to maintain the
original position information of tokens after substituting definitions.
2021-08-07 21:24:11 +02:00
Andreas Kling
af46f2214c Kernel: Make a bunch of "char const* to_string()" return StringView 2021-08-06 00:37:47 +02:00
brapru
a037e0ffec Utilities: Improve the arp information output
This updates the arp command to use output styles similar to other
utilities.
2021-08-05 09:30:35 +02:00
brapru
3bd6905ea8 Utilities: Add pledge and unveil protections in arp 2021-08-05 09:30:35 +02:00
Thomas Wagenveld
4181c0330c Ping: Add -s argument to specify the payload size of the ping
Change the static buffers to ByteBuffers to deal with the dynamic
size of the incoming and outgoing packets. Use sizeof(struct ip) rather
than the magic number '20' for the IPv4 header size.
Report the size of the reply packet to the console.
2021-08-03 09:06:11 +02:00
Ali Mohammad Pur
dc68c765b7 LibCpp: Correctly parse lines that end in '\'
Such lines should be considered to be joined into the next line.
This makes multiline preprocessor stuff "work".
2021-08-02 01:03:59 +02:00
Linus Groh
0990c23fc3 js: Implement pretty-printing of Temporal.ZonedDateTime objects 2021-08-01 20:31:31 +01:00
LuK1337
feacf774fb cksum: Print argv[0] on failed read
Forgot to do it in c5df5e5.
2021-08-01 19:26:57 +04:30
LuK1337
cf4bd4e4c9 cksum: Display adler32/crc32 sums as hex numbers
This basically follows what `crc32` and `xrdadler32` does on Linux
distros.
2021-08-01 13:02:16 +02:00
LuK1337
c5df5e504c cksum: Don't read the entire input file in memory
Same as `checksum`, in some cases we just can't load whole file into
memory.
2021-08-01 13:02:16 +02:00
Brian Gianforcaro
219d4ba376 Utilities: Remove unused header includes 2021-08-01 08:10:16 +02:00
Ryan Liptak
b0a4bcb688 shot: Make output filename a hyperlink when applicable
The hyperlink only gets printed when stdout is a TTY, so e.g. something
like `shot | cat` will not get the hyperlink escapes.
2021-08-01 08:04:53 +02:00
sin-ack
ce3f8661fb Userland: Fix id(1) printing the user's primary group for extra gids
This regressed in 538cc9d9 because of a typo.
2021-07-31 17:56:53 +02:00
Lennon Donaghy
e426e15101 Utilities: Make 'less' act more like 'more' when emulating 'more' :^) 2021-07-29 01:23:07 +02:00
Lennon Donaghy
e9bd81a6a0 Utilities: Add half-page scrolling + number modifiers to 'less'
- 'u' and 'd' now scroll up and down half a page
- Typing a number followed by 'j', 'k', 'return', 'up' or 'down' will
  scroll that many lines in the appropriate direction
- Typing a number followed by 'g' or 'G' will scroll directly to the
  line corresponding to that number
2021-07-29 01:23:07 +02:00
Lennon Donaghy
a071dba1ef Utilities: Add fix for 'less' not buffering the correct number of lines
'down_n()' now correctly buffers the needed number of lines, previously
there were issues with using it to scroll much more than the existing
buffer.
2021-07-29 01:23:07 +02:00
Linus Groh
c69d8b6925 js: Implement pretty-printing of Temporal.PlainTime objects 2021-07-28 21:57:30 +01:00
Lennon Donaghy
c4887882cc Utilities: Allow 'less' to scroll to top/bottom using 'G' and 'g' 2021-07-27 13:08:43 +02:00
Andreas Kling
d01b4327fa LibGfx: Improve ImageDecoder construction
Previously, ImageDecoder::create() would return a NonnullRefPtr and
could not "fail", although the returned decoder may be "invalid" which
you then had to check anyway.

The new interface looks like this:

    static RefPtr<Gfx::ImageDecoder> try_create(ReadonlyBytes);

This simplifies ImageDecoder since it no longer has to worry about its
validity. Client code gets slightly clearer as well.
2021-07-27 01:17:05 +02:00
Patrick Meyer
83f88df757 Kernel: Add option to build with coverage instrumentation and KCOV
GCC and Clang allow us to inject a call to a function named
__sanitizer_cov_trace_pc on every edge. This function has to be defined
by us. By noting down the caller in that function we can trace the code
we have encountered during execution. Such information is used by
coverage guided fuzzers like AFL and LibFuzzer to determine if a new
input resulted in a new code path. This makes fuzzing much more
effective.

Additionally this adds a basic KCOV implementation. KCOV is an API that
allows user space to request the kernel to start collecting coverage
information for a given user space thread. Furthermore KCOV then exposes
the collected program counters to user space via a BlockDevice which can
be mmaped from user space.

This work is required to add effective support for fuzzing SerenityOS to
the Syzkaller syscall fuzzer. :^) :^)
2021-07-26 17:40:28 +02:00
brapru
bdaaff70cb Utilities: Support static assignment of the ARP table 2021-07-25 17:57:08 +02:00
brapru
3013ca5fd0 Utilities: Add count option for ping 2021-07-25 00:32:32 +02:00
Linus Groh
40580696a6 js: Implement pretty-printing of Temporal.PlainDateTime objects 2021-07-22 21:19:40 +01:00
Linus Groh
93e52f6ad8 js: Implement pretty-printing of Temporal.PlainDate objects 2021-07-22 21:19:40 +01:00
Gunnar Beutner
60d6137e73 Userland: Use /proc/kernel_base to determine the kernel base address
This removes all the hard-coded kernel base addresses from userspace
tools.

One downside for this is that e.g. Profiler no longer uses a different
color for kernel symbols when run as a non-root user.
2021-07-22 21:38:23 +02:00
Gunnar Beutner
0e0985f15c Utilities: Make the columns for readelf fit all reloc types on x86_64 2021-07-22 08:57:01 +02:00
Gunnar Beutner
db1c5c4830 LibELF+Utilities: Avoid truncating 64-bit values
This fixes displaying 64-bit addresses in readelf and also fixes
showing backtraces from core dumps on x86_64.
2021-07-22 08:57:01 +02:00
Gunnar Beutner
36c3927169 Utilities: Make sure columns are properly aligned for readelf on x86_64 2021-07-22 08:57:01 +02:00
Gunnar Beutner
29c5dcd2fa Utilities: Make sure columns are properly aligned for pmap on x86_64 2021-07-22 08:57:01 +02:00
Gunnar Beutner
11e02f222d AK: Add a getter to JsonValue to get machine-native addresses 2021-07-22 08:57:01 +02:00
Gunnar Beutner
36e36507d5 Everywhere: Prefer using {:#x} over 0x{:x}
We have a dedicated format specifier which adds the "0x" prefix, so
let's use that instead of adding it manually.
2021-07-22 08:57:01 +02:00
Gunnar Beutner
31f30e732a Everywhere: Prefix hexadecimal numbers with 0x
Depending on the values it might be difficult to figure out whether a
value is decimal or hexadecimal. So let's make this more obvious. Also
this allows copying and pasting those numbers into GNOME calculator and
probably also other apps which auto-detect the base.
2021-07-22 08:57:01 +02:00
Andreas Kling
c7d891765c LibGfx: Use "try_" prefix for static factory functions
Also mark them as [[nodiscard]].
2021-07-21 18:02:15 +02:00
Gunnar Beutner
60b52cfb02 Userland: Hardcode the x86_64 kernel base address for now 2021-07-20 15:12:19 +02:00
Hendiadyoin1
ed46d52252 Everywhere: Use AK/Math.h if applicable
AK's version should see better inlining behaviors, than the LibM one.
We avoid mixed usage for now though.

Also clean up some stale math includes and improper floatingpoint usage.
2021-07-19 16:34:21 +04:30
Andrew Kaster
ff8429a749 LibTest/Utilities: Add method for TestRunner to print failed test names
If a test run has a lot of tests in it, and they fill up the terminal
buffer, it can be difficult to find out exactly which tests have failed
from your large test run. Make TestRunner print out an optional Vector
of failed test names at the end of the run, and have run-tests add each
failed or crashed test to a Vector it uses for this purpose.
2021-07-19 05:17:05 +04:30
Tom
a635ff4e60 Everywhere: Make tracking cpu usage independent from system ticks
This switches tracking CPU usage to more accurately measure time in
user and kernel land using either the TSC or another time source.
This will also come in handy when implementing a tickless kernel mode.
2021-07-18 22:08:26 +02:00
Tom
7e77a2ec40 Everywhere: Improve CPU usage calculation
As threads come and go, we can't simply account for how many time
slices the threads at any given point may have been using. We need to
also account for threads that have since disappeared. This means we
also need to track how many time slices we have expired globally.

However, because this doesn't account for context switches outside of
the system timer tick values may still be under-reported. To solve this
we will need to track more accurate time information on each context
switch.

This also fixes top's cpu usage calculation which was still based on
the number of context switches.

Fixes #6473
2021-07-18 22:08:26 +02:00
Ali Mohammad Pur
f364fcec5d LibRegex+Everywhere: Make LibRegex more unicode-aware
This commit makes LibRegex (mostly) capable of operating on any of
the three main string views:
- StringView for raw strings
- Utf8View for utf-8 encoded strings
- Utf32View for raw unicode strings

As a result, regexps with unicode strings should be able to properly
handle utf-8 and not stop in the middle of a code point.
A future commit will update LibJS to use the correct type of string
depending on the flags.
2021-07-18 21:10:55 +04:30
Gunnar Beutner
ce123c3b7f pmap: Add support for 64-bit addresses 2021-07-18 17:31:13 +02:00
Gunnar Beutner
3ed29895e4 readelf: Add names for x86_64 relocations and machine type 2021-07-18 17:31:13 +02:00
Andreas Kling
b975a74a1d Kernel/USB: Move USB bus information from /proc to /sys
This patch moves all the USB data from /proc/bus/usb to /sys/bus/usb.
2021-07-18 00:55:16 +02:00
Ali Mohammad Pur
bacf5a7220 wasm: Don't try to print the function results if it traps 2021-07-17 01:13:39 +04:30
Ali Mohammad Pur
23b48f8fe1 Revert "LibWasm: Some more performance stuff (#8812)"
This reverts commit 35394dbfaa.
I pushed the wrong button again, hopefully this will be the last of
such incidents.
2021-07-17 01:11:28 +04:30
Ali Mohammad Pur
35394dbfaa
LibWasm: Some more performance stuff (#8812)
* wasm: Don't try to print the function results if it traps

* LibWasm: Inline some very hot functions

These are mostly pretty small functions too, and they were about ~10%
of runtime.

* LibWasm+Everywhere: Make the instruction count limit configurable

...and enable it for LibWeb and test-wasm.
Note that `wasm` will not be limited by this.

* LibWasm: Remove a useless use of ScopeGuard

There are no multiple exit paths in that function, so we can just put
the ending logic right at the end of the function instead.
2021-07-17 01:04:37 +04:30
Linus Groh
173630c5ef js: Implement pretty-printing of Temporal.Duration objects 2021-07-16 01:07:01 +01:00
Ali Mohammad Pur
71234b3716 Utilities: Make the js REPL autocomplete correctly handle new Ident
Previously, `new` was being recognised as an identifier, which was
preventing this from working.
2021-07-16 02:36:53 +04:30
Dhruv Maroo
30af999431
Utilities: Allow filenames containing '=' in dd (#8766) 2021-07-15 18:36:46 +04:30
M4x1m3
39e622c400 Utilities: Add groupdel 2021-07-15 11:16:58 +02:00
M4x1m3
21cb531be1 Utilities: Add groupadd 2021-07-15 11:16:58 +02:00
Linus Groh
c82c652ee4 js: Implement pretty-printing of Temporal.Calendar objects 2021-07-14 23:50:03 +01:00
Linus Groh
bb86d535a9 js: Tweak pretty-printing of Temporal.{Instant,TimeZone} objects
No need for the key/value style here, just put it right after the type.
2021-07-14 23:50:03 +01:00
TheFightingCatfish
a3400798f8 Utilities: Add an implementation of 'comm'
Add an implementation of 'comm' -- compare files line by line
2021-07-14 14:13:25 +04:30
Hendiadyoin1
b98e741237 Tests: Change test-filtering mechanism
We have a new config argument to add space separated exclude regex'
This is separate from "NotTestsPattern", because these are still Tests,
although they are not supposed to be run by the runner

This also adds the test for a working UserspaceEmulator to the tests run
2021-07-14 11:26:34 +04:30
brapru
9b5a1b5036 Utilities: Implement usermod command
Previously there was no way to modify existing user accounts.
2021-07-14 08:06:30 +02:00
Gunnar Beutner
4cf24c6ba2 Userland: Prefer using ARCH() over __LP64__ 2021-07-13 23:19:33 +02:00
luk1337
334499a3f4
du: Don't fail immediately when directory can't be read (#8719) 2021-07-13 17:30:38 +02:00
Ariel Don
4eba921d48 ls: Add option to list subdirectories recursively
List subdirectories encountered using -R or --recursive flags with ls.
2021-07-12 19:15:19 +04:30
Brandon van Houten
19d34414bc Utilities: Make less accept 'page up' and 'page down' keys 2021-07-12 16:10:01 +02:00
Andrew Kaster
2ca1193d9a Userland+Tests: Convert test_io to be LibTest based
Add a few extra tests as well, to make sure we don't have any future
TmpFs regressions.
2021-07-11 19:42:00 +02:00
Andrew Kaster
4cc75501d7 Utilities+Tests: Convert test_efault to be LibTest based
This test exposed a kernel panic in is_user_range calculations, so let's
convert it to be a LibTest test so we can prevent regressions in mmap,
the page allocator, and the memory manager.
2021-07-11 19:42:00 +02:00
Ali Mohammad Pur
a5bc366d9a expr: Make Match expressions comply with POSIX
They should print the contents of capture group 1, if it exists.
2021-07-10 23:14:08 +04:30
Nico Weber
1c69c686e3 chres: Make screen an optional parameter
Most people have only one screen.
2021-07-10 18:51:14 +01:00
Nico Weber
8cf348c14c chres: Unbreak scale factor setting after aa15bf81e4 2021-07-10 18:51:14 +01:00
Aziz Berkay Yesilyurt
9b0ff229e3 Utilities: Use alpha channel instead of opacity in shot
The way overlay was drawn is not the correct way to achieve window
transparency in selection mode. With this change, shot window becomes
truely transparent.
2021-07-10 21:22:25 +04:30
Ali Mohammad Pur
eca74088a0 grep: Use Basic POSIX regexps by default and make -E not the default 2021-07-10 13:33:08 +02:00
Ali Mohammad Pur
97f7132b82 expr: Use Basic Posix regular expressions
Dr.POSIX requires expr to use BREs, so let's use BREs.
Fixes #8506.
2021-07-10 13:33:08 +02:00
Ralf Donau
821b752993 Userland: Add fopen error handling to less 2021-07-10 10:32:01 +02:00
Jean-Baptiste Boric
934e53079f Utilities: Add ability to query specific user with id 2021-07-09 20:15:40 +02:00
Jean-Baptiste Boric
538cc9d99a Utilities: Use Core::Account for id 2021-07-09 20:15:40 +02:00
Jean-Baptiste Boric
3db1681214 Utilities: Fix return value of expr 2021-07-09 20:15:40 +02:00
Jean-Baptiste Boric
897a706075 Utilities: Add support for -d flag to tr 2021-07-09 20:15:40 +02:00
Jean-Baptiste Boric
eb65e41a9c Utilities: Implement pwd 2021-07-09 20:15:40 +02:00
Ali Mohammad Pur
e37f9fa7db LibPthread+Kernel: Add pthread_kill() and the thread_kill syscall 2021-07-09 15:36:50 +02:00
Aziz Berkay Yesilyurt
9b4729dd40 Userland: Add ability to capture rectangular region in shot
A click and drag selectable, transparent, fullscreen window is
displayed with the command line argument -r for screenshots.
2021-07-09 13:33:46 +04:30
Ali Mohammad Pur
0459a111b2 Revert "Userland: Add ability to screenshot rectangular region in shot (#8515)"
This reverts commit 1c06d77262.
This was squashed by mistake, the rebased version will follow.
2021-07-09 13:27:56 +04:30
Aziz Berkay Yesilyurt
1c06d77262
Userland: Add ability to screenshot rectangular region in shot (#8515)
* LibGUI: Verify m_window_id is not-zero in set_maximized

Window::set_maximized requires non-zero window id to be a valid call,
i.e. calling Window::show beforehand. A verify statement before the
server call can help developers by hinting correct usage.

* LibGUI: Paint background when the fullscreen window is transparent

The windows in the background are ignored when the window is fullscreen.
However, we still would like to see the background if that window is
transparent.

* Userland: Add ability to capture rectangular region in shot

A click and drag selectable, transparent, fullscreen window is
displayed with the command line argument -r for screenshots.
2021-07-09 13:11:24 +04:30
Jan de Visser
23ad4bcdf7 Utilities: Teach sql utility to use the SQLClient class
This allows the utility to connect to databases and submit SQL
statements.
2021-07-08 17:55:59 +04:30
Daniel Bertalan
44b6f402ae Utilities/run-tests: Don't use using enum
`using enum` statements will only be supported by the upcoming Clang 13
compiler, so the current code can't be built with the almost-ready Clang
toolchain yet.
2021-07-08 10:11:00 +02:00
Daniel Bertalan
98260c5862 LibC+Utilities: Add gnu::format attributes
Without these attributes present on these custom formatting functions,
Clang would warn use about nonliteral format strings. As an added bonus,
we now get type checking on these.
2021-07-08 10:11:00 +02:00
Daniel Bertalan
e8e628de57 Everywhere: Add Clang pragmas
We use these to prevent UB from being optimized away in `/bin/crash` and
to make the compiler not warn about the many implicit floating point
type promotions in LibM.
2021-07-08 10:11:00 +02:00
Daniel Bertalan
98a9a1d7f9 Everywhere: Add break after the last case label before default
We already do this in most places, so the style should be consistent.
Also, Clang does not like it, as this could cause an unexpected compile
error if some statements are added to the default label or a new label
is added above it.
2021-07-08 10:11:00 +02:00
Andreas Kling
b027466f41 WindowServer+wsctl: Add a simple utility for toggling "flash flush"
You can now put the WindowServer into "flash flush" mode by doing:

$ wsctl -f 1

To disable it, somewhat obviously:

$ wsctl -f 0
2021-07-07 22:56:46 +02:00
Idan Horowitz
795786387b LibJS: Remove the NativeProperty mechanism from LibJS
These were an ad-hoc way to implement special behaviour when reading or
writing to specific object properties. Because these were effectively
replaced by the abillity to override the internal methods of Object,
they are no longer needed.
2021-07-07 21:47:22 +01:00
Ralf Donau
6386c2d880 Userland: Add pledge to less 2021-07-07 20:27:40 +02:00
Linus Groh
96167e39e7 js: Implement pretty-printing of Temporal.Instant objects 2021-07-07 19:00:42 +01:00
Aziz Berkay Yesilyurt
5fbb1d9e01 Userland: Convert delay option to unsigned for shot
A negative delay option for shot was used to underflow when passed to
sleep. Now, it returns an error for a negative delay value.
2021-07-07 20:05:43 +04:30
Peter Elliott
a11658737a Userland: Less: emulate cat when stdout is not a tty
This is the most logical behavior when less is used in a pipe.
2021-07-07 20:01:15 +04:30
Peter Elliott
1ec061d666 Userland: Add pager option to man and use less by default 2021-07-07 20:01:15 +04:30
Peter Elliott
c6fa2f196a Userland: Add more(1) emulation to less(1)
This patch also removes the existing implementation of more, as it is
now redundant.
2021-07-07 20:01:15 +04:30
Peter Elliott
30aa9b837c Userland: Add minimal prompt support to less
GNU less has a pretty cool prompt format language. This patch adds
support for the language and specifiers for filename, linenumber, and
ending.
2021-07-07 20:01:15 +04:30
Peter Elliott
7ee1983db6 Userland: Add less, a better terminal pager
less is a re-implementation of gnu less, a terminal pager with backwards
scrolling and alternate screen support.
2021-07-07 20:01:15 +04:30
Sergey Bugaev
e8d5b16733 test-pthread: Add a mutex test 2021-07-07 17:08:40 +02:00
Linus Groh
5319694510 js: Implement pretty-printing of Temporal.TimeZone objects 2021-07-07 00:42:01 +01:00
Linus Groh
15070b76b3 js: Convert to east const 2021-07-06 23:58:50 +01:00
Sergey Bugaev
d91119ba78 test-pthread: Add semaphore tests 2021-07-06 17:25:34 +02:00
Linus Groh
0ba81dc0b7 LibJS: Remove Object::is_array() in favor of Value::is_array() and RTTI
It's way too easy to get this wrong: for the IsArray abstract operation,
Value::is_array() needs to be called. Since we have RTTI, the virtual
Object::is_array() method is not needed anymore - if we need to know
whether something is *actually* a JS::Array (we currently check in more
cases than we should, I think) and not a Proxy with an Array target, we
should do that in a way that doesn't look like an abstract operation.
2021-07-06 14:26:18 +01:00
Idan Horowitz
53f70e5208 LibJS: Remove the default length & attributes from define_native_*
These are usually incorrect, and people sometimes forget to add the
correct values as a result of them being optional, so they should just
be specified explicitly.
2021-07-06 14:20:30 +01:00
Idan Horowitz
a6b8291a9b LibJS: Add define_direct_property and remove the define_property helper
This removes all usages of the non-standard define_property helper
method and replaces all it's usages with the specification required
alternative or with define_direct_property where appropriate.
2021-07-06 14:20:30 +01:00
Linus Groh
09bd5f8772 LibJS: Rewrite most of Object for spec compliance :^)
This is a huge patch, I know. In hindsight this perhaps could've been
done slightly more incremental, but I started and then fixed everything
until it worked, and here we are. I tried splitting of some completely
unrelated changes into separate commits, however. Anyway.

This is a rewrite of most of Object, and by extension large parts of
Array, Proxy, Reflect, String, TypedArray, and some other things.

What we already had worked fine for about 90% of things, but getting the
last 10% right proved to be increasingly difficult with the current code
that sort of grew organically and is only very loosely based on the
spec - this became especially obvious when we started fixing a large
number of test262 failures.

Key changes include:

- 1:1 matching function names and parameters of all object-related
  functions, to avoid ambiguity. Previously we had things like put(),
  which the spec doesn't have - as a result it wasn't always clear which
  need to be used.
- Better separation between object abstract operations and internal
  methods - the former are always the same, the latter can be overridden
  (and are therefore virtual). The internal methods (i.e. [[Foo]] in the
  spec) are now prefixed with 'internal_' for clarity - again, it was
  previously not always clear which AO a certain method represents,
  get() could've been both Get and [[Get]] (I don't know which one it
  was closer to right now).
  Note that some of the old names have been kept until all code relying
  on them is updated, but they are now simple wrappers around the
  closest matching standard abstract operation.
- Simplifications of the storage layer: functions that write values to
  storage are now prefixed with 'storage_' to make their purpose clear,
  and as they are not part of the spec they should not contain any steps
  specified by it. Much functionality is now covered by the layers above
  it and was removed (e.g. handling of accessors, attribute checks).
- PropertyAttributes has been greatly simplified, and is being replaced
  by PropertyDescriptor - a concept similar to the current
  implementation, but more aligned with the actual spec. See the commit
  message of the previous commit where it was introduced for details.
- As a bonus, and since I had to look at the spec a whole lot anyway, I
  introduced more inline comments with the exact steps from the spec -
  this makes it super easy to verify correctness.
- East-const all the things.

As a result of all of this, things are much more correct but a bit
slower now. Retaining speed wasn't a consideration at all, I have done
no profiling of the new code - there might be low hanging fruits, which
we can then harvest separately.

Special thanks to Idan for helping me with this by tracking down bugs,
updating everything outside of LibJS to work with these changes (LibWeb,
Spreadsheet, HackStudio), as well as providing countless patches to fix
regressions I introduced - there still are very few (we got it down to
5), but we also get many new passing test262 tests in return. :^)

Co-authored-by: Idan Horowitz <idan.horowitz@gmail.com>
2021-07-04 22:07:36 +01:00
Linus Groh
c9d8aa6139 js: Handle detached ArrayBuffer in print_typed_array()
Co-authored-by: Idan Horowitz <idan.horowitz@gmail.com>
2021-07-04 22:07:36 +01:00
Aziz Berkay Yesilyurt
11ff3c11f4 Userland: Add pgrep 2021-07-04 14:27:47 +02:00
Gunnar Beutner
3bbe86d8ea Everywhere: Prefer using "..."sv over StringView { "..." } 2021-07-04 14:24:03 +02:00
Max Wipfli
3bdaed501e AK+Everywhere: Remove StringView::find_{first,last}_of(char) methods
This removes StringView::find_first_of(char) and find_last_of(char) and
replaces all its usages with find and find_last respectively. This is
because those two methods are functionally equivalent.
find_{first,last}_of should only be used if searching for multiple
different characters, which is never the case with the char argument.

This also adds the [[nodiscard]] to the remaining find_{first,last}_of
methods.
2021-07-02 21:54:21 +02:00
Ali Mohammad Pur
b538e15548 LibWasm: Give traps a reason and display it when needed
This makes debugging wasm code a bit easier, as we now know what fails
instead of just "too bad, something went wrong".
2021-07-02 04:53:01 +04:30
Hendiadyoin1
2c2cf90661 Utilities: Fix Build on x86_64 2021-06-30 19:05:51 +02:00
Andreas Kling
050db0cc33 run-tests: Update for LexicalPath API changes 2021-06-30 11:19:21 +02:00
Max Wipfli
7405536a1a AK+Everywhere: Use mostly StringView in LexicalPath
This changes the m_parts, m_dirname, m_basename, m_title and m_extension
member variables to StringViews onto the m_string String. It also
removes the m_is_absolute member in favour of computing if a path is
absolute in the is_absolute() getter. Due to this, the canonicalize()
method has been completely rewritten.

The parts() getter still returns a Vector<String>, although it is no
longer a const reference as m_parts is no longer a Vector<String>.
Rather, it is constructed from the StringViews in m_parts upon request.
The parts_view() getter has been added, which returns Vector<StringView>
const&. Most previous users of parts() have been changed to use
parts_view(), except where Strings are required.

Due to this change, it's is now no longer allow to create temporary
LexicalPath objects to call the dirname, basename, title, or extension
getters on them because the returned StringViews will point to possible
freed memory.
2021-06-30 11:13:54 +02:00
Max Wipfli
fc6d051dfd AK+Everywhere: Add and use static APIs for LexicalPath
The LexicalPath instance methods dirname(), basename(), title() and
extension() will be changed to return StringView const& in a further
commit. Due to this, users creating temporary LexicalPath objects just
to call one of those getters will recieve a StringView const& pointing
to a possible freed buffer.

To avoid this, static methods for those APIs have been added, which will
return a String by value to avoid those problems. All cases where
temporary LexicalPath objects have been used as described above haven
been changed to use the static APIs.
2021-06-30 11:13:54 +02:00
Max Wipfli
9b8f35259c AK: Remove the LexicalPath::is_valid() API
Since this is always set to true on the non-default constructor and
subsequently never modified, it is somewhat pointless. Furthermore,
there are arguably no invalid relative paths.
2021-06-30 11:13:54 +02:00
FalseHonesty
988e17ed05 LibVideo: Migrate to east-const style & apply other minor fixes
This patch brings all of LibVideo up to the east-const style in the
project. Additionally, it applies a few fixes from the reviews in #8170
that referred to older LibVideo code.
2021-06-30 11:03:51 +02:00
Andrew Kaster
ae4240788c Userland: Unlink file after waiting for child in run-tests
TestProcFs expects to be able to stat its stdout and stderr. The new
ProcFS implemetnation properly forwards the symlinks for
/proc/pid/fd/[1,2] to the temporary file that we had unlinked prior to
spawning the process. However, this makes it so that a normal stat on
the symlink to that file fails (as expected). Move the unlink to after
we've waited on the child, so that we know it won't be trying any funny
business with its stdout/stderr anymore.
2021-06-30 09:39:57 +04:30