Commit Graph

11684 Commits

Author SHA1 Message Date
Peter Elliott
99ddbb83e8 Userland: Make su require passwords 2020-07-28 17:07:22 +02:00
Peter Elliott
207fb054e5 Userland: Add passwd utility 2020-07-28 17:07:22 +02:00
Peter Elliott
1211a036ba LibCore: add get_password().
A serenity-style getpass that is thread-safe
2020-07-28 17:07:22 +02:00
Peter Elliott
3c1c5cc541 LibC: Add passwords to putpwent 2020-07-28 17:07:22 +02:00
Peter Elliott
e57a432118 AK: Make String::substring() return non-null for 0-length strings
This also makes String::split() give non-null strings when keep_empty is
true.
2020-07-28 17:07:22 +02:00
Peter Elliott
9dcbb263f1 LibCrypt: Add LibCrypt, crypt, and crypt_r 2020-07-28 17:07:22 +02:00
Ben Wiederhake
58dd9f2d2a SystemMenu: Add 'Themes' icon 2020-07-28 16:29:44 +02:00
Ben Wiederhake
a9d30a59d9 SystemMenu: Add icons for categories 2020-07-28 16:29:44 +02:00
Ben Wiederhake
404981a892 SystemMenu: Untangle app/category discovery and GUI building
I was a bit confused by the fact that a method named `build_system_menu()`
first enumerates a directory. Moving the app/category discovery to a dedicated
function that returns the GUI-relevant information makes this process a bit
less surprising.

As an added bonus, `g_app_category_menus` was actually only a temporary mapping,
and didn't need to be global. In theory, SystemMenu should use a handful fewer
of bytes now.
2020-07-28 16:29:44 +02:00
Ben Wiederhake
e8ed7f829e SystemMenu: Add icon to 'Exit' menu item 2020-07-28 16:29:44 +02:00
Ben Wiederhake
70fe126d01 LibGUI: Enable icons for SubMenus
It doesn't make sense for a top-level menu to have an icon, however
we do not have dedicated classes to distinguish these.

Furthermore, the only other place to store an icon is MenuItem.
Storing it there would be highly confusing, as MenuItem-with-Action
then would have two icons: one in Action and one in MenuItem.
And because we need to be able to replace the icon during realization,
this would need to write-through to Action somehow.

That's why I went with Menu, not MenuItem.
2020-07-28 16:29:44 +02:00
Ben Wiederhake
048f149f51 LibGUI: Refactor icon realization in Menu
This factors out icon realization into its own function, making it possible to
use the same code with other classes that have icon() and set_icon() methods.
2020-07-28 16:29:44 +02:00
Ben Wiederhake
082b7d6b0c LibGUI: Set correct default value during menu destruction 2020-07-28 16:29:44 +02:00
thankyouverycool
8248c74d88 DevTools: Let Inspector use ProcessChooser and new icons.
Inspector now opens ProcessChooser when no PID is supplied.
2020-07-28 16:29:36 +02:00
thankyouverycool
6448f94372 DevTools+LibGUI: Make ProcessChooser a general Dialog in LibGUI
Moves ProcessChooser and RunningProcessesModel to LibGUI and
generalizes their construction for use by other apps. Updates
Profiler to reflect the change and use its new icons.
2020-07-28 16:29:36 +02:00
thankyouverycool
5cfbf88b4d Base: Add icons and af files for Profiler and Inspector 2020-07-28 16:29:36 +02:00
Linus Groh
090c031c1a Userland: Fix nc by not memset()'ing the input address char*
We were accidentally calling memset() on "addr" (the input char*), not
"dst_addr" (the target struct sockaddr_in), which was causing a simple
"nc localhost 8000" to crash.

Fixes #2908.
2020-07-28 13:19:22 +02:00
Andreas Kling
08c05fbbd1 LibC: Fix strtol() not setting endptr correctly for "0"
"0" was interpreted as a base-8 prefix, and the parse pointer was then
unconditionally advanced, causing us to consume zero characters.

This unbreaks the git port. :^)

(We should really have tests for LibC..)
2020-07-28 02:26:49 +02:00
Andreas Kling
b8d3dbcf2d UserspaceEmulator: Add syscalls: stat(), realpath(), gethostname()
This is enough to run /bin/ls :^)
2020-07-28 00:03:25 +02:00
Andreas Kling
9def88e08d UserspaceEmulator: Don't just return "EMULATED" in get_process_name()
Now that emulated processes have their real name (with a "(UE)" prefix)
we can actually let them know their name.
2020-07-28 00:03:25 +02:00
Andreas Kling
308d3b764f LibC: Move getpagesize() out-of-line
This being inline somehow broke the binutils autoconf scripts. It used
to work, so I suspect that some other change to LibC has caused those
autoconf scripts to go down a new path.

Regardless, this seems perfectly sensible.
2020-07-28 00:03:25 +02:00
Andreas Kling
2ac5c2278d UserspaceEmulator: Support ioctl(TIOCGWINSZ)
This is very commonly used by terminal programs, and easy to support.
2020-07-28 00:03:25 +02:00
Andreas Kling
33d2ecdd79 WebServer: Show icons in directory listings :^)
Just adding some basic folder/file icon makes a big difference here.
2020-07-27 22:39:01 +02:00
Andreas Kling
96dce6893f Lagom: Build with -std=c++2a -Wno-deprecated-copy 2020-07-27 21:54:22 +02:00
Nico Weber
815a660aed .gitignore: Add .swo
Makes `git status` less noisy for vim users.
2020-07-27 21:53:46 +02:00
asynts
ed327e7feb LibCrypto: Change the signatures of RSA::import_[XXX]_key to use Span. 2020-07-27 19:58:09 +02:00
asynts
3de4e08b46 LibCrypto: Change the signature of decode_pem to use Span. 2020-07-27 19:58:09 +02:00
asynts
0d782e1dfb LibCrypto: Change the signature of RSA::parse_rsa_key to use Span. 2020-07-27 19:58:09 +02:00
asynts
21de20825a LibCore: Change the signature of Socket::send() to use Span. 2020-07-27 19:58:09 +02:00
asynts
4709b700bd LibCrypto: Change [XXX]BigInteger::export_data() to use Span. 2020-07-27 19:58:09 +02:00
asynts
abe925e4b0 AK: Change the signature of AK::encode_base64() to use Span. 2020-07-27 19:58:09 +02:00
asynts
5fa0fdb219 AK: Rename Span::subspan() to Span::slice(). 2020-07-27 19:58:09 +02:00
asynts
8d2dba022e AK: Add offset() method to Span. 2020-07-27 19:58:09 +02:00
asynts
a922abd9d7 AK: Add span() / bytes() methods to container types. 2020-07-27 19:58:09 +02:00
asynts
c42450786c AK: Add implicit conversion from nullptr to Span. 2020-07-27 19:58:09 +02:00
asynts
2b57891e07 AK: Add constructors to Bytes and ReadonlyBytes that take void pointers. 2020-07-27 19:58:09 +02:00
asynts
7036a9b6f7 AK: Define conversion from Span<T> to Span<const T> correctly.
I accidently wrote `Span<RemoveConst<T>>` when I meant
`Span<RemoveConst<T>::Type>`.

Changing that wouldn't be enough though, this constructor can only be
defined if T is not const, otherwise it would redefine the copy
constructor.  This can be avoided by overloading the cast operator.
2020-07-27 19:58:09 +02:00
asynts
68cf22d580 LibCrypto: This method wrote to a const pointer. 2020-07-27 19:58:09 +02:00
Andreas Kling
7f70a6f0cb WebServer: Try to send an appopriate Content-Type header
Use Core::guess_mime_type_based_on_filename() for this. It's obviously
not perfect, but it works better than just sending "text/html" for
everything no matter what. :^)
2020-07-27 19:57:20 +02:00
Andreas Kling
78518d230c LibCore+LibWeb: Move guess-mimetype-based-on-filename logic to LibCore
This could be useful in more places.
2020-07-27 19:57:20 +02:00
Andreas Kling
e3437414f0 Base: Remove old ladybug icon 2020-07-27 19:57:20 +02:00
Andreas Kling
5c7d54d50d WebServer: Use table tags in directory listings
Use tables to align stuff instead of putting everything in a <pre>.
2020-07-27 19:57:20 +02:00
Andreas Kling
efa117f801 WebServer: Use urlencode() in directory listings 2020-07-27 19:57:20 +02:00
Luke
a2b40de0cc LibWeb: Add a whole bunch of HTML DOM bindings
Note that these aren't full implementations of the bindings. This
mostly implements the low hanging fruit (namely, basic reflections)

There are some attributes that should be USVString instead of
DOMString. However, USVString is a slightly different definition
of DOMString, so it should suffice for now.
2020-07-27 19:51:45 +02:00
Andreas Kling
db1b67e88a UserspaceEmulator: Set the process and thread name to "(UE) Executable"
This makes it much easier to see who's who when running multiple
emulators at the same time. :^)
2020-07-27 19:10:18 +02:00
Andreas Kling
e26c6805dd Base: Add man page about set_process_name(2) 2020-07-27 19:10:18 +02:00
Andreas Kling
b5f54d4153 Kernel+LibC: Add sys$set_process_name() for changing the process name 2020-07-27 19:10:18 +02:00
Andreas Kling
0b287c18b9 UserspaceEmulator: Implement the execve() syscall :^)
This virtual syscall works by exec'ing the UserspaceEmulator itself,
with the emulated program's provided arguments as the arguments to the
new UserspaceEmulator instance.

This means that we "follow" exec'ed programs and emulate them as well.
In the future we might want to make this an opt-in (or opt-out, idk)
behavior, but for now it's what we do.

This is really quite cool, I think! :^)
2020-07-27 19:10:18 +02:00
Andreas Kling
b9a0ba9624 LibC: Make the getpid() cache process global (instead of thread-local)
Every thread in the process will have the same PID, after all.
2020-07-27 19:10:18 +02:00
Andreas Kling
b9b74e355a UserspaceEmulator: Implement the fork() syscall :^) 2020-07-27 19:10:18 +02:00