Commit Graph

4749 Commits

Author SHA1 Message Date
Andrew Kaster
7b4dc590e7 AK+Userland: Use akaster@serenityos.org for my copyright headers 2021-05-30 14:35:34 +01:00
Linus Groh
75ea1bd346 WebServer: Exit when the given port is invalid
Similar to an invalid listen address, we should not fallback to the
default port (8000) but instead exit with an error.
2021-05-30 14:11:53 +01:00
Linus Groh
7fa3033ca8 WebServer: Replace printf()/fprintf(stderr) with outln()/warnln() 2021-05-30 14:07:58 +01:00
Linus Groh
5d80aab038 which: Replace printf() with outln()/warnln() 2021-05-30 14:07:58 +01:00
Linus Groh
7b79758fc6 userdel: Replace fprintf(stderr) with warnln() 2021-05-30 14:07:58 +01:00
Linus Groh
65528d86d5 ntpquery: Replace printf()/fprintf(stderr) with out{,ln}()/warnln() 2021-05-30 14:07:58 +01:00
Edwin Hoksberg
2deffeb74d WebServer: Add optional listen address argument
With this we can make the Webserver listen on
another address than the default of "0.0.0.0".
2021-05-30 13:03:59 +01:00
Andreas Kling
4190fd2199 LibWeb: Rename Web::Frame to Web::BrowsingContext
Our "frame" concept very closely matches what the web specs call a
"browsing context", so let's rename it to that. :^)

The "main frame" becomes the "top-level browsing context",
and "sub-frames" are now "nested browsing contexts".
2021-05-30 12:39:53 +02:00
Brendan Coles
340cecaf80 pls: Unveil search paths with browse permissions 2021-05-30 10:41:25 +01:00
Ali Mohammad Pur
f387da4a90 LibTest+test-js: Add back the lost test262 parser test option
Fixes #7566.
2021-05-30 10:34:44 +01:00
Ali Mohammad Pur
724b89f90c LibJS: Make missing variable decls in for..in/of a syntax error
...instead of a hard crash :P
2021-05-30 10:34:44 +01:00
Ali Mohammad Pur
e10006b3fa LibJS: Don't try to parse binding patterns after a syntax error
Otherwise we'd be spinning there forever.
2021-05-30 10:34:44 +01:00
Idan Horowitz
6bfeb87572 LibJS: Add String.prototype.anchor & friends
Adds an implementation of the following StringPrototype methods:
anchor, big, blink, bold, fixed, fontcolor, fontsize, italics, link,
small, strike, sub, sup.
2021-05-30 10:32:05 +01:00
Andreas Kling
460c0f9847 LibGUI: Don't scroll TreeView horizontally to bring index into view
This behavior was really irritating and basically never what you wanted
so let's stop doing it.
2021-05-30 09:28:19 +02:00
Andreas Kling
42b27d9f87 LibGUI: Avoid a bunch of virtual calls during TreeView painting
The index of the tree column will not change while painting.
Neither will the number of columsn. So avoid a whole bunch of virtual
function calls by caching these two values at the start of painting.
2021-05-30 09:05:37 +02:00
David Carlier
594dfaadb9 LibC: openpty error handling update 2021-05-30 08:41:17 +02:00
Stephan Unverwerth
755393e684 LibGL: Implement glBindTexture()
Textures are now initialized with a nullptr upon generation.
They are only actually created once they are bound to a target.
Currently only the GL_TEXTURE_2D target is supported.
The software rasterizer now allows rendering with or without
a bound TEXTURE_2D.
2021-05-30 00:32:37 +01:00
Stephan Unverwerth
fde0045ebe LibGL: Introduce Texture base class for all texture types 2021-05-30 00:32:37 +01:00
Idan Horowitz
09233b9e41 LibJS: Add Date.prototype.{get, set}Year() 2021-05-29 23:42:08 +01:00
Idan Horowitz
96ee5e36ed LibJS: Replace the broken and unused Date::year getter 2021-05-29 23:42:08 +01:00
Ben Wiederhake
a7c265f341 Everywhere: Sort out superfluous QuickSort.h imports
They were sorta unneeded. :^)
2021-05-29 23:41:54 +01:00
Ali Mohammad Pur
e0b17988bd LibWasm: Make f32-add/sub actually perform addition/subtraction
Instead of applying a unary operator to the ToS.
This alone fixes 4% of the spec test issues.
2021-05-30 01:34:28 +04:30
Ali Mohammad Pur
08b567e137 LibWasm: Avoid OOB accesses caused by user input
Just trap instead of crashing.
2021-05-30 01:34:28 +04:30
Ali Mohammad Pur
8ce015742d LibWasm: Fix logic error in Limits::parse()
The check was negated, and it errored out when the read actually
succeeded.
2021-05-29 23:03:18 +04:30
Ali Mohammad Pur
827d94939b LibJS: Add tests for destructuring assignments and function parameters 2021-05-29 23:02:23 +04:30
Ali Mohammad Pur
7a00d6d9c8 LibJS: Implement destructuring assignments and function parameters 2021-05-29 23:02:23 +04:30
Jesse Buhagiar
d44e2c9ad9 Userland: Check sudoers file perms and owner in pls
As per comment found in #6319 by @bcoles, `pls` should check the
permissions and owner of the sudoers file to ensure that it hasn't
been compromised.
2021-05-29 22:33:12 +04:30
Jesse Buhagiar
82b48d867d Userland: Implement pls, a sudo clone 2021-05-29 22:33:12 +04:30
Gunnar Beutner
ea33e9647b LibC: Don't leak memory for realloc(p, 0)
Previously we'd leak memory when the user called realloc(p, 0). Instead
this call should behave as if the user had called free(p).
2021-05-29 19:40:23 +02:00
Jelle Raaijmakers
80a84f726e LibGUI/TreeView: Implement Home/End/PageUp/PageDn navigation
This adds an implementation for the Home, End, Page Up and Page Down
cursor movements for TreeView.

Also, the Up and Down movement implementations are replaced by a more
efficient traversal mechanism: whereas the old code would walk over all
visible nodes every time, the new code only evaluates relevant sibling
and parent indices.
2021-05-29 21:58:51 +04:30
brapru
3cf835af6d LibCore: Do not write disabled spwd values in generate_shadow_file
When LibC/shadow.cpp parses shadow entries in getspent, it sets the
spwd member value to disabled (-1) if the value is empty. When
Core::Account::sync calls getspent to generate a new shadow file, it
would recieve the -1 values and write them in the shadow file. This
would cause the /etc/shadow file to be cluttered with disabled values
after any password change.

This patch checks if the spwd member value is disabled, and prints the
appropriate value to the shadow file.
2021-05-29 18:23:10 +01:00
Stephan Unverwerth
92339b7fe5 LibGL: Rewrite error handling according to spec
Following https://www.khronos.org/registry/OpenGL/specs/gl/glspec15.pdf
errors are now only recorded if m_error is GL_NO_ERROR
m_error is reset to GL_NO_ERROR after a successful call to glGetError()
2021-05-29 18:17:24 +01:00
Stephan Unverwerth
9334697c59 LibGL: Update rasterizer options in glDisable()
This bug must have been introduced by copy-pasting.
2021-05-29 18:17:24 +01:00
Stephan Unverwerth
9b4edacd8e LibGL: Add macro for error checking
This adds a macro `RETURN_WITH_ERROR_IF` to SoftwareGLContext
to remove a lot of noise from the interface implementation.
2021-05-29 18:17:24 +01:00
Idan Horowitz
e6b88de6a0 LibGfx: Switch to modern dbgln logging in ICOLoader 2021-05-29 21:46:16 +04:30
Idan Horowitz
7572a355fd LibGfx: Reject ICOs with height == NumericLimits<i32>::min()
Bitmap files use negative height values to signify that the image
should be rendered top down, but if the height value equals to the
minimum value, negating it to get the actual height results in UB.
2021-05-29 21:46:16 +04:30
Andrew Kaster
6aba64b60f LibJS: Instrument HeapBlock cell allocation for ASAN
Mark the entirety of a heap block's storage poisoned at construction.
Unpoison all of a Cell's memory before allocating it, and re-poison as
much as possible on deallocation. Unfortunately, the entirety of the
FreelistEntry must be kept unpoisoned in order for reallocation to work
correctly.

Decreasing the size of FreelistEntry or adding a larger redzone to Cells
would make the instrumentation even better.
2021-05-29 17:47:29 +01:00
Andrew Kaster
81a5dcde84 LibJS: Expose minimum possible cell size of JS::Heap
Use this to avoid creating a 16 byte cell allocator on x86_64, where the
size of FreelistEntry is 24 bytes. Every JS::Cell must be at least the
size of the FreelistEntry or things start crashing, so the 16 byte
allocator was wasted on that platform.
2021-05-29 17:47:29 +01:00
Andrew Kaster
07c62f9f42 LibJS: Remove unused HeapBlock private member function
FreelistEntries are constructed manually in deallocate() instead of
using this helper.
2021-05-29 17:47:29 +01:00
Gunnar Beutner
42d667645d Kernel: Make sure we free the thread stack on thread exit
This adds two new arguments to the thread_exit system call which let
a thread unmap an arbitrary VM range on thread exit. LibPthread
uses this functionality to unmap the thread stack.

Fixes #7267.
2021-05-29 15:53:08 +02:00
Gunnar Beutner
f63f471b87 LibPthread: Make some variables static 2021-05-29 15:53:08 +02:00
Daniel Bertalan
4cf6963a1c LibVT: Add missing cursor movement escape sequences
This commit adds support for the following ANSI escape sequences:
- `CNL` - Cursor Next Line
- `CPL` - Cursor Previous Line
- `VPR` - Line Position Relative
- `HPA` - Character Position Absolute
- `HPR` - Character Position Relative
2021-05-29 15:50:24 +02:00
Mart G
07e3934f01 LibGUI: Distribute remaining pixels in BoxLayout to fill the entire area
Previously, the layout algorithm preferred to give every item an equally
sized slice of the remaining space. This meant that not the entire area
was used when the remaining size did not divide evenly by the number of
items. This caused, for example, the ResizeCorner in HexEditor to be a
couple of pixels left of the actual corner for some sizes of the window.

Now, the remaining pixels are distributed on a first come, first served
basis. However, only one pixel is distributed at a time. This means
items towards the left might me a pixel larger than their siblings
towards the right.
2021-05-29 15:50:04 +02:00
Jesse Buhagiar
e2989424c7 DisplaySettings: Set monitor widget color if no image is selected
The monitor widget now displays the selected colour if no background
image has been selected.

Resolves #7491
2021-05-29 13:30:19 +01:00
Brendan Coles
90e9d1a0a1 HexEditor: Add find_all_strings() function 2021-05-29 16:26:12 +04:30
Stephan Unverwerth
10ceeb092f Everywhere: Use s.unverwerth@serenityos.org :^) 2021-05-29 12:30:08 +01:00
Marcus Nilsson
0aa0e00dd5 Browser: Add title to go back/forward context menu
Adds page title to the context menu for go back/forward.
2021-05-29 12:03:41 +01:00
Ali Mohammad Pur
3f5eb6446b LibGUI: Make HeaderView act only on the visible sections
i.e. Drawing them, or handling mouse events on them.
Fixes #7505.
2021-05-29 13:31:41 +04:30
DexesTTP
4bbf954ad0 LibTLS: Allow using other hash algorithms for HMAC
The standard allows for ciphers to define which hash to use.
Fixes #7348
2021-05-29 13:29:46 +04:30
DexesTTP
cb4a0dec8a LibTLS: Use a more precise KeyExchangeAlgorithm enum
The old enumeration didn't allow discriminating the key exchange
algorithms used, but only allowed the handshake with the server. With
this new enumeration, we can know which key exchange algorithm we are
actually supposed to use :^)
2021-05-29 13:29:46 +04:30