Commit graph

1166 commits

Author SHA1 Message Date
Sergey Bugaev
b1fd06eb4c Userland: Add a test for pthread_once() 2020-11-24 21:36:28 +01:00
BenJilks
91b2af34e1 base64: Fix not outputting all decoded data
It would use printf to output the data, so if it contains a null
terminator it'll stop.
2020-11-22 16:07:00 +01:00
Lenny Maiorani
446a19ba51
test-crypto: Remove foo.response file created by testing (#4110)
Problem:
- Test creates a file and leaves it in the source tree.

Solution:
- Remove the creation of the file since it is never checked.
2020-11-20 21:18:43 +01:00
Spencer Dixon
f23d9a73aa Userland: Add -v verbose flag to 'rm' 2020-11-17 09:40:03 +01:00
Spencer Dixon
2dab9d4bac Userland: Add -v verbose flag to 'mv' 2020-11-17 09:40:03 +01:00
Spencer Dixon
7ba28b5b0b Userland: Add -v verbose flag to 'cp' 2020-11-17 09:40:03 +01:00
Andreas Kling
adabcf24ec Everywhere: Add missing <AK/ByteBuffer.h> includes
All of these files were getting ByteBuffer.h from someone else and then
using it. Let's include it explicitly.
2020-11-15 13:11:21 +01:00
Brendan Coles
d739483ee8 Userland: Tests: Use mkstemp temporary files in tests 2020-11-15 00:50:57 +01:00
Brendan Coles
f8c980a06b Userland: chroot: Add --userspec/-u flag to set uid/gid for chroot 2020-11-14 17:14:30 +01:00
AnotherTest
d3c52cef86 LibCrypto: Implement GCM mode 2020-11-14 10:18:54 +01:00
AnotherTest
2cc867bcba test-crypto: Silence the "creating bytebuffer..." debug 2020-11-14 10:18:54 +01:00
Brendan Coles
664322d34b Userland: Add test-gfx-font for Gfx::Font tests 2020-11-14 10:08:25 +01:00
Nico Weber
5c2e8b6189 Lagom: Add ntpquery to lagom build 2020-11-12 21:21:33 +01:00
Brendan Coles
7a512c4cc4 Userland: env: Add -i / --ignore-environment arg to clear env 2020-11-12 18:01:45 +01:00
Linus Groh
7fc98a96a9 test-js: Add canParseSource() native function
This allows us to check code for syntax errors without relying on
Function(), which can lead to false negatives as certain things are
valid in a function context, but not outside one.
2020-11-12 10:14:57 +01:00
Brendan Coles
549786e89a Userland: Add test for file SUID+SGID bits stripped when modified 2020-11-11 21:27:29 +01:00
Andreas Kling
b413c7ae6a ls: Only append file type indicators when -F or --classify is specified 2020-11-11 20:46:06 +01:00
Andreas Kling
5aafbdc4e8 ls: Add newline after "ls -d" output
Fixes #4030.
2020-11-11 20:36:16 +01:00
Nico Weber
8d9d3c9425 ntpquery: Add a '-a' flag that makes it use adjtime
With this, `ntpquery` can adjust the system time without
making it jump.

A fun activity with this in:

0. Boot
1. Run `su`
2. Run `ntpquery -a` to adjust the time offset after boot
   (usually around a second)
3. Keep running `ntpquery ; adjtime` to see how the offset
   behind NTP and the remaining adjtime both shrink.
   adjtime adjustment is large enough to make the time offset
   go down by a bit, but we currently lose time quickly enough
   that by the time adjtime is done, we've only corrected the
   clock about halfway, and not all the way to zero. Goto 2.

So this isn't all that great yet, but I think it's good enough
to think about turning this into a permanently running service next.
2020-11-10 19:03:08 +01:00
Nico Weber
5fcd34b810 Userland: Add an "adjtime" utility
It's a thin userland wrapper around adjtime(2). It can be used
to view current pending time adjustments, and root can use it to
smoothly adjust the system time.

As far as I can tell, other systems don't have a userland utility
for this, but it seems useful. Useful enough that I'm adding it to
the lagom build so I can use it on my linux box too :)
2020-11-10 19:03:08 +01:00
Brendan Coles
28abfd6290 Userland: ls: Add -d / --directory flag 2020-11-10 18:56:27 +01:00
Linus Groh
518481086b js: Use new string formatting functions 2020-11-10 14:33:48 +01:00
Brendan Coles
3f7b2c83d3 Tests: Add Kernel tests for unveil system call 2020-11-10 14:23:19 +01:00
Brendan Coles
7e0204fb41 Userland: ls: Add -o and -B / --ignore-backups flags
* `-B`, --ignore-backups`: Do not list implied entries ending with ~
* `-o`, In long format, do not show group information
2020-11-10 14:22:49 +01:00
marprok
5fae567008 Userland: Basic statistics for ping
After ping is terminated, the min/avg/max time
as well as information about the number of successful
packets received are printed on the screen.
2020-11-10 12:06:04 +01:00
Brendan Coles
51f49ec73f ls: Add -A flag to show dot files excluding implied . and .. directories 2020-11-10 12:04:12 +01:00
asynts
3b3edbc4d2 AK: Rename new_out to out and new_warn to warn. 2020-11-09 16:21:29 +01:00
Brendan Coles
e7173e946f ls: print inodes in short output format when -i arg is supplied 2020-11-09 07:56:56 +01:00
Nico Weber
7480034942 seq: Check start, step, end for NaN 2020-11-08 21:40:18 +01:00
Linus Groh
5c9d7d8026 js: Limit number of consecutive error trace entries being printed
> function f(){f()}f()
    Uncaught exception: [RuntimeError]: Call stack size limit exceeded
     -> f
     1234 more calls
     -> (global execution context)
    > function a(x){if(x>0){a(x-1)}else{throw Error()}}function b(x){if(x>0){b(x-1)}else{a(5)}}function c(){b(2)}c()
    Uncaught exception: [Error]
     -> a
     5 more calls
     -> b
     -> b
     -> b
     -> c
     -> (global execution context)
2020-11-08 16:51:54 +01:00
Andreas Kling
6e592fb5c3 su: Refuse to run if stdin is not a TTY 2020-11-08 16:16:03 +01:00
Brendan Coles
88307fcb59 ls: Add colored output for set-gid files 2020-11-02 13:09:17 +01:00
Andreas Kling
778011dac6 ping: Account for raw sockets now receiving IPv4 headers 2020-10-31 13:56:21 +01:00
AnotherTest
37c089fb7b LibTLS: (Almost) verify certificate chain against root CA certificates
Also adds a very primitive systemwide ca_certs.ini file.
2020-10-30 23:42:03 +01:00
Andreas Kling
77e9eadd9d Userland+LibC: Add "kill -l" to show all known signal names/numbers 2020-10-29 23:32:18 +01:00
AnotherTest
bed270ca47 Userland: Do not put a trailing space after the resulting pids in pidof 2020-10-29 22:27:24 +01:00
AnotherTest
a935a31ecf Userland: Add an implementation of 'expr'
This implements all expressions except 'match', which errors out when executed.
Closes #1124?
2020-10-29 11:53:01 +01:00
asynts
607931268e CMake: Use CONFIGURE_DEPENDS in existing globs. 2020-10-29 11:52:47 +01:00
Andreas Kling
ffd1e4831e Userland: Make killall accept signal names as well
Use getsignalbyname() to support killall -HUP foo, and such things.
2020-10-29 11:49:47 +01:00
Andreas Kling
ad0295d033 LibC: Move getsignalbyname() helper from Userland/kill into LibC 2020-10-29 11:49:24 +01:00
Andreas Kling
a6b2598fba Userland: Teach "kill" to understand signal names (not just numbers)
You can now do things like "kill -STOP pid" :^)

The getsignalbyname() helper function should probably move to LibC
or somewhere where it can be used by other signal related programs.
2020-10-29 11:45:53 +01:00
Linus Groh
0f5d1f4074 js: Load and save history from/to ~/.js-history
This is super useful when hacking on LibJS and in general :^)
2020-10-26 11:27:54 +01:00
asynts
1254cbbd0b AK: Eradicate calls to warn(). 2020-10-25 18:52:51 +01:00
asynts
a5f5c3fd33 LibC+Tests: Fix broken snprintf test.
`snprintf` returns the number of characters that would have been written
had the buffer been large enough.

It's a common trick to call `snprintf(nullptr, 0, ...)` to measure how
large a buffer has to be.

Thus the return value is not zero but fourteen.
2020-10-25 18:52:51 +01:00
Matthew L. Curry
212aa85a55 Userland/sort: Convert sort to use getline
Sort uses a statically sized buffer. This commit changes that to use getline,
so lines of any size will be handled properly.
2020-10-25 14:37:48 +01:00
Matthew L. Curry
0c2327b5b8 Userland/uniq: Add uniq utility
Add an implementation for uniq. While it will be nice in the future to
make more hardened versions of sort and uniq in the future, this
implementation of uniq is compatible with the current version of sort
and its buffer sizes.

This version supports optional input and output files along with stdin
and stdout.
2020-10-25 14:37:39 +01:00
Linus Groh
82956a08b3 LibCore: Rename File::ShouldCloseFile{Description => Descriptor}
From https://youtu.be/YNSAZIW3EM0?t=1474:

"Hmm... I don't think that name is right! From the perspective of
userspace, this is a file descriptor. File description is what the
kernel internally keeps track of, but as far as userspace is concerned,
he just has a file descriptor. [...] Maybe that name should be changed."

Core::File even has a member of this enum type... called
m_should_close_file_descriptor - so let's just rename it :^)
2020-10-25 13:59:41 +01:00
Andreas Kling
ace15e0043 Userland: Add missing license header to hexdump 2020-10-25 10:22:34 +01:00
Andreas Kling
201d34f6cd Userland: Add a very simple hexdump program :^)
This can definitely be improved, but it does the basic job!
2020-10-25 10:12:03 +01:00
asynts
88bca152c9 AK: Eradicate the uses of out(). 2020-10-24 12:56:25 +02:00