Commit Graph

2178 Commits

Author SHA1 Message Date
Itamar
c96b6987c4 LibCpp: Add the beginning of a C++ parser
This parser will be used by the C++ langauge server to provide better
auto-complete (& maybe also other things in the future).

It is designed to be error tolerant, and keeps track of the position
spans of the AST nodes, which should be useful later for incremental
parsing.
2021-01-27 21:10:57 +01:00
Jean-Baptiste Boric
ccfb3bef75 lspci: Add numerical display 2021-01-26 21:00:16 +01:00
Linus Groh
5978424cf9 crash: Add option for failing assertion 2021-01-25 23:22:21 +01:00
Linus Groh
6568cba731 crash: Add option for pledge() violation 2021-01-25 23:22:21 +01:00
asynts
8465683dcf Everywhere: Debug macros instead of constexpr.
This was done with the following script:

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/dbgln<debug_([a-z_]+)>/dbgln<\U\1_DEBUG>/' {} \;

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/if constexpr \(debug_([a-z0-9_]+)/if constexpr \(\U\1_DEBUG/' {} \;
2021-01-25 09:47:36 +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
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
fd29bed656 sleep: Support fractional sleep lengths 2021-01-23 08:53:32 +01:00
asynts
ea7b7d8ceb Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
2021-01-22 22:14:30 +01:00
asynts
fb8d3635d9 Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
2021-01-22 22:14:30 +01:00
Andreas Kling
bfce0fccde su: Drop "id" pledge after switching user 2021-01-22 19:40:30 +01:00
Andreas Kling
2ab9083420 passwd: Drop "rpath" pledge after opening files
We needed this for mkstemp() since it used lstat() internally. Now that
it only uses open(), we don't need to pledge "rpath".
2021-01-22 19:39:44 +01:00
Andreas Kling
2cd07c6212 Kernel+Userland: Remove "dns" pledge promise alias
This was just an alias for "unix" that I added early on back when there
was some belief that we might be compatible with OpenBSD. We're clearly
never going to be compatible with their pledges so just drop the alias.
2021-01-22 19:39:44 +01:00
Emanuele Torre
5df714cd22 Build: Replace explicit use of mv(1) in CMake file with file(RENAME).
Also fix code style: `else ()` -> `else()`.
2021-01-22 11:29:52 +01:00
Doctor5555
6803d5dfbe passwd: Remove duplicate 'wpath' pledge 2021-01-22 11:09:44 +01:00
Andreas Kling
439f447ba8 LibCore+su+passwd: Don't keep /etc/passwd and /etc/shadow open
Now that we've moved to atomic replacement of these files when altering
them, we don't need to keep them open for the lifetime of Core::Account
so just simplify this and close them when they are not needed.
2021-01-21 11:17:06 +01:00
Andreas Kling
77e0598c6d passwd+LibCore: Make passwd replace /etc files atomically
Before this patch, we had a nasty race condition when changing a user's
password: there was a time window between truncating /etc/shadow and
writing out its new contents, where you could simply "su" to root
without using a password.

Instead of writing directly to /etc/passwd and /etc/shadow, we now
create temporary files in /etc and fill them with the new contents.
Those files are then atomically renamed to /etc/passwd and /etc/shadow.

Sadly, fixing this race requires giving the passwd program a lot more
privileges. This is something we can and should improve upon. :^)
2021-01-21 11:08:20 +01:00
Ben Wiederhake
de98f69bfe Userland: Implement shuf for basic shuffling 2021-01-20 19:19:34 +01:00
Ben Wiederhake
9c8efcd17e Userland: Fix broken newlines in 'sort' 2021-01-20 19:19:34 +01:00
Andreas Kling
1cb44ec5ee Everywhere: Remove more <AK/SharedBuffer.h> includes 2021-01-17 00:04:42 +01:00
Andreas Kling
c71807a3fc Everywhere: Convert a handful of String::format() => formatted() 2021-01-16 14:52:04 +01:00
Nico Weber
63ac9462ad WindowServer: Add a "scale" parameter to the SetResolution message and plumb it through
Now, `chres 640 480 2` can set the UI to HighDPI 640x480 at runtime. A
real GUI for changing the display factor will come later.

(`chres 640 480 2` followed by `chres 1280 960` is very fast since
we don't have to re-allocate the framebuffer since both modes use
the exact same number of physical pixels.)
2021-01-15 22:05:08 +01:00
Nico Weber
476a3acfb2 Utilities: Add "chres", a way to change the screen resolution from the command line 2021-01-15 22:05:08 +01:00
Brendan Coles
15fde85b21 Tests: Move test-gfx-font to /usr/Tests/LibGfx/font and add new tests 2021-01-15 19:11:35 +01:00
Andreas Kling
1a08ac72ad LibC+Everywhere: Remove open_with_path_length() in favor of open()
This API was a mostly gratuitous deviation from POSIX that gave up some
portability in exchange for avoiding the occasional strlen().

I don't think that was actually achieving anything valuable, so let's
just chill out and have the same open() API as everyone else. :^)
2021-01-12 23:34:01 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Andreas Kling
ececac65c2 Userland: Move command-line utilities to Userland/Utilities/ 2021-01-12 12:04:09 +01:00