summaryrefslogtreecommitdiff
path: root/Userland/Utilities
AgeCommit message (Collapse)Author
2022-09-05Userland: Move files destined for LibLocale to the Locale namespaceTimothy Flynn
2022-09-05LibUnicode+Userland: Migrate generated CLDR data to LibLocaleDataTimothy Flynn
Currently, LibUnicodeData contains the generated UCD and CLDR data. Move the UCD data to the main LibUnicode library, and rename LibUnicodeData to LibLocaleData. This is another prepatory change to migrate to LibLocale.
2022-09-04Utilities/lsusb: Fix uninitialized variable errorJesse Buhagiar
The variable `print_verbose` (which prints verbose information about the USB devices connected to the system) was uninitialized in `lsusb`. This was causing the verbose information to be printed if `-v` was NOT seen on the command line.
2022-08-28LibJS: Turn initialize_global_object() into a regular initialize()Linus Groh
There's nothing special about global object initialization anymore, this can just work the same way as for any other object now.
2022-08-28LibJS: Move Console ownership from GlobalObject to ConsoleObjectLinus Groh
GlobalObject is now a regular object with no special properties :^)
2022-08-27LibJS: Move intrinsics to the realmLinus Groh
Intrinsics, i.e. mostly constructor and prototype objects, but also things like empty and new object shape now live on a new heap-allocated JS::Intrinsics object, thus completing the long journey of taking all the magic away from the global object. This represents the Realm's [[Intrinsics]] slot in the spec and matches its existing [[GlobalObject]] / [[GlobalEnv]] slots in terms of architecture. In the majority of cases it should now be possibly to fully allocate a regular object without the global object existing, and in fact that's what we do now - the realm is allocated before the global object, and the intrinsics between both :^)
2022-08-23Userland: Consolidate most PATH resolving into a single implementationTim Schumacher
We previously had at least three different implementations for resolving executables in the PATH, all of which had slightly different characteristics. Merge those into a single implementation to keep the behaviour consistent, and maybe to make that implementation more configurable in the future.
2022-08-23LibJS: Remove {Bytecode::,}Interpreter::global_object()Linus Groh
The basic idea is that a global object cannot just come out of nowhere, it must be associated to a realm - so get it from there, if needed. This is to enforce the changes from all the previous commits by not handing out global objects unless you actually have an initialized realm (either stored somewhere, or the VM's current realm).
2022-08-23LibJS+LibWeb: Reduce use of GlobalObject as an intermediaryLinus Groh
- Prefer VM::current_realm() over GlobalObject::associated_realm() - Prefer VM::heap() over GlobalObject::heap() - Prefer Cell::vm() over Cell::global_object() - Prefer Wrapper::vm() over Wrapper::global_object() - Inline Realm::global_object() calls used to access intrinsics as they will later perform a direct lookup without going through the global object
2022-08-23LibJS: Pass Realm to define_native_{accessor,function}()Linus Groh
This is needed so that the allocated NativeFunction receives the correct realm, usually forwarded from the Object's initialize() function, rather than using the current realm.
2022-08-23LibJS: Pass Realm to GlobalObject::initialize_global_object()Linus Groh
Global object initialization is tightly coupled to realm creation, so simply pass it to the function instead of relying on the non-standard 'associated realm' concept, which I'd like to remove later. This works essentially the same way as regular Object::initialize() now. Additionally this allows us to forward the realm to GlobalObject's add_constructor() / initialize_constructor() helpers, so they set the correct realm on the allocated constructor function object.
2022-08-23LibJS: Remove GlobalObject parameter from native functionsLinus Groh
2022-08-23LibJS: Replace GlobalObject with VM in common AOs [Part 18/19]Linus Groh
2022-08-23LibJS: Replace GlobalObject with VM in Reference AOs [Part 6/19]Linus Groh
2022-08-23LibJS: Replace GlobalObject with VM in Value AOs [Part 4/19]Linus Groh
This is where the fun begins. :^)
2022-08-23LibJS: Replace GlobalObject with VM in Intl AOs [Part 1/19]Linus Groh
Instead of passing a GlobalObject everywhere, we will simply pass a VM, from which we can get everything we need: common names, the current realm, symbols, arguments, the heap, and a few other things. In some places we already don't actually need a global object and just do it for consistency - no more `auto& vm = global_object.vm();`! This will eventually automatically fix the "wrong realm" issue we have in some places where we (incorrectly) use the global object from the allocating object, e.g. in call() / construct() implementations. When only ever a VM is passed around, this issue can't happen :^) I've decided to split this change into a series of patches that should keep each commit down do a somewhat manageable size.
2022-08-23LibJS: Remove GlobalObject from VM::throw_completion()Linus Groh
This is a continuation of the previous five commits. A first big step into the direction of no longer having to pass a realm (or currently, a global object) trough layers upon layers of AOs! Unlike the create() APIs we can safely assume that this is only ever called when a running execution context and therefore current realm exists. If not, you can always manually allocate the Error and put it in a Completion :^) In the spec, throw exceptions implicitly use the current realm's intrinsics as well: https://tc39.es/ecma262/#sec-throw-an-exception
2022-08-23LibJS+LibWeb: Replace GlobalObject with Realm in create() functionsLinus Groh
This is a continuation of the previous two commits. As allocating a JS cell already primarily involves a realm instead of a global object, and we'll need to pass one to the allocate() function itself eventually (it's bridged via the global object right now), the create() functions need to receive a realm as well. The plan is for this to be the highest-level function that actually receives a realm and passes it around, AOs on an even higher level will use the "current realm" concept via VM::current_realm() as that's what the spec assumes; passing around realms (or global objects, for that matter) on higher AO levels is pointless and unlike for allocating individual objects, which may happen outside of regular JS execution, we don't need control over the specific realm that is being used there.
2022-08-20strace: Pledge `rpath` for searching binariesTim Schumacher
After commit 91a03bc6ae134f76560c8bba49b6704b1bbbeaae we no longer try to discover files for exec-ing by simply trying to exec on them, but we check for the files existence by using `Core::file::exists()` first. Contrary to the old solution, this now requires the `rpath` pledge, so pledge it to keep `strace` from crashing when using non-absolute paths.
2022-08-16Utilities/file: Handle all supported audio MIME typeskleines Filmröllchen
2022-08-14Base: Launch AudioServer at session start-upLucas CHOLLET
2022-08-14Utilities/lsblk: Remove Interface Type columnLiav A
We are going to remove this slice of data from the SysFS later on, so lsblk must not try to read it.
2022-08-05LibJS: Let Shape store a Realm instead of a GlobalObjectAndreas Kling
This is a cautious first step towards being able to create JS objects before a global object has been instantiated.
2022-08-05LibWeb: Remove page_did_set_document_in_top_level_browsing_context()Andreas Kling
This PageClient callback was never used for anything.
2022-08-02wallpaper: Add pledge promisesnetworkException
2022-08-02Utilities+Base: Rename `pape` utility to `wallpaper`networkException
2022-08-01Userland+Base: Make the window titlebar font configurable separatelyAndreas Kling
Instead of defaulting to "bold variant of the system default font", let's allow the user to set any font they want as the titlebar font.
2022-07-28Utilities/lsusb: Allow the utility to work without existing USB IDs fileLiav A
In case we failed to open /res/usb.ids or the user requested to not use that file, we simply don't try to resolve the USB IDs and print them without any identification.
2022-07-27grep: Fix out of bounds StringView indexingMacDue
This is another case of out of bounds indexing exposed by 13406b8.
2022-07-27Everywhere: Make the codebase more architecture awareUndefine
2022-07-27less: Fix out of bounds StringView indexingMacDue
This fixes indexing the StringView before knowing if the index is valid. This did not crash until the changes from 13406b8 which added runtime checks for StringView indexing.
2022-07-25chown: Implement recursionTim Schumacher
2022-07-25chown: Add support for multiple file pathsTim Schumacher
2022-07-25ln: Implement correct handling of directories as link targetsTim Schumacher
2022-07-25ln: Rework to use LibCore syscall wrappersTim Schumacher
2022-07-25chmod: Implement the `--recursive` flagTim Schumacher
2022-07-25chmod: Port to ArgsParserTim Schumacher
2022-07-24du: Consolidate all "do not print" conditionsTim Schumacher
All of these conditions should make du just not report the file size individually, but it should still count them into the grand total. In the case of the `--threshold` option, this was actually implemented incorrectly before, as it would report size 0 for files that did not match the threshold.
2022-07-24du: Only use unmodified file sizes internallyTim Schumacher
This keeps us from repeatedly applying the block size calculation on already processed values.
2022-07-24du: Use 64-bit integers when handling file sizes or related valuesTim Schumacher
We may very well dip into files larger than 4G at some point, so 32-bit values are not enough, and the 64-bit sized `off_t` doesn't fully make sense either, as it features negative values. Instead, switch to the explicit type of `u64` everywhere, which is the same size on all platforms and is unsigned. The exception to this is the threshold, which needs to be signed instead of unsigned.
2022-07-24du: Fix a typo in the `--exclude-from` optionTim Schumacher
2022-07-24du: Don't stop descending even if the maximum depth is reachedTim Schumacher
The `--max-depth` option only controls until which depth individual file sizes are printed, it does not stop the utility from traversing that branch further (as the file sizes would be wrong otherwise). Restructure the program to track the current depth, and return early if the current depth is higher than the maximum allowed depth, which skips all parts of the logic that are concerned with user output.
2022-07-21Utilities+LibELF: Temporary promises for dynamic linker in "pledge"Itamar
This adds a "temporary promises for the dynamic-linker" flag ('-d') to the "pledge" utility. Example usage: pledge -d -p "stdio rpath" id Without the '-d' flag, id would crash because the dynamic linker requires 'prot_exec'. When this flag is used and the program to be run is dynamically linked, "pledge" adds promises that are required by the dynamic linker to the promise set provided by the user. The dynamic linker will later "give up" the pledge promises it no longer requires.
2022-07-21du: Implement the 1k block size short optionTim Schumacher
2022-07-21du: Invert apparent-size behaviourTim Schumacher
The apparent size is what `stat` says what we use. The non-apparent size is the blocks that we actually use on-disk.
2022-07-21du: Implement custom block sizesTim Schumacher
2022-07-21du: Replace home-grown block-based size calculation with `ceil_div`Tim Schumacher
2022-07-20js: Don't pass error strings as the format argument to outln()Ali Mohammad Pur
This fixes a crash when the error contains '{}', or an invalid format string.
2022-07-19LibAudio: Rename ConnectionFromClient to ConnectionToServerkleines Filmröllchen
The automatic nomenclature change for IPC sockets got this one wrong.
2022-07-19Utilities: Remove the edid-dump utilityLiav A
This short-lived utility was essential when we had to use the ioctl interface to fetch the EDID from a DisplayConnector, but now that we can simply read it from SysFS, this utility is no longer needed and can be removed.