Commit graph

485 commits

Author SHA1 Message Date
kleines Filmröllchen becf74097e Help: Directly launch an app from its help page
Through links in the help page, the user can directly launch the app
whose help page is currently viewed. The idea for this feature came up
in the discussion of #11557
(https://github.com/SerenityOS/serenity/pull/11557#issuecomment-1004830728
). The intention is that the user can simply open the app they are
currently trying to understand, and play around with it, learn by doing,
or follow along with any guide that may be present in the help page. It
feels very great :^)
2022-01-11 00:24:57 +01:00
anarchyrucks 75e31a4749 Base: Add uniq(1) manpage 2022-01-09 04:27:26 -08:00
Liav A ff25958b51 Userland: Introduce the pmemdump utility
This utility helps to dump the physical memory space from /dev/mem.
It supports both read(2) and mmap(2) on it so we could use mmap(2) for
fast dumping of the memory, or read(2) when we need to read unaligned
physical regions.
2022-01-08 13:21:16 +02:00
mjz19910 10ec98dd38 Everywhere: Fix spelling mistakes 2022-01-07 15:44:42 +01:00
Tom 785c10fda9 Kernel: Add option to force using only the bootloader framebuffer
This allows forcing the use of only the framebuffer set up by the
bootloader and skips instantiating devices for any other graphics
cards that may be present.
2022-01-06 22:34:11 +01:00
Mathieu PATUREL 571d090609 profile: Specify the /proc/profile path in the help message 2022-01-04 07:56:54 +00:00
Xavier Defrang b17fef5133 mkdir: Use FilePermissionsMask to handle mode option 2022-01-01 17:33:43 +00:00
salaaad2 d364c8e352 Base: Add manpages for cut, diff, head & rmdir command line utilities 2021-12-29 20:42:18 -08:00
Daniel Bertalan 77f9272aaf Kernel+UE: Add MAP_FIXED_NOREPLACE mmap() flag
This feature was introduced in version 4.17 of the Linux kernel, and
while it's not specified by POSIX, I think it will be a nice addition to
our system.

MAP_FIXED_NOREPLACE provides a less error-prone alternative to
MAP_FIXED: while regular fixed mappings would cause any intersecting
ranges to be unmapped, MAP_FIXED_NOREPLACE returns EEXIST instead. This
ensures that we don't corrupt our process's address space if something
is already at the requested address.

Note that the more portable way to do this is to use regular
MAP_ANONYMOUS, and check afterwards whether the returned address matches
what we wanted. This, however, has a large performance impact on
programs like Wine which try to reserve large portions of the address
space at once, as the non-matching addresses have to be unmapped
separately.
2021-12-23 23:08:10 +01:00
Xavier Defrang 6ca34f5647 mkdir: Implement --mode option
Only supports permissions given in octal format
at the moment.
2021-12-21 13:13:04 -08:00
kleines Filmröllchen 102e0af867 Base: Add documentation for abench
See #11311 :^)
2021-12-20 23:15:22 -08:00
Liav A 8877dd0eea Base: Update boot_parameters(7) to describe the enable_ioapic option
The document describes the implications of enabling and disabling that
option on the ability to enable SMP mode, and describes the requirements
for enabling IOAPIC mode even without enabling SMP mode.
2021-12-20 11:00:31 -08:00
Sam Atkins f11fbb6415 Base: Add a man page for Help
This is largely copied from the `man` man page, since the same
information applies.
2021-12-20 10:58:41 -08:00
Liav A 5a649d0fd5 Kernel: Return EINVAL when specifying -1 for setuid and similar syscalls
For setreuid and setresuid syscalls, -1 means to set the current
uid/euid/gid/egid value, to be more convenient for programming.
However, for other syscalls where we pass only one argument, there's no
justification to specify -1.

This behavior is identical to how Linux handles the value -1, and is
influenced by the fact that the manual pages for the group of one
argument syscalls that handle ID operations is ambiguous about this
topic.
2021-12-20 11:32:16 +01:00
Liav A a875083739 Base: Add shutdown(1) manpage 2021-12-19 11:13:58 -08:00
Liav A f94dacf90e Base: Add reboot(1) manpage 2021-12-19 11:13:58 -08:00
networkException 121bcc267d Base: Add rm(1) manpage 2021-12-19 11:03:29 -08:00
Tim Schumacher 0ca63cfd6e find: Implement support for multiple directories 2021-12-03 15:39:00 +01:00
Idan Horowitz 58397f356f js: Add command line flag for disabling source line hints 2021-11-24 18:05:24 +00:00
Idan Horowitz 11d1950e74 js: Add command line flag for disabling ANSI colors 2021-11-24 18:05:24 +00:00
Idan Horowitz c7d2df45b9 Base: Add missing js(1) command line options 2021-11-24 18:05:24 +00:00
faxe1008 06cb526feb config: Add option to remove config key 2021-11-14 22:42:52 +01:00
Tim Schumacher 2e8330f78c Utilities/tr: Rework squeezing to be supported during more operations 2021-11-13 23:34:49 +01:00
Linus Groh 81786f6abe Base: Update synopsis of grep(1) and tr(1) manpages as well 2021-11-12 21:59:25 +00:00
Linus Groh 2a04f1fa80 Base: Add missing options to grep(1) and tr(1) manpages 2021-11-12 21:56:02 +00:00
Ben Wiederhake a59fc324bd Base: Document readonly atexit mitigation 2021-11-11 12:50:18 +00:00
Ben Wiederhake 1d777073fd grep: Add ability to output line numbers 2021-11-06 08:57:05 -07:00
Ben Wiederhake 50a65f02a8 Manpages: Auto-generate many through ArgsParser
This set was hand-curated, guided by the questions:
- Does it have at least three options, i.e. is the help page
  non-trivial?
- Is the program unusual, i.e. does listing it in Help or on
  man.serenityos.org spread awareness?
- Is the program common, but we only implement a subset of 'common'
  flags?
2021-11-01 21:12:58 +01:00
Ben Wiederhake c840ed12f4 Manpages: Document path of crash(1)
As /usr/Tests/Kernel/ is not in $PATH, invoking crash(1) does not work
as documented.
2021-11-01 21:12:58 +01:00
Ben Wiederhake 3d855a801b SystemServer: Rename 'BootModes' config option to 'SystemModes' 2021-10-25 23:38:28 +02:00
Ben Wiederhake 8d13f6ddce Kernel+SystemServer: Change bootmode to system_mode
'bootmode' now only controls which set of services are started by
SystemServer, so it is more appropriate to rename it to system_mode, and
no longer validate it in the Kernel.
2021-10-25 23:38:28 +02:00
Ben Wiederhake 09432a8241 Kernel: Separate panic behavior from bootmode
Bootmode used to control panic behavior and SystemServer.
This patch factors panic behavior control into a separate flag.
2021-10-25 23:38:28 +02:00
Ben Wiederhake 542a88a7be Kernel: Separate framebuffers from bootmode
Bootmode used to control framebuffers, panic behavior, and SystemServer.
This patch factors framebuffer control into a separate flag.
Note that the combination 'bootmode=self-test fbdev=on' leads to
unexpected behavior, which can only be fixed in a later commit.
2021-10-25 23:38:28 +02:00
SeekingBlues 638f39fbc1 sysctl: Allow showing or setting multiple variables
The `-w` option is enforced when setting variables.
2021-10-17 14:46:59 +02:00
Ben Wiederhake 8ff942b5a4 Manpages+markdown-checker: Permit only specific missing files
I can't write these manpages ad-hoc, and in most cases I don't want to
remove the link because it is justified. The hope is that with this
FIXME in place, there is more motivation to write these manpages for
someone who knows enough about them. Or at least we will introduce fewer
dead links in the future, making Help more useful.
2021-10-10 15:18:55 -07:00
Ben Wiederhake 3a9f289dc6 Manpages: Fix broken link to ioctl page
Found by markdown-checker.
2021-10-10 15:18:55 -07:00
Ben Wiederhake 81e1aa0aa3 Manpages: Don't reference non-existing chroot
Chroot exists neither in code nor in documentation. If we add-in the
feature again, it will be simple enough to add it back in to the
documentation. For now, let's clean it up, instead of refering to things
that don't exist.

Found by markdown-checker.
2021-10-10 15:18:55 -07:00
David Isaksson 7269ce15fc Base: Add man page for blockdev utility 2021-10-09 12:06:47 +02:00
Ralf Donau 9f501d7e71 Base: Fix typo in the proc(7) manpage 2021-10-09 01:39:03 +02:00
Liav A e84c03ad61 Base: Add 2 manual pages to describe the ProcFS and SysFS 2021-10-08 23:33:38 +02:00
Ben Wiederhake 52e9f25403 Everywhere: Change from http to https where feasible
I used "git grep -FIn http://" to find all occurrences, and looked at
each one. If an occurrence was really just a link, and if a https
version exists, and if our Browser can access it at least as well as the
http version, then I changed the occurrence to https.

I'm happy to report that I didn't run into a single site where Browser
can't deal with the https version.
2021-10-05 02:08:08 +02:00
kleines Filmröllchen e5938e66f3 Base: Add audio documentation 2021-10-04 18:10:10 +00:00
Nico Weber 97d27c312a Base: Fix typos 2021-10-01 01:18:52 +01:00
Brian Gianforcaro 8fcdc255ff man: Add "-z seperate-code" to man7/Mitigations.md
Update the mitigations documentation with the lateest mitigation.
2021-09-28 10:57:00 +02:00
Nico Weber 93f62384f5 Base: Update man2/pipe.md after 5d180d1f99 2021-09-26 12:45:19 +02:00
Liav A bc5a04f798 Base: Fix typo in boot_parameters(7) manual page 2021-09-24 03:55:28 +00:00
Liav A c8c94aa13d Base: Remove mentioned pci_ecam per-device option from boot_paramters(7)
This option was removed and can't be used anymore.
2021-09-24 03:55:28 +00:00
Liav A 04ba31b8c5 Kernel+Userland: Remove loadable kernel moduless
These interfaces are broken for about 9 months, maybe longer than that.
At this point, this is just a dead code nobody tests or tries to use, so
let's remove it instead of keeping a stale code just for the sake of
keeping it and hoping someone will fix it.

To better justify this, I read that OpenBSD removed loadable kernel
modules in 5.7 release (2014), mainly for the same reason we do -
nobody used it so they had no good reason to maintain it.
Still, OpenBSD had LKMs being effectively working, which is not the
current state in our project for a long time.
An arguably better approach to minimize the Kernel image size is to
allow dropping drivers and features while compiling a new image.
2021-09-11 19:05:00 +02:00
Ben Wiederhake f2ba7ac935 Base: Fix Markdown formatting in links to man pages
A quick grep revealed these stats (counting only the first occurrence
per line):

    `thing`(1): 154
    `thing(1)`: 9
    thing(1): 4

This commit converts all occurrences to the `thing`(1) format.
2021-09-11 15:17:44 +02:00
Ben Wiederhake 6fe82889fb Base: Fix Markdown casing in headings 2021-09-11 15:17:44 +02:00
Ben Wiederhake 0e3f5d3778 Base: Fix Markdown links in man pages 2021-09-11 15:17:44 +02:00
TheFightingCatfish c9b384da92 echo: Support octal, hexadecimal and unicode escape sequences 2021-08-31 16:49:45 +02:00
kleines Filmröllchen 7d7d310df6 Base+Utilities: Add the asctl audio utility, replacing avol
The new asctl (audio server control) utility expands on avol with a
completely new command line interface (documented in the man page) that
supports retrieving and setting all exposed audio server settings, like
volume and sample rate. This is currently the only user-facing way of
changing the sample rate.
2021-08-27 23:35:27 +04:30
Andreas Kling 1b739a72c2 Kernel+Userland: Remove chroot functionality
We are not using this for anything and it's just been sitting there
gathering dust for well over a year, so let's stop carrying all this
complexity around for no good reason.
2021-08-15 12:44:35 +02:00
TheFightingCatfish f67c2c97b1 Shell: Improve the parsing of history event designators 2021-08-02 02:58:55 +04:30
Brian Gianforcaro c95ac83367 Base: Mitigations(7) add -fzero-call-used-regs and Process Protection
Update the man page to describe more mitigations that we have applied.
2021-07-26 13:08:37 +04:30
Luke 256c4ad0ca Base: Add man page for Mail
This is primarily used to give an example configuration file.
2021-07-24 20:11:28 +04:30
M4x1m3 39e622c400 Utilities: Add groupdel 2021-07-15 11:16:58 +02:00
M4x1m3 21cb531be1 Utilities: Add groupadd 2021-07-15 11:16:58 +02:00
TheFightingCatfish a3400798f8 Utilities: Add an implementation of 'comm'
Add an implementation of 'comm' -- compare files line by line
2021-07-14 14:13:25 +04:30
Valtteri Koskivuori 7e98457937 Base: Fix typo in the man page for file
On macOS with a Finnish keyboard layout, $ is typed with Option+4. While
writing this manpage, I made the mistake of holding Option down a little
too long, as I often do, resulting in the keystroke Option+space. This,
instead of typing a space, types U+00A0 (non-breaking space), which
looks identical on my host terminal. Luckily the Serenity terminal
called me out on it, printing out a question mark instead.
2021-07-13 00:32:19 +01:00
Ariel Don 4eba921d48 ls: Add option to list subdirectories recursively
List subdirectories encountered using -R or --recursive flags with ls.
2021-07-12 19:15:19 +04:30
Peter Elliott 9b40208e3b Documentation: Add less(1) man page, and link to it in others 2021-07-07 20:01:15 +04:30
Maciej Zygmanowski 57340dda36 Base: Add more manpages for command-line utilities 2021-07-03 09:08:25 +02:00
Gal Horowitz c0e04768e0
Base: Change incorrect "See Also" links in module_load(2) and modunload(8) (#8006) 2021-06-12 23:08:29 +02:00
Max Wipfli 73084835da Base: Clarify and extend unveil(2) man page 2021-06-08 12:15:04 +02:00
Andreas Kling 33f2eeea4a pls: Drastically simplify this program
Since this program is setuid-root, it should be as simple as possible.

To that end, remove `/etc/plsusers` and use filesystem permissions to
achieve the same thing. `/bin/pls` is now only executable by `root` or
members of the `wheel` group.

Also remove all the logic that went to great lengths to `unveil()` a
minimal set of filesystem paths that may be used for the command.
The complexity-to-benefit ratio did not seem justified, and I think
we're better off keeping this simple.

Finally, remove pledge promises the moment they are no longer needed.
2021-05-30 23:09:37 +02:00
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
Ali Mohammad Pur 27572c9d34 Base: Document the Shell's new termios allow-list
Also add `stty` to that list by default.
2021-05-24 23:26:49 +04:30
Andreas Kling 85dd5b810b Documentation: Update bt(1) man page for symbolication changes 2021-05-22 18:54:22 +02:00
Linus Groh 0aab774343 Everywhere: Fix a bunch of typos 2021-05-17 17:48:55 +01:00
Andreas Kling 58d73ea36c Userland: Rename QuickShow => Image Viewer
The old name was a bit too ambiguous. This one is crystal clear. :^)
2021-05-14 18:34:44 +02:00
Ali Mohammad Pur a527256356 Shell: Add an option to autosave history every N ms
...and set it to 10 seconds by default.
2021-05-11 10:19:07 +01:00
Mart G e81d35995e Base: Fix a spelling error in the mitigations man page 2021-05-10 17:44:30 +01:00
Ali Mohammad Pur b1fe5d5517 Shell: Parse '\t' in doublequoted strings as a tab character
This not being recognised is surprising.
2021-05-10 10:43:23 +02:00
Ali Mohammad Pur 22b244df45 Shell: Add support for \uhhhhhhhh escapes in strings
This will be replaced with the unicode character whose codepoint is
given by the unsigned 32-bit number 'hhhhhhhh' (hex).
2021-05-10 10:43:23 +02:00
Linus Groh 5468a23fc2 Base: Fix path to LibJS tests in test-js(1) man page 2021-05-08 12:04:55 +01:00
ry755 9cec9fb1e8 Base: Update TextEditor man page to include line and column arguments
This documents the feature in c2872766f2
2021-05-08 09:54:53 +02:00
Valtteri Koskivuori 09ea57031f Base: Add manpage for file(1) 2021-05-07 16:29:58 +01:00
Linus Groh 336a79a452 Base: Consistently stylize arguments in man pages as inline code 2021-05-07 16:19:49 +01:00
setepenre 8978325af8 Base: Add manpage for groups(1) 2021-05-05 15:12:30 +01:00
Brendan Coles aee735889e Base: Fix typos and spelling errors in man pages 2021-05-05 12:22:08 +01:00
Brian Gianforcaro 56fccf1667 Base: Minor cleanup of a few man pages.
- Fix some typos and formatting.

- Add links to Mitigations from unveil / pledge.
2021-05-05 12:24:16 +02:00
Brian Gianforcaro 325e491d34 Base: Add a boot_parameters(7) to document kernel boot parameters. 2021-05-05 12:24:16 +02:00
Andreas Kling 93f03c73d9 Base: Update recvfd() man page after addition of options argument 2021-05-04 21:02:22 +02:00
Mango0x45 1635942951 Man: Add a manpage for rev(1) 2021-05-01 14:15:30 +02:00
Brian Gianforcaro 38fe67abb4 Base: Add a man page for the 'bt' command. 2021-05-01 08:44:33 +02:00
Andreas Kling def1f1444a WindowServer: Move configuration file to /etc/WindowServer.ini
This was in the /etc/WindowServer/ directory which had nothing else in
it, so let's just get rid of the directory and move this up one step.
2021-04-29 22:16:18 +02:00
Ali Mohammad Pur c5c6161406 Base: Describe heredocs in Shell's manpage 2021-04-29 20:25:56 +02:00
Rudolf Adamkovič 525fad42f5
Base: Make test(1) summary line match other man pages
Other `man` pages use the imperative form.
2021-04-25 23:57:32 +02:00
Panagiotis Vasilopoulos e45e0eeb47 Everywhere: Replace SERENITY_ROOT with SERENITY_SOURCE_DIR 2021-04-20 15:27:52 +02:00
Linus Groh 2b0c361d04 Everywhere: Fix a bunch of typos 2021-04-18 10:30:03 +02:00
Gunnar Beutner 127fe38612 Base: Remove stray backtick in the watch manpage 2021-04-17 09:25:40 +02:00
sin-ack afb04cf544 man: Update SystemServer(5) documentation with new Socket style
This patch adds new information about the usage of multiple sockets with
eager services and the new socket takeover mechanism exposed by
SystemServer.
2021-04-16 18:22:10 +02:00
Nicholas-Baron b2c952a6fa Base: Add documentation for get_process_name
`set_process_name` has a getter pair (which it links to); lets document it.

Solves #6007.
2021-04-15 09:01:11 +02:00
Peter Elliott eca20e92da Userland: Add support for -S to env command
- Refactor env to use Core::ArgsParser
- create symlink from /bin/env to /usr/bin/env for compatiability
2021-04-12 14:06:24 +02:00
Andreas Kling 251018676f Everywhere: Update references from ReadMe.md => README.md 2021-04-11 10:52:25 +02:00
Roi f046654477 Base: Update modunload path
The file `modunload.md` has moved to `man8`
2021-03-27 19:43:58 +01:00
Brendan Coles 5331ae0e93 Base: man pages: document arguments, fix typos, use American English 2021-03-27 19:23:49 +01:00
Cesar Torres 6179c9ad25 jp: add man page 2021-03-24 20:34:26 +01:00
Idan Horowitz 505c84fdf0 Base: Add man page for zip(1) 2021-03-23 16:09:36 +01:00
AnotherTest 4ff430b615 Base: Document Shell's variable indexing behaviour 2021-03-22 13:15:08 +01:00
AnotherTest 6c94207ee0 Base: Document Shell's immediate functions 2021-03-22 13:15:08 +01:00
Roi 72501775a7
Base: Change path to both modload and modunload (#5804) 2021-03-16 16:05:42 +01:00
Brendan Coles f21af0922a QuickShow: Add help documentation 2021-03-13 10:00:59 +01:00
Brendan Coles 69b98f7d32 Base: Add sysctl man page 2021-03-08 09:48:34 +01:00
Emanuele Torre 1f81bc6879 Everywhere: Remove unnecessary whitespace at the end of some lines. 2021-03-08 09:20:53 +01:00
AnotherTest 13b65b632a Shell: Add support for enumerating lists in for loops
With some odd syntax to boot:
```sh
$ for index i x in $whatever {}
```
2021-03-07 10:59:51 +01:00
Ben Wiederhake 15b675a804 Shell: Document all supported PROMPT flags 2021-03-04 22:17:18 +01:00
Brendan Coles 89265be167 Base: Add man pages for null/zero/full character devices 2021-03-04 09:19:15 +01:00
Idan Horowitz 2dea887e8f Base: Add mktemp(1) man page 2021-02-28 15:30:49 +01:00
Brendan Coles 0ffc06b795 Profiler: Add help documentation 2021-02-24 20:40:00 +01:00
Brendan Coles 501834ba45 Inspector: Add help documentation 2021-02-23 13:52:16 +01:00
Andreas Kling 84b2d4c475 Kernel: Add "map_fixed" pledge promise
This is a new promise that guards access to mmap() with MAP_FIXED.

Fixed-address mappings are rarely used, but can be useful if you are
trying to groom the process address space for malicious purposes.

None of our programs need this at the moment, as the only user of
MAP_FIXED is DynamicLoader, but the fixed mappings are constructed
before the process has had a chance to pledge anything.
2021-02-21 01:08:48 +01:00
Linus Groh 17959c1408 Base: Update path in js(1) manpage example 2021-02-20 16:05:20 +01:00
Linus Groh 1002236715 Base: Mention -n option in echo(1) manpage 2021-02-20 16:05:20 +01:00
Linus Groh 4896005fb2 Base: Tweak ddate(1) manpage tagline 2021-02-20 16:05:20 +01:00
Linus Groh b80b6ffca0 Base: Unify synopsis format in manpages 2021-02-20 16:05:20 +01:00
Andreas Kling 8fd86fe6c9 Base: Do a little copy-editing in Mitigations(7) 2021-02-20 11:37:55 +01:00
Andreas Kling 7e959d7430 Base: Fix a broken commit link in Mitigations(7) 2021-02-20 09:32:40 +01:00
Brian Gianforcaro 0d196d14d2 Base: Document more the mitigations in man7/Mitigations.md
Document:
* Unmap After Init
* RELRO
* -fstack-clash-protection
* -fstack-protector / -fstack-protector-strong
2021-02-20 09:01:02 +01:00
Brian Gianforcaro a5f879ea8c Base: Add a man page documenting security mitigations
Since so much work is being put into mitigations, I thought
it would be nice to track them all in one place. This is the
start of that document.
2021-02-15 15:25:01 +01:00
Andreas Kling ca1c560161 Base: Don't mark "prot_exec" pledge promise as a SerenityOS extension
OpenBSD also has this promise.
2021-02-12 16:24:40 +01:00
Andreas Kling c94392a1cc Applications: Remove "Welcome" application
This was a cute application for its time, but it's far too jokey and
non-serious for how I'd like this project to treat itself.
2021-02-03 10:20:17 +01:00
Linus Groh 7b50d3cda4 Base: Update keymap(1) manpage
- Keymap name/file is now optional
- No root shell required (/bin/keymap is setuid root)
- Add example for getting the current keymap name
2021-02-02 16:53:11 +01:00
Linus Groh ee41d6e154 Base: Rename some keymaps to use xx-xx format where appropriate
- en.json -> en-us.json
- gb.json -> en-gb.json
- ptbr.json -> pt-br.json
- ptpt.json -> pt-pt.json
2021-02-02 16:53:11 +01:00
Liav A 878d353c3d Documentation: Add a manual page about the new MemoryDevice file 2021-02-01 17:13:23 +01:00
Andreas Kling 6e4e3a7612 Kernel: Remove pledge exception for sys$getsockopt() with SO_PEERCRED
We had an exception that allowed SOL_SOCKET + SO_PEERCRED on local
socket to support LibIPC's PID exchange mechanism. This is no longer
needed so let's just remove the exception.
2021-01-31 09:29:27 +01:00
Andreas Kling 90343eeaeb Revert "Kernel: Return -ENOTDIR for non-directory mount target"
This reverts commit b7b09470ca.

Mounting a file on top of a file is a valid thing we support.
2021-01-30 13:52:12 +01:00
Andreas Kling d0c5979d96 Kernel: Add "prot_exec" pledge promise and require it for PROT_EXEC
This prevents sys$mmap() and sys$mprotect() from creating executable
memory mappings in pledged programs that don't have this promise.

Note that the dynamic loader runs before pledging happens, so it's
unaffected by this.
2021-01-29 18:56:34 +01:00
Linus Groh dbbc378fb2 Kernel: Return -ENOTBLK for non-block device Ext2FS mount source
When mounting an Ext2FS, a block device source is required. All other
filesystem types are unaffected, as most of them ignore the source file
descriptor anyway.

Fixes #5153.
2021-01-29 08:45:56 +01:00
Linus Groh b7b09470ca Kernel: Return -ENOTDIR for non-directory mount target
The absence of this check allowed silly things like this:

    # touch file
    # mount /dev/hda file
2021-01-29 08:45:56 +01:00
Linus Groh 22df4727b1 Base: Update crash(1) man page
Update the outdated list of options, mention UserspaceEmulator, update
example shell output.
2021-01-26 11:40:08 +01:00
Ben Wiederhake b0b8953ec1 Base: Fix syscall/libc manpage sorting 2021-01-23 16:47:09 +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
Linus Groh 421587c15c Everywhere: Fix typos 2021-01-22 18:41:29 +01:00
AnotherTest 10c3168fa0 Base: Remove irrelevant example from Shell's loop manpage section
Seems like it was copied one too many times.
2021-01-18 08:56:34 +01:00
AnotherTest ffd74a2c5a Base: Mention that the if condition is a command
Sorta closes #4991.
2021-01-18 08:56:34 +01:00
Andreas Kling bf0719092f Kernel+Userland: Remove shared buffers (shbufs)
All users of this mechanism have been switched to anonymous files and
passing file descriptors with sendfd()/recvfd().

Shbufs got us where we are today, but it's time we say good-bye to them
and welcome a much more idiomatic replacement. :^)
2021-01-17 09:07:32 +01:00
Brendan Coles aa8cb35b90 TextEditor: Add help documentation 2021-01-16 19:35:08 +01:00
AnotherTest ddd0c1dd8b Base: Add manpage entry for history events 2021-01-15 19:13:03 +01:00
Andreas Kling f03800cee3 Kernel: Add dedicated "ptrace" pledge promise
The vast majority of programs don't ever need to use sys$ptrace(),
and it seems like a high-value system call to prevent a compromised
process from using.

This patch moves sys$ptrace() from the "proc" promise to its own,
new "ptrace" promise and updates the affected apps.
2021-01-11 22:32:59 +01:00
Brendan Coles d0a9954f0e Userland: Add ddate utility
Today is Boomtime, day 7 of Chaos, in the YOLD 3187
2021-01-08 09:42:43 +01:00
Brendan Coles fb9eb20544 date: Use ArgsParser and add ISO8601 / RFC3339 / RFC5322 output formats 2021-01-07 20:17:44 +01:00
Brendan Coles 81c5b35dce Base: Add tar man page documentation 2021-01-06 15:40:26 +01:00
Brendan Coles 5c0c4f4b2d Playground: Support opening gml file by path as command line argument 2021-01-05 17:12:54 +01:00
Brendan Coles 1f03b6ad57 Playground: Add help documentation 2021-01-04 18:50:26 +01:00
Brendan Coles 4d32121293 man: Rename manual section 1 to "User programs" 2021-01-03 17:14:50 +01:00
Brendan Coles 35fe1b39a2 FontEditor: Add help documentation 2021-01-03 13:22:00 +01:00
Brendan Coles a50583ade1 Base: Add Terminal man page documentation 2021-01-02 11:43:42 +01:00
Andreas Kling d51bbe1e20 Help: Add a simple index page
Let's show something a bit more welcoming than empty white when the user
launches the Help application. :^)
2021-01-02 02:41:16 +01:00
AnotherTest 5e5eb615ec Shell: Add runtime errors and implement break/continue
Such errors are raised when SyntaxError nodes are executed, and are also
used for internal control flow.
The 'break' and 'continue' commands are currently only allowed inside
for loops, and outside function bodies.

This also adds a 'loop' keyword for infinite loops.
2020-12-29 16:55:43 +01:00
Brendan Coles c006952aeb Base: Add pape man page documentation 2020-12-29 01:02:01 +01:00
Lenny Maiorani b2316701a8 Everywhere: void arguments to C functions
Problem:
- C functions with no arguments require a single `void` in the argument list.

Solution:
- Put the `void` in the argument list of functions in C header files.
2020-12-26 10:10:27 +01:00
Brendan Coles b71edba06d Userland: Add pmap utility 2020-12-24 13:22:24 +01:00
Brendan Coles 39c92dad83 Userland: useradd: Add command line option to set user password 2020-12-21 09:57:26 +01:00
Lenny Maiorani 765936ebae
Everywhere: Switch from (void) to [[maybe_unused]] (#4473)
Problem:
- `(void)` simply casts the expression to void. This is understood to
  indicate that it is ignored, but this is really a compiler trick to
  get the compiler to not generate a warning.

Solution:
- Use the `[[maybe_unused]]` attribute to indicate the value is unused.

Note:
- Functions taking a `(void)` argument list have also been changed to
  `()` because this is not needed and shows up in the same grep
  command.
2020-12-21 00:09:48 +01:00
Brendan Coles 853664bd3c LibC: stdlib: Add clearenv() function 2020-12-17 19:39:56 +01:00
Brendan Coles b9d99849ad Userland: Add beep utility 2020-12-16 17:29:28 +01:00
Brendan Coles 3c9a3a9405 EchoServer: Add a simple echo server 2020-12-16 17:29:12 +01:00
Sergey Bugaev 952c0dc2a0 Userland: Implement find -name clause
Closes https://github.com/SerenityOS/serenity/issues/4191
2020-11-28 14:28:58 +01:00
Sergey Bugaev 098070b767 Kernel: Add unveil('b')
This is a new "browse" permission that lets you open (and subsequently list
contents of) directories underneath the path, but not regular files or any other
types of files.
2020-11-23 18:37:40 +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
Andreas Kling b413c7ae6a ls: Only append file type indicators when -F or --classify is specified 2020-11-11 20:46:06 +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
Nico Weber 323e727a4c Kernel+LibC: Add adjtime(2)
Most systems (Linux, OpenBSD) adjust 0.5 ms per second, or 0.5 us per
1 ms tick. That is, the clock is sped up or slowed down by at most
0.05%.  This means adjusting the clock by 1 s takes 2000 s, and the
clock an be adjusted by at most 1.8 s per hour.

FreeBSD adjusts 5 ms per second if the remaining time adjustment is
>= 1 s (0.5%) , else it adjusts by 0.5 ms as well. This allows adjusting
by (almost) 18 s per hour.

Since Serenity OS can lose more than 22 s per hour (#3429), this
picks an adjustment rate up to 1% for now. This allows us to
adjust up to 36s per hour, which should be sufficient to adjust
the clock fast enough to keep up with how much time the clock
currently loses. Once we have a fancier NTP implementation that can
adjust tick rate in addition to offset, we can think about reducing
this.

adjtime is a bit old-school and most current POSIX-y OSs instead
implement adjtimex/ntp_adjtime, but a) we have to start somewhere
b) ntp_adjtime() is a fairly gnarly API. OpenBSD's adjfreq looks
like it might provide similar functionality with a nicer API. But
before worrying about all this, it's probably a good idea to get
to a place where the kernel APIs are (barely) good enough so that
we can write an ntp service, and once we have that we should write
a way to automatically evaluate how well it keeps the time adjusted,
and only then should we add improvements ot the adjustment mechanism.
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
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
Brendan Coles 0058d28a73 Base: Add ls man page documentation 2020-11-10 12:04:26 +01:00
AnotherTest 3fa0b887ed Shell: Document the new 'pattern as (list of names)' match syntax 2020-10-29 11:53:01 +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
Linus Groh d412fbdcf3 Shell+LibLine: Support HISTCONTROL environment variable
This is implemented in Line::Editor meaning not only the Shell will
respect it, but also js, Debugger etc.

Possible values are "ignorespace", "ignoredups" and "ignoreboth", as
documented in Shell-vars(7), for now.

The default value for the anon user (set in .shellrc) is "ignoreboth".
2020-10-26 11:27:54 +01:00
Linus Groh 4a4b1b1131 Shell: Support HISTFILE environment variable
This allows changing the Shell's history file path.
2020-10-26 11:27:54 +01:00
AnotherTest d7577b0338 Base: Document the new brace expansions in Shell's manpage 2020-10-25 10:09:27 +01:00
AnotherTest 0341e3fde7 Base: Add a manpage for 'printf' 2020-10-22 17:49:03 +02:00
Linus Groh 57e7b2f8e4 Base: Update test-js(1) man page 2020-10-19 11:29:55 +02:00
Linus Groh bcfc6f0c57 Everywhere: Fix more typos 2020-10-03 12:36:49 +02:00
Linus Groh 91bcad7cce Base: Add missing options to the Shell(1) man page 2020-10-02 14:40:54 +02:00
AnotherTest 642b52cbb8 Base: Fixup forgotten 'example' heading name in Shell man page
As noticed in #3578.
2020-09-23 20:46:07 +02:00
AnotherTest 3a8109d1e0 Shell: Add some sections on the manpage about `match' 2020-09-15 20:36:59 +02:00
AnotherTest b4da45ab76 Shell: Add documentation for functions 2020-09-14 17:40:18 +02:00
AnotherTest c296bcc1d9 Base: Tweak Shell(5) manpage a bit
Someone brought to my attention that "or missing" is not correct there.
2020-09-10 11:20:22 +02:00
AnotherTest 34d210ecf5 Shell: Update the Shell(5) manpage
This patchset adds the following to the manpage:
- Mention `if` expressions.
- Add section about subshells
- Mention that control structures can now be used as commands
- Update the grammar.
- Fix small header size mistake with "Example"'s being larger than their
  containing sections.
2020-09-09 20:35:21 +02:00
AnotherTest 68189f80cc Shell: Document the use of environment/local variables 2020-08-18 16:58:17 +02:00
AnotherTest 32bfb48577 Shell: Update manpage about for loop behaviour around signals 2020-08-18 16:58:17 +02:00
AnotherTest 0950fd1438 Shell: Start writing a man page
This patch adds two man pages describing the parts of the shell that
have been so far finalised.
2020-08-14 10:31:52 +02:00
Andreas Kling 7de831efc6 Kernel+LibC: Add sys$disown() for disowning child processes
This syscall allows a parent process to disown a child process, setting
its parent PID to 0.

Unparented processes are automatically reaped by the kernel upon exit,
and no sys$waitid() is required. This will make it much nicer to do
spawn-and-forget which is common in the GUI environment.
2020-08-04 18:17:16 +02:00
Ben Wiederhake eccf96b703 Meta: Find potentially missing resources 2020-07-29 01:34:22 +02:00
Andreas Kling e26c6805dd Base: Add man page about set_process_name(2) 2020-07-27 19:10:18 +02:00
Linus Groh 8f3151eea8 Base: Add link to test-common.js in test-js(1) man page
This is an easy way to view this file as the link will open it in Text
Editor :^)
2020-07-07 17:42:50 +02:00
Nico Weber 564c4634c0 man pages: Consistently use "Otherwise, " in the few places that said "^Else, " 2020-07-07 16:37:46 +02:00
Linus Groh 4c845b35ac Base: Add man page for test-js(1) 2020-07-07 10:39:48 +02:00
Linus Groh 8b76a1e548 js: Remove test mode
Now that we have a standalone test-js program, the "-t" test mode of the
js REPL is unused and can simply be removed. Required functionality has
been duplicated in test-js (isStrictMode function, loading of testing
utilities).

Also remove outdated information about tests from the js(1) man page.
2020-07-07 00:21:30 +02:00
Nico Weber 0d851b1930 Add manpages for posix_spawn 2020-07-06 10:01:14 +02:00
Andreas Kling 6b3a7b1ce7 Base: Add man pages for gettid(), getpid(), and getppid() 2020-07-05 19:37:43 +02:00
Sergey Bugaev a8489967a3 Kernel: Add Plan9FS :^)
This is an (incomplete, and not very stable) implementation of the client side
of the 9P protocol.
2020-07-05 12:26:27 +02:00
Nico Weber 1f323076f0 Add man pages for seteuid() and friends.
Also add an overview page that explains the general concepts.
2020-07-03 19:37:28 +02:00
Sahan Fernando 0fc8931d5f Userland: Add watch tool 2020-06-30 12:46:23 +02:00
AnotherTest 880c3fb83f Userland: Add a 'test' utility
This adds an incomplete implementation of the test util, missing some
user/group checks, and `-l STRING`.
It also symlinks '[' to 'test'.
2020-06-27 16:08:52 +02:00
Kevin Meyer ebbcef926a Base: Fix sendfd's man page return section 2020-06-27 11:50:31 +02:00
Sergey Bugaev f08aa6324e Base: Mention that sendfd & recvfd were introduced in plan9port 2020-06-25 15:49:04 +02:00
Andreas Kling c689be0dbc Base: Add "sendfd" and "recvfd" promises to pledge(2)
And as it turns out, these are not even extensions! :^)
2020-06-25 10:58:37 +02:00
Andreas Kling 55a22b50c9 Base: Fix wording in recvfd(2)
recvfd() returns a *non-negative* integer on success. 0 is a valid fd.
2020-06-25 10:58:37 +02:00
Andreas Kling 1a7ccc1569 Base: Add man pages for recvfd(2) and sendfd(2) :^) 2020-06-24 23:08:18 +02:00
Andreas Kling 2188ed54b0 Base: Note that the "setkeymap" pledge promise is an extension 2020-06-19 21:15:25 +02:00
Tom Lebreux 605a21b892 Userland: Add base64 tool 2020-06-18 23:21:41 +02:00
Andreas Kling 0609eefd57 Kernel: Add "setkeymap" pledge promise 2020-06-18 22:19:36 +02:00
Sergey Bugaev fd985b1f48 Base: Document readlink(1) and readlink(2) :^) 2020-06-17 15:02:03 +02:00
Sergey Bugaev f2d40ac2b2 Base: Document new SystemServer abilities 2020-06-09 21:12:34 +02:00
Sergey Bugaev 4643f51eaa Base: Document find(1) 2020-06-06 14:42:31 +02:00
Keith daa3f59a55
Base: Fix misspelling in getopt(3) (#2473) 2020-06-02 07:40:26 +02:00
Sergey Bugaev 52711921c6 Base: Document getopt 2020-05-30 15:01:18 +02:00
Sergey Bugaev 3847d00727 Kernel+Userland: Support remounting filesystems :^)
This makes it possible to change flags of a mount after the fact, with the
caveats outlined in the man page.
2020-05-29 07:53:30 +02:00
Sergey Bugaev 39cde80545 Base: Document MS_RDONLY
Also fix a couple of issues with the man pages.
2020-05-29 07:53:30 +02:00
AnotherTest ca6e361279 Base: Add manpage for xargs 2020-05-28 11:01:08 +02:00
Sergey Bugaev ae21b8ee56 Base: Replace TTYServer with text mode Shell
Now that we have SystemServer that can (re)spawn the Shell, we don't need a
separate server just for that.

The two shells (on tty0 and tty1) are configured to only be started when booting
in text mode. This means you can now simply say boot_mode=text on the kernel
command line, and SystemServer will set up the system and spawn a comfy root
shell for you :^)
2020-05-27 11:19:38 +02:00
Sergey Bugaev 856e4853f4 SystemServer: Add BootModes and Environment service options
SystemServer will now look at the boot mode, as specified on the kernel command
line, and only launch the services configured for that boot mode.
2020-05-27 11:19:38 +02:00
Sergey Bugaev f746bbda17 Base: Document the sigaction promise
Also add a few generic words about pledge().
2020-05-26 14:35:10 +02:00
Andres Vieira cbbfc08f1d Docs: Add unzip(1) man page 2020-05-09 23:50:44 +02:00
Andreas Kling 5bfd893292 Kernel+Userland: Add "settime" pledge promise for setting system time
We now require the "settime" promise from pledged processes who want to
change the system time.
2020-05-08 22:54:17 +02:00
Sergey Bugaev 983e541584 Base: Fix a typo 2020-05-05 11:07:06 +02:00
Sergey Bugaev 718271c9df Base: Document unveil(2)
Also, escape underscores in chroot_with_mount_flags.
2020-05-04 21:44:50 +02:00
Linus Groh e37065cc8b Base: Update js(1) manpage
Syntax highlighting is now enabled by default!
2020-05-02 01:23:50 +02:00
Linus Groh 8f2300afb5 mkdir: Add -p option to create parent directories 2020-04-28 09:36:09 +02:00
Linus Groh 6fd7966d81 mkdir: Use ArgParser, support creating multiple directories 2020-04-28 09:36:09 +02:00
Linus Groh 440f017946 Base: Update js(1) manpage
- Include all options
- Update example REPL session to match current output
- Mention REPL's help()
- Add test mode section
2020-04-19 15:22:31 +02:00
Sergey Bugaev 15daf88e93 Base: Document open(1) 2020-04-19 11:14:26 +02:00
Liav A 23fb985f02 Kernel & Userland: Allow to mount image files formatted with Ext2FS 2020-04-06 15:36:36 +02:00
Andreas Kling 9ae3cced76 Revert "Kernel & Userland: Allow to mount image files formatted with Ext2FS"
This reverts commit a60ea79a41.

Reverting these changes since they broke things.
Fixes #1608.
2020-04-03 21:28:57 +02:00
Liav A a60ea79a41 Kernel & Userland: Allow to mount image files formatted with Ext2FS 2020-04-02 12:03:08 +02:00
Sergey Bugaev db4da68618 Base: Add a man page for js(1)
This also changes --ast-dump to --dump-ast, because I like it better
and that is what the variable is actually called.
2020-03-26 08:18:08 +01:00
Itamar bd9f14e27e SystemServer: Add WorkingDirectory support
Services can now have their initial working directory
configured via `SystemServer.ini`.

This commit also configures Terminal's working directory
to be /home/anon
2020-03-18 08:23:31 +01:00
Shannon Booth 57f1c919df LibCore: Remove all remaining C prefix references
LibCore's GZip is also moved into the Core namespace with this change.
2020-03-07 01:33:53 +01:00
Andreas Kling f72e5bbb17 Kernel+LibC: Rename shared buffer syscalls to use a prefix
This feels a lot more consistent and Unixy:

    create_shared_buffer()   => shbuf_create()
    share_buffer_with()      => shbuf_allow_pid()
    share_buffer_globally()  => shbuf_allow_all()
    get_shared_buffer()      => shbuf_get()
    release_shared_buffer()  => shbuf_release()
    seal_shared_buffer()     => shbuf_seal()
    get_shared_buffer_size() => shbuf_get_size()

Also, "shared_buffer_id" is shortened to "shbuf_id" all around.
2020-02-28 12:55:58 +01:00
howar6hill 7ff256aab6 Base: Add a man page for lspci 2020-02-20 15:13:42 +01:00
howar6hill 83668299a6
host: Use ArgsParser to parse arguments, and add man page (#1252)
Fixes #1246.
2020-02-20 15:12:55 +01:00
howar6hill 940de40f28
Userland: Add userdel program (#1217) 2020-02-19 12:59:09 +01:00
howar6hill 94ed183774 Man: Use ArgsParser to parse arguments 2020-02-18 12:23:15 +01:00
thatlittlegit bc28e55d61 Base: Add documentation for the welcome.txt format 2020-02-15 20:46:10 +01:00
Andreas Kling d34ad44f90 Base: Add man page for posix_openpt(3) 2020-02-07 22:37:27 +01:00
Jesse Buhagiar f9609fe08a Userland: useradd utility
This commit implements the `useradd` utility that is found on most,
if not all *NIX systems. It allows the root user to add new users
to the password file found in `/etc/passwd`, thereby making
it easier to manipulate the file.
2020-02-02 10:58:45 +01:00
Andreas Kling 95504b5850 Base: Note in pledge(2) man page which promises are extensions
Also add a little "History" section noting that pledge() is an original
OpenBSD invention and that our implementation differs in many ways.
2020-01-23 10:41:07 +01:00
Sergey Bugaev 3e1ed38d4b Kernel: Do not return ENOENT for unresolved symbols
ENOENT means "no such file or directory", not "no such symbol". Return EINVAL
instead, as we already do in other cases.
2020-01-18 23:51:22 +01:00
Andreas Kling 26a31c7efb Kernel: Add "accept" pledge promise for accepting incoming connections
This patch adds a new "accept" promise that allows you to call accept()
on an already listening socket. This lets programs set up a socket for
for listening and then dropping "inet" and/or "unix" so that only
incoming (and existing) connections are allowed from that point on.
No new outgoing connections or listening server sockets can be created.

In addition to accept() it also allows getsockopt() with SOL_SOCKET
and SO_PEERCRED, which is used to find the PID/UID/GID of the socket
peer. This is used by our IPC library when creating shared buffers that
should only be accessible to a specific peer process.

This allows us to drop "unix" in WindowServer and LookupServer. :^)

It also makes the debugging/introspection RPC sockets in CEventLoop
based programs work again.
2020-01-17 11:19:06 +01:00
Brian Gianforcaro b553a86048 man: Fix minor inconsistencies in pledge(2) man page
- tty promise was listed twice.

- Fix a few typos
2020-01-14 08:00:35 +01:00
Sergey Bugaev 9513f54932 Base: Document new chroot abilities 2020-01-12 20:02:11 +01:00
Andreas Kling 198cd77307 Base: Tweak language in pledge(2) man page 2020-01-12 19:08:42 +01:00
Andreas Kling f3eb06a46f Base: Add a man page about pledge(2) 2020-01-12 16:11:12 +01:00
Sergey Bugaev b37bd28053 Base: Document mount(2) and mount(8) 2020-01-11 18:57:53 +01:00