Commit Graph

219 Commits

Author SHA1 Message Date
Sergey Bugaev
93a1b88965 Userland: Implement copy --clear
You can now clear the clipboard using copy(1) like this:

$ copy --clear
2021-05-10 19:09:53 +01:00
Ömer Kurttekin
d922c2f5f3
Userland: Preserve keyboard mapping preference on reboot (#6955) 2021-05-09 15:56:03 +02:00
faxe1008
cbb06d7014
tac: Support concatenating multiple files (#6970) 2021-05-09 15:47:16 +02:00
Ali Mohammad Pur
426878c884 LibWasm: Add some more descriptive parse errors
It's much better to tell the user "hey, the magic numbers don't check
out" than "oh there was a problem with your input" :P
Also refactors some stuff to make it possible to efficiently use the
parser error enum without it getting in the way.
2021-05-08 22:14:39 +02:00
Ali Mohammad Pur
aa4d8d26b9 LibWasm: Start implementing a basic WebAssembly binary format parser
This can currently parse a really simple module.
Note that it cannot parse the DataCount section, and it's still missing
almost all of the instructions.
This commit also adds a 'wasm' test utility that tries to parse a given
webassembly binary file.
It currently does nothing but exit when the parse fails, but it's a
start :^)
2021-05-08 22:14:39 +02:00
r-paiva
90b6f999e5 Utilities: Fix mv command requesting incorrect path
When moving multiple files by using *, e.g.,: mv * /new_path/
If there was an error while trying to move a file to the new path
the next file in the file list to be moved would have its path
incorrectly set.

- Fixed mv loop to always append the correct path to the destination
path.
- Added proper error message when mv fails.
2021-05-08 15:22:47 +02:00
Linus Groh
dfa546702a Utilities/CMakeLists: Put all entries in alphabetical order 2021-05-08 10:07:11 +01:00
bleusakura
87de32df59
dd: Add ability to use k, M, & G suffixes for block sizes 2021-05-08 10:03:31 +01:00
Ali Mohammad Pur
3c01de4f0b Utilities/CMakeLists: Put 'file' entry in alphabetical order 2021-05-08 10:54:29 +02:00
Gunnar Beutner
605848787b Utilities: Specify mode argument when creating files with dd
When using open() with the O_CREAT flag we must specify the mode
argument. Otherwise we'll incorrectly set the new file's mode
to whatever is left on the stack:

courage:~ $ dd if=/dev/zero of=test count=1
1+0 blocks in
1+0 blocks out
512 bytes copied.
courage:~ $ ls -l test
--w-r-x---   1    anon   users        512   2021-05-08 01:29:52  test
courage:~ $

This also specifies the mode argument when opening files for
reading. This however is harmless because in those cases the argument
is ignored.

fixes #6923
2021-05-08 09:56:00 +02:00
Brian Gianforcaro
4c0d3f47e1 LibTest: Move Crash testing facility from crash.cpp to LibTest 2021-05-08 00:04:10 +01:00
Brian Gianforcaro
9720ad3901 Tests: Move Userland/Utilities/test-js to Tests/LibJS 2021-05-08 00:04:10 +01:00
Brian Gianforcaro
b390554ad8 Tests: Move Userland/Utilities/test-web to Tests/LibWeb 2021-05-08 00:04:10 +01:00
Idan Horowitz
284730c002 Utilities: Use GzipDecompressor::describe_header for gzip descriptions 2021-05-07 23:22:07 +02:00
Valtteri Koskivuori
9e49895bbf Userland: Fix some weird syntax in find
Spotted this while trying to fix a bug. clang-format approved.
2021-05-07 22:29:19 +02:00
Valtteri Koskivuori
33af7075e7 Userland: Remove extra slashes from find output
I noticed while testing `find` that the output of `find` contains extra
forward slashes if the root path has a trailing slash. This patch fixes
that issue by passing the root path through LexicalPath before
proceeding.
2021-05-07 22:25:39 +02:00
Andreas Kling
c7e5ef3057 strace: Stop using Core::IODevice::printf()
There are no other clients of this weird API, so let's get rid of it.
Now that we call IODevice::write() instead, we can also handle errors.
2021-05-07 22:06:58 +02:00
Andreas Kling
977fa4df81 Utilities: Convert StringBuilder::appendf() => AK::Format 2021-05-07 21:12:09 +02:00
Linus Groh
e37d9eabb1 file: Clean up mime type enumeration macro
- Improve naming
- Order alphabetically
- Remove duplicates
2021-05-07 15:43:23 +01:00
Linus Groh
2ddd2d0866 file: Remove unused static description strings 2021-05-07 15:43:23 +01:00
Linus Groh
d7446e05db file: Don't exit immediately after file open error
Instead just remember that a file failed to open, carry on and return 1
at the end.
2021-05-07 15:43:23 +01:00
Linus Groh
85a7dae391 file: Remove redundant value_or({}) 2021-05-07 15:43:23 +01:00
Linus Groh
a9fcdc767e file: Avoid some unnecessary string copies 2021-05-07 15:43:23 +01:00
Valtteri Koskivuori
8b2706e5bb Userland: Implement a file utility
This unix classic attempts to classify and identify information about
given files based on various heuristics. In this case, we're relying on
the Core::MimeData detector for file type and LibGfx::ImageDecoder for
additional metadata if the given file is an image.
It's very simple for now, but adding new detectors should be quite easy.
2021-05-07 11:46:53 +01:00
setepenre
580b335053 Userland: Add groups program 2021-05-05 15:12:30 +01:00
Sergey Bugaev
7f98aaa65a Userland: Pledge wpath & cpath in strace
...while we open the output file.
2021-05-04 22:36:58 +02:00
Sergey Bugaev
72125827da Userland: Refactor head(1) to not use stdio
This fixes extensive copying data around, and also makes head(1) in
bytes mode read exactly as much data as it needs.

Also, rename --characters to --bytes: that's exactly what it does
(actual character counting is way more complicated), and that's what
the option is called in GNU coreutils.

Fixes https://github.com/SerenityOS/serenity/issues/6852
2021-05-04 22:36:58 +02:00
Gunnar Beutner
eb21aa65d1 Userland: Make IPC results with one return value available directly
This changes client methods so that they return the IPC response's
return value directly - instead of the response struct - for IPC
methods which only have a single return value.
2021-05-03 21:14:40 +02:00
Gunnar Beutner
5bb79ea0a7 Userland: Update IPC calls to use proxies
This updates all existing code to use the auto-generated client
methods instead of post_message/send_sync.
2021-05-03 21:14:40 +02:00
Gunnar Beutner
b613817bca Userland: Fix 64-bit portability issues 2021-05-03 08:42:39 +02:00
Gunnar Beutner
63ff271125 Userland: Improve how traceroute reports timing data for packets
Previously we'd include the time required to do DNS resolution in the
time we'd report for traceroute packets. This would skew the times
reported.
2021-05-01 20:52:35 +02:00
Mango0x45
10fc9231d5 Userland: Add the rev(1) utility to reverse lines 2021-05-01 14:15:30 +02:00
Mango0x45
ec0abec9ee Userland: Remove an unused function declaration from tac.
The function declaration seems to have come from an earlier commit. The
function is no longer here so there is no reason to keep this around.
2021-05-01 14:15:23 +02:00
Gunnar Beutner
302f9798ee LibC: Implement support for getspnam() and friends 2021-05-01 12:40:12 +02:00
Brian Gianforcaro
ca213ab374 bt: Enumerate all threads when symbolizing stacks in the bt utility.
Enumerate tid's from /proc/{pid}/stacks/ and use it to print the
backtrace for all active threads in the specified process.
2021-05-01 08:44:33 +02:00
Brian Gianforcaro
f1c98dc5ea bt: Fix generation of click-able links for source files.
When the default build location was moved from /Build to the new
architecture specific directory, /Build/i686, this code broke.
All file names are now path relative one additional level up.

So continue the hack, and introduce another dummy directory to
make the relative paths resolve correctly.
2021-05-01 08:44:33 +02:00
Andreas Kling
3d4afe7614 Everywhere: "indexes" => "indices"
I've wasted a silly amount of time in the past fretting over which
of these words to use. Let's just choose one and use it everywhere. :^)
2021-04-29 22:23:52 +02:00
Andreas Kling
7ae7170d61 Everywhere: "file name" => "filename" 2021-04-29 22:16:18 +02:00
Andreas Kling
39369f1da6 Utilities: Use Vector<String> positional arguments in some places
There are more places we can use these, I just picked some that felt
like they improved the code.
2021-04-29 11:28:01 +02:00
Gunnar Beutner
c861195557 Userland: Fix new GCC warnings 2021-04-29 10:33:44 +02:00
Linus Groh
ece6ff249b tac: Replace copyright text with SPDX license identifier 2021-04-29 00:59:26 +02:00
Linus Groh
649d2faeab Everywhere: Use "the SerenityOS developers." in copyright headers
We had some inconsistencies before:

- Sometimes "The", sometimes "the"
- Sometimes trailing ".", sometimes no trailing "."

I picked the most common one (lowecase "the", trailing ".") and applied
it to all copyright headers.

By using the exact same string everywhere we can ensure nothing gets
missed during a global search (and replace), and that these
inconsistencies are not spread any further (as copyright headers are
commonly copied to new files).
2021-04-29 00:59:26 +02:00
Federico Guerinoni
c841012f56 Userland: Implement tac command
Nobody care about tac :^).
2021-04-28 10:02:08 +02:00
Jean-Baptiste Boric
b3e070b2f3 Userland: Move HOST_NAME_MAX to limits.h
POSIX mandates its definition there.
2021-04-27 23:06:16 +02:00
Gunnar Beutner
fddcaafe5f Utilities: Make ls respect options when specifying more than one path
When specifying more than one path (e.g. with ls -l /usr /bin) ls
would ignore other display options and fall back to showing the files
in short mode.
2021-04-26 18:44:30 +02:00
Sahan Fernando
b4e125cf86 Userland: Make rmdir take multiple paths 2021-04-26 09:32:42 +02:00
Linus Groh
dbe72fd962 Everywhere: Remove empty line after function body opening curly brace 2021-04-25 20:20:00 +02:00
DexesTTP
71d27abb97 Services: Rename ProtocolServer to RequestServer
The current ProtocolServer was really only used for requests, and with
the recent introduction of the WebSocket service, long-lasting
connections with another server are not part of it. To better reflect
this, this commit renames it to RequestServer.

This commit also changes the existing 'protocol' portal to 'request',
the existing 'protocol' user and group to 'request', and most mentions
of the 'download' aspect of the request to 'request' when relevant, to
make everything consistent across the system.

Note that LibProtocol still exists as-is, but the more generic Client
class and the more specific Download class have both been renamed to a
more accurate RequestClient and Request to match the new names.

This commit only change names, not behaviors.
2021-04-25 19:04:34 +02:00
DexesTTP
d398943c37 Utilities: Update telws to use the isolated WebSocket service 2021-04-25 19:04:34 +02:00
DexesTTP
c11ca9df33 LibWebSocket+telws: Use my own copyright headers :^)
Since I guess I'll start attributing my own code, might as well change
it for the previously written WebSocket code too !
2021-04-25 19:04:34 +02:00