Commit Graph

16192 Commits

Author SHA1 Message Date
asynts
acdcf59a33 Everywhere: Remove unnecessary debug comments.
It would be tempting to uncomment these statements, but that won't work
with the new changes.

This was done with the following commands:

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/#define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/#define/ { toggle = 1 }' {} \;

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/ #define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/ #define/ { toggle = 1 }' {} \;
2021-01-25 09:47:36 +01:00
asynts
1a3a0836c0 Everywhere: Use CMake to generate AK/Debug.h.
This was done with the help of several scripts, I dump them here to
easily find them later:

    awk '/#ifdef/ { print "#cmakedefine01 "$2 }' AK/Debug.h.in

    for debug_macro in $(awk '/#ifdef/ { print $2 }' AK/Debug.h.in)
    do
        find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/#ifdef '$debug_macro'/#if '$debug_macro'/' {} \;
    done

    # Remember to remove WRAPPER_GERNERATOR_DEBUG from the list.
    awk '/#cmake/ { print "set("$2" ON)" }' AK/Debug.h.in
2021-01-25 09:47:36 +01:00
Nico Weber
76f2918416 LibGfx:: Implement scale support for blit_with_opacity()
Now we no longer crash on mousewheel over Terminal while holding the
super key. The terminal window doesn't yet correctly become transparent
in hidpi mode (needs more investigation), but it works in LibGfxScaleDemo,
so maybe that's a problem elsewhere.

Also add a FIXME for a pre-existing bug.
2021-01-25 09:41:34 +01:00
Andrew Kaster
258a3b27ac Userland: Implement grep -v (invert-match)
This will make grep output every line that doesn't have
any matches of the given regular expression
2021-01-25 09:41:19 +01:00
Andrew Kaster
036828ff43 Userland: Use getline instead of Core::File::standard_input in grep
Core::IODevice (which Core::File inherits from) does not have a
reasonable way to block for a line. grep was spinning on
IODevice::read_line, passing endless empty strings to the matcher
lambda. Use getline instead, which will at least block in the Kernel for
characters to be available on stdin and only return full lines (or eof)
2021-01-25 09:41:19 +01:00
Andreas Kling
f5d916a881 Kernel: Make sys$anon_create() fail if size == 0
An empty anonymous file is useless since it cannot be resized anyway,
so let's not support creating it.
2021-01-25 09:36:42 +01:00
Linus Groh
02cca92763 LibJS: Set length of TypedArray constructors to 3
https://tc39.es/ecma262/#sec-typedarray-constructors

    Each TypedArray constructor [...] has a "length" property whose
    value is 3.
2021-01-24 22:24:10 +01:00
Jean-Baptiste Boric
76e12a4840 SystemServer: Do not crash if device files are not present 2021-01-24 22:16:18 +01:00
Jean-Baptiste Boric
491a67ddc4 WindowServer: Don't crash if unable to open input peripherals
Seems a bit extreme, other operating systems don't have their graphical
environment crash if there is no keyboard or no mouse.
2021-01-24 22:16:18 +01:00
Jean-Baptiste Boric
4d755725bf Kernel: Allow disabling of IDE controllers with disable_ide
The kernel doesn't like the IDE controllers on an Asus A7N8X-E Deluxe
motherboard, so add an option to disable them.
2021-01-24 22:16:18 +01:00
Jean-Baptiste Boric
7eaefa5aa6 Kernel: Make use of interrupts as an entropy source
Booting old computers without RDRAND/RDSEED and without a disk makes
the system severely starved for entropy. Uses interrupts as a source
to side-step that issue.

Also warn whenever the system is starved of entropy, because that's
a non-obvious failure mode.
2021-01-24 22:16:18 +01:00
Nico Weber
cb89d3b780 FontEditor: change order of baseline and mean line row
The mean line is above the baseline, so it makes sense if the UI
elements are in the same order.
2021-01-24 22:02:23 +01:00
Nico Weber
40f6dfeacc FontEditor: change "Mean Line:" label to "Mean line:"
Matches the case used in other labels in the app.
2021-01-24 22:02:23 +01:00
Nico Weber
42a8f99374 FontEditor: Fix typos in code
No behavior change.
2021-01-24 22:02:23 +01:00
Nico Weber
90e09dd7a8 FontEditor: Make left and right UI margins match 2021-01-24 22:02:23 +01:00
Nico Weber
8bb9c667fd FontEditor: Remove "Save" and "Quit" buttons
We have both the normal menu items and keyboard shortcuts for these by
now. No need to have always-visible buttons -- makes the app more
consistent with the other apps, and makes it use up less vertical space.
2021-01-24 22:02:23 +01:00
Zac
330ab52ddb
Vim: More correct word jumping (#5090)
Implemented move_to_beginning_of_next(), move_to_end_of_next(),
move_to_beginning_of_previous() and move_to_end_of_previous() functions
for more correct word jumping than the move_to_xxx_span() methods that
were previously used.
2021-01-24 19:24:56 +01:00
Camisul
0678dab7dc HexEditor: Find
Added search submenu with options to find or find again.
Find allows to search for ASII string or sequence of Hex value.
2021-01-24 19:23:31 +01:00
DragonAlex98
509e39ac00 FileManager: Make DirectoryView open links in their real directory
Previously it was possible to open a link like /home/anon/Desktop/Home,
leading to a folder with the same name. Now it correctly opens its real
path, which is /home/anon

FileManager: Use Core::File::real_path_for to get real path of links
2021-01-24 19:21:54 +01:00
Andreas Kling
f8d643284e pmap: Sort memory regions in output
This makes the program 100% nicer to use. :^)
2021-01-24 19:15:34 +01:00
Andreas Kling
7a71d4b887 LibJS: Add some assertions and tests for TypedArray limitations 2021-01-24 19:08:44 +01:00
Andreas Kling
0e3ee03e2b LibJS: Throw exception on too large TypedArray construction request
We will now throw a RangeError in these cases:

* new TypedArray with >= INT32_MAX entries
* new TypedArray whose ArrayBuffer allocation size computation would
  cause a 32-bit unsigned overflow.
2021-01-24 18:55:06 +01:00
Andreas Kling
ae0be7797f LibWeb: Disable resource cache for file:// URLs
This makes the browser a bit less annoying when testing local files,
since you no longer have to restart it for changes to take effect.

Longer-term we should have a proper way to decide which resources
are cacheable.
2021-01-24 12:11:08 +01:00
Luke
712f76c010 LibHTTP: Always read in the last chunk
This was accidentally put behind a debug flag.

Fixes #5080
2021-01-24 09:25:47 +01:00
Andreas Kling
2112b79986 Revert "Kernel: Make VFS::create() fail with EINVAL on invalid file mode"
This reverts commit ca3489eec7.

Fixes #5087.
2021-01-24 08:32:09 +01:00
Luke
50a2cb38e5 Kernel: Fix two error codes being returned as positive in Process::exec
This made the assertion on line 921 think it was a successful exec, when it wasn't.

Fixes #5084
2021-01-24 01:06:24 +01:00
Luke
1c18d1380f Lagom/Fuzzers: Fix FuzzilliJs build and update patch for new Fuzzilli version
-fsanitize=fuzzer was being added to LINKER_FLAGS from Lagom/CMakeLists,
which we don't want with FuzzilliJs as we want to define the functions
it provides ourselves.
2021-01-24 00:40:49 +01:00
Linus Groh
f37d3f25e6 LibJS: Remove redundant exception check from ClassExpression::execute()
as_object() cannot fail, leftover from ea55453.
2021-01-24 00:40:22 +01:00
Linus Groh
766f30f593 LibJS: Check if class extends value has a valid prototype
If we have a function as class extends value, we still cannot assume
that it has a prototype property and that property has a function or
null as its value - blindly calling to_object() on it may fail.

Fixes #5075.
2021-01-24 00:09:18 +01:00
Luke
397f432aed LibWeb: Add XHREventTarget and ProgressEvent constructors to Window 2021-01-23 22:29:21 +01:00
Luke
0a1226344a LibWeb: Add XHREventTarget and have XHR inherit from it 2021-01-23 22:29:21 +01:00
Luke
4f2e154dbe LibWeb: Flesh out existing XHR methods a bit more
This makes open, send and setRequestHeader a bit more spec compliant and
adds a bunch of FIXMEs for unimplemented parts.
2021-01-23 22:29:21 +01:00
Andreas Kling
c68148efc5 LibWeb: Remove Range constructor/prototype caches from WindowObject
These are constructed on the code generator path now instead.
2021-01-23 19:02:02 +01:00
Andreas Kling
cfa2fb2eb3 LibWeb: Generate JS bindings for Range from IDL :^) 2021-01-23 17:59:42 +01:00
Andreas Kling
8a9853d5da Kernel: Create core dumps with S_IFREG set (regular file)
Otherwise, the VFS will refuse to create the file.
2021-01-23 17:59:42 +01:00
Andreas Kling
cf836e6bff LibWeb: Make WrapperGenerator consider "unsigned" part of a type 2021-01-23 17:59:42 +01:00
Jean-Baptiste Boric
adb2fae69c Kernel: Evaluate block conditions inside VirtualConsole::emit()
This makes text mode boot usable again, because the shell never
received keyboard input otherwise.
2021-01-23 16:53:03 +01:00
Jean-Baptiste Boric
8941d831bb Kernel: Allow "serial_debug" everywhere on the command line 2021-01-23 16:53:03 +01:00
Ben Wiederhake
d56240759f Tests+UserlandEmulator: Demonstrate missing backtraces 2021-01-23 16:47:09 +01:00
Ben Wiederhake
9058a8367f UserspaceEmulator: Improve error message for typos 2021-01-23 16:47:09 +01:00
Ben Wiederhake
792fa9f9fd UserspaceEmulator: Implement chown
Now we can run 'ue chown anon ReadMe.md' :^)
2021-01-23 16:47:09 +01:00
Ben Wiederhake
b0b8953ec1 Base: Fix syscall/libc manpage sorting 2021-01-23 16:47:09 +01:00
Ben Wiederhake
88dcbacabd Meta: Check consistency of various syscall tables 2021-01-23 16:47:09 +01:00
asynts
a7d5fbb8af AK+Format: Add dmesgln() to replace klog(). 2021-01-23 16:46:26 +01:00
asynts
1c1e577a5e Everywhere: Deprecate dbg(). 2021-01-23 16:46:26 +01:00
Andreas Kling
d7345cf560 Kernel: Use current EUID/EGID for LocalSocket prebind credentials 2021-01-23 16:45:05 +01:00
Andreas Kling
ca3489eec7 Kernel: Make VFS::create() fail with EINVAL on invalid file mode
Instead of trying to fix up the mode to look like a regular file,
just fail instead.
2021-01-23 16:45:05 +01:00
Andreas Kling
bfb254ed14 Ext2FS: Assert that create_directory() is called with valid mode 2021-01-23 16:45:05 +01:00
Andreas Kling
a85c61ad51 SystemServer: Mask off the set-uid bit in SocketPermissions 2021-01-23 16:45:05 +01:00
Andreas Kling
c32176db27 Kernel: Don't preserve set-uid bit in open() and bind() modes
For some reason we were keeping the bits 04777 in file modes. That
doesn't seem right and I can't think of a reason why the set-uid bit
should be allowed to slip through.
2021-01-23 16:45:05 +01:00