Commit Graph

698 Commits

Author SHA1 Message Date
junior rantila
1071e4cf78 watch: Remove unnecessary call to StringBuilder::appendff 2021-10-23 11:41:18 +02:00
junior rantila
658eac5c46 Utilities: Change watch utility to use eastconst style 2021-10-23 11:41:18 +02:00
Ben Wiederhake
dad47a3dd1 man.serenityos.org: Use pandoc for listings and landing page
This makes all pages look and feel the same, because they all use the
default CSS generated by pandoc. Also, it inserts the banner everywhere
at the top, not only into the top-level index.html.

Credit to @xSlendiX for suggesting that `-B` works here.
2021-10-22 19:49:28 +03:00
Andrew Kaster
259ef76504 Utilities: Add fdtdump for dumping OpenFirmware Device Trees
Use the new LibDeviceTree to dump the contents of the device tree blob
(Flattened Device Tree) file passed on the command line.
2021-10-21 19:20:03 -07:00
Karol Kosek
6337d742bb logout: Add this utility to REQUIRED_TARGETS
The Shutdown Dialog needs it.

Related: a36d13e36c
2021-10-21 23:10:25 +02:00
Ben Wiederhake
3371a27018 adjtime: Drop unnecessary privileges unconditionally
Furthermore, this simplifies the control flow.
2021-10-21 15:41:22 +01:00
Valtteri Koskivuori
a3b3800cd4 Userland: Teach the file utility more about ELF files
It now shows some useful at-a-glance information about ELF files, like
it does on other *nix systems.
2021-10-21 01:14:09 +02:00
Valtteri Koskivuori
d1adf5bc5e LibELF+Userland: Move a few functions to Elf::Image
These were originally in `readelf`, but they became useful in
`file` as well, so they are now available in Elf::Image with a slightly
revised API.
2021-10-21 01:14:09 +02:00
Idan Horowitz
40eb3a39d4 LibJS: Rename define_native_function => define_old_native_function
This method will eventually be removed once all native functions are
converted to ThrowCompletionOr
2021-10-20 12:27:19 +01:00
Idan Horowitz
20163c0584 LibJS: Add ThrowCompletionOr versions of the JS native function macros
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and
JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all
native functions were converted to the new format.
2021-10-20 12:27:19 +01:00
Timothy Flynn
4739982c66 LibCore: Change Account::set_password to take a SecretString
This matches the API of Account::authenticate. The only caller to this
API is the passwd utility, which already has the new password stored as
a SecretString.
2021-10-19 18:19:33 +02:00
Idan Horowitz
20d990563c LibJS: Convert to_number() to ThrowCompletionOr 2021-10-18 08:01:38 +03:00
Peter Elliott
92b6e4fd76 TaskBar+Utilities: Add logout(1) command, and call it in ShutdownDialog
logout kills the session that SystemServer --user was started with.
2021-10-17 22:18:48 +02:00
Peter Elliott
7283b0b214 Utilities: Show PGID and SID in ps -f 2021-10-17 22:18:48 +02:00
SeekingBlues
9705580c53 rev: Unbreak reading from standard input
Since Core::File does not handle streaming input properly (see #5093
and #4198), we use the LibC APIs instead.
2021-10-17 12:07:09 -07:00
SeekingBlues
6d4e58efea tac: Unbreak reading from standard input
Since Core::File does not handle streaming input properly (see #5093
and #4198), we use the LibC APIs instead.
2021-10-17 12:07:09 -07:00
SeekingBlues
c63bdba955 shuf: Fix division by zero when no lines are read 2021-10-17 12:07:09 -07:00
SeekingBlues
638f39fbc1 sysctl: Allow showing or setting multiple variables
The `-w` option is enforced when setting variables.
2021-10-17 14:46:59 +02:00
Linus Groh
1adf57530c js: Implement pretty-printing of ShadowRealm 2021-10-14 00:41:41 +01:00
Ben Wiederhake
203ee58aa2 arp: Preserve error if only the first ioctl fails 2021-10-13 16:11:30 +02:00
Linus Groh
52976bfac6 LibJS: Convert to_object() to ThrowCompletionOr 2021-10-13 09:55:10 +01:00
Linus Groh
4d8912a92b LibJS: Convert to_string() to ThrowCompletionOr
Also update get_function_name() to use ThrowCompletionOr, but this is
not a standard AO and should be refactored out of existence eventually.
2021-10-13 09:55:10 +01:00
Rodrigo Tobar
e3dffdacb8 strace: Add command line options to filter syscalls
By default strace outputs all system calls the monitored process
invokes, but it's sometimes useful to either exclude some calls, or to
include only some others.

This commit adds two new command line options to specify two
exclusion/inclusion command-delimited lists of system calls. These are
then used to decide if an intercepted system call should be displayed in
the output or not.
2021-10-12 10:56:50 -07:00
Rodrigo Tobar
6ff56a96bd strace: Show sun_path on AF_UNIX socket addresses 2021-10-12 10:56:50 -07:00
Rodrigo Tobar
441a1ae35d strace: Add support for get{u,eu,g,eg,p,pp}id syscalls
All these take no arguments so there's no formatting to be done.
2021-10-12 10:56:50 -07:00
Rodrigo Tobar
1409cc8395 strace: Add formatting for clock_gettime 2021-10-12 10:56:50 -07:00
Rodrigo Tobar
78de54f0f1 strace: Add initial ioctl formatting
This is useful in general, but adding it is what finally helped
uncovering #10438.
2021-10-12 10:56:50 -07:00
Ben Wiederhake
8ff942b5a4 Manpages+markdown-checker: Permit only specific missing files
I can't write these manpages ad-hoc, and in most cases I don't want to
remove the link because it is justified. The hope is that with this
FIXME in place, there is more motivation to write these manpages for
someone who knows enough about them. Or at least we will introduce fewer
dead links in the future, making Help more useful.
2021-10-10 15:18:55 -07:00
Ben Wiederhake
3f88d65b78 markdown-checker: New tool that checks document links 2021-10-10 15:18:55 -07:00
Brian Gianforcaro
7b2506c054 Utilities: Fix null deref in groupdel when given a nonexistent group
Found By PVS-Studio
2021-10-10 03:10:05 -07:00
David Isaksson
410d81706d Utilities: Add way to get a storage devices block size in blockdev 2021-10-09 12:06:47 +02:00
David Isaksson
8d631dcd5e Utilities: Add blockdev utility
This new utility queries a block device for its size via the newly
introduced ioctl STORAGE_DEVICE_GET_SIZE request.
2021-10-09 12:06:47 +02:00
Nico Weber
f46a40a471 Utilities: Fix -Wunreachable-code warnings from clang 2021-10-08 23:33:46 +02:00
Rodrigo Tobar
96a67d24e9 Strace: Add formatting for misc syscalls
These are exit, realpath and getrandom. This required a bit of extra
infrastructure to deal with exit's void return type.
2021-10-07 08:47:49 +03:30
Rodrigo Tobar
8125edfe79 Strace: Add formatting for main memory-related syscalls
These include mmap, munmap, mprotect and mmap_set_name.
2021-10-07 08:47:49 +03:30
Rodrigo Tobar
9394cfcaf3 Strace: Add formatting for main socket syscalls
The formatting of these functions is not complete, but gives already
very good information to the user.
2021-10-07 08:47:49 +03:30
Rodrigo Tobar
a09b1879ca Strace: Add main infrastructure and formatting of main I/O operations
This commit introduces the main infrastructure used for turning register
values into user-facing values that can be printed by strace. This
includes the ability to copy data from a particular memory address in
the traced process. On top of this, (partial) formatting has been added
for the most common I/O operations (open, read, write, lseek, close,
stat, fstat).
2021-10-07 08:47:49 +03:30
Rodrigo Tobar
f7a0196764 Strace: Move output formatting to separate function
Moving the formatting of strace's output into a separate function will
allow us to introduce more complexity into the formatting logic without
touching the main body of the program.

The new function uses a switch statement to select how to format the
arguments and result depending on the syscall. At this point we only
include the default formatting, where the registers are simply dumped,
but later on we can add specializations for each system call we want to
support.
2021-10-07 08:47:49 +03:30
Linus Groh
fe802f5ff5 js: Fix pretty-printing of RegExp objects
Regressed in b7e5f08.

Use the newly available RegExpObject::escape_regexp_pattern() instead of
attempting to call the RegExp.prototype.source accessor getter directly.
2021-10-05 18:35:49 +01:00
Jan de Visser
f33a288ca4 SQL Utility: Implement reading sql files
Add a number of command line switches:
- '-r/--read': Read a SQL file and quit the REPL when done
- '-s/--source': Read a SQL file and return to a SQL prompt when done
- '--no-sqlrc': Do not read ~/.sqlrc on startup (see below)

Add a dot-command:
.read <filename>: Read a SQL file and return to a SQL prompt when done

In addition, the sql REPL will source the ~/.sqlrc file on startup if
it exists, unless the --no-sqlrc flag is set on startup.

Note the slight asymmetry between the --read command line flag (which
results in the program quitting when the file is read) and the .read
command (which doesn't cause a quit).

Also fix merge conflict with #10091
2021-10-05 02:22:19 +02:00
Jan de Visser
89835ec83c SQL Utility: Redesigned the input loop
The existing input loop called the `read_sql` method recursively. This
lead to strange behaviour in the event loop. This is solved by
encapsulating the REPL in an object and ensuring the `read_sql` method
is not called recursively. The method now returns after the first
recognized SQL statement or command.
2021-10-05 02:22:19 +02:00
Jan de Visser
9d9f082221 SQL Utility: Implement connection switching
You can now connect to a different database using the .connect meta
command.
2021-10-05 02:22:19 +02:00
Jan de Visser
e923cb3739 SQLServer+SQL+LibSQL: Allow sql client to specify the database name
The database the sql client connected to was 'hardcoded' to the login
name of the calling user.
- Extended the IPC API to be more expressive when connecting, by
returning the name of the database the client connected to in the
'connected' callback.
- Gave the sql client a command line argument (-d/--database) allowing
an alternative database name to be specified

A subsequent commit will have a dot command allowing the user to
connect to different databases from the same sql session.
2021-10-05 02:22:19 +02:00
Mahmoud Mandour
aca87ce146 sql: Account for the single quotes in syntax highlighting
Previously, a String literal token like 'hello' had every char
highlighted but for the last 'o' and the closing single quote. This is
because the token start is at the opening single quote but the `length`
variable only accounted for the value length without the single quotes.
2021-10-04 15:51:48 +02:00
Linus Groh
b7e5f08e56 LibJS: Convert Object::get() to ThrowCompletionOr
To no one's surprise, this patch is pretty big - this is possibly the
most used AO of all of them. Definitely worth it though.
2021-10-03 20:14:03 +01:00
davidot
f4f1397735 js: Allow for completion of lexically declared variables
This does require us to have a method which lists all the bindings in
a declarative environment which is not in the spec.
2021-10-03 17:42:05 +02:00
davidot
0be0e7ea6e js: Fix that auto completion of properties failed
For this we store the global environment in which we can do a lookup
for the references variable. This is probably not entirely as the spec
would specify as we would need a running executing context at all times
you do things with references.

Fixes #10281
2021-10-03 17:42:05 +02:00
Andreas Kling
6a1b82df2b LibJS: Put zombie cell tracking code behind a compile-time flag
Since this is a debug-only feature, let's not have it impact GC marking
performance when you don't need it.
2021-10-02 16:39:28 +02:00
Nico Weber
6c9bc18a79 Userland: Fix typos 2021-10-01 01:18:52 +01:00
davidot
830ea0414c LibJS: Make scoping follow the spec
Before this we used an ad-hoc combination of references and 'variables'
stored in a hashmap. This worked in most cases but is not spec like.
Additionally hoisting, dynamically naming functions and scope analysis
was not done properly.

This patch fixes all of that by:
  - Implement BindingInitialization for destructuring assignment.
  - Implementing a new ScopePusher which tracks the lexical and var
    scoped declarations. This hoists functions to the top level if no
    lexical declaration name overlaps. Furthermore we do checking of
    redeclarations in the ScopePusher now requiring less checks all over
    the place.
  - Add methods for parsing the directives and statement lists instead
    of having that code duplicated in multiple places. This allows
    declarations to pushed to the appropriate scope more easily.
  - Remove the non spec way of storing 'variables' in
    DeclarativeEnvironment and make Reference follow the spec instead of
    checking both the bindings and 'variables'.
  - Remove all scoping related things from the Interpreter. And instead
    use environments as specified by the spec. This also includes fixing
    that NativeFunctions did not produce a valid FunctionEnvironment
    which could cause issues with callbacks and eval. All
    FunctionObjects now have a valid NewFunctionEnvironment
    implementation.
  - Remove execute_statements from Interpreter and instead use
    ASTNode::execute everywhere this simplifies AST.cpp as you no longer
    need to worry about which method to call.
  - Make ScopeNodes setup their own environment. This uses four
    different methods specified by the spec
    {Block, Function, Eval, Global}DeclarationInstantiation with the
    annexB extensions.
  - Implement and use NamedEvaluation where specified.

Additionally there are fixes to things exposed by these changes to eval,
{for, for-in, for-of} loops and assignment.

Finally it also fixes some tests in test-js which where passing before
but not now that we have correct behavior :^).
2021-09-30 08:16:32 +01:00
Rodrigo Tobar
3efd7b458a LibELF+readelf: Remove duplicated dtag->string map
A copy of the same mapping was found both in LibELF and in the readelf
utility, which uses LibELF; keeping them both is redundant and removing
the duplicate saves (a bit of) space.
2021-09-26 12:45:55 +02:00
Linus Groh
e37cf73300 LibJS: Rename OrdinaryFunctionObject to ECMAScriptFunctionObject
The old name is the result of the perhaps somewhat confusingly named
abstract operation OrdinaryFunctionCreate(), which creates an "ordinary
object" (https://tc39.es/ecma262/#ordinary-object) in contrast to an
"exotic object" (https://tc39.es/ecma262/#exotic-object).

However, the term "Ordinary Function" is not used anywhere in the spec,
instead the created object is referred to as an "ECMAScript Function
Object" (https://tc39.es/ecma262/#sec-ecmascript-function-objects), so
let's call it that.

The "ordinary" vs. "exotic" distinction is important because there are
also "Built-in Function Objects", which can be either implemented as
ordinary ECMAScript function objects, or as exotic objects (our
NativeFunction).

More work needs to be done to move a lot of infrastructure to
ECMAScriptFunctionObject in order to make FunctionObject nothing more
than an interface for objects that implement [[Call]] and optionally
[[Construct]].
2021-09-25 17:51:30 +02:00
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