User Details
- User Since
- May 14 2014, 7:55 PM (628 w, 4 d)
Sat, May 30
Mon, May 25
Sun, May 24
Sat, May 23
Sun, May 17
I suggest discussing this on a mailing list.
It would be best to test this in practice with some jail images first, to see that practical applications can run without the shell package.
Is signal(3) the right reference? C code had better use sigaction(2) instead, or the list might be moved to a new signal(7) page?
Sat, May 16
It feels a little weird to clutter up ulimit -a and limits with a limit for this pretty exotic feature.
With the existing rlimit functionality specified by POSIX, I can, as a user, defend against a forkbomb or prevent forks/kqueues entirely in a particular process subtree. A system administrator can also set resource limits which will be applied at login or service start. It seems like that setting limits on a particular process subtree will not work any more.
Sat, May 9
Apr 27 2026
The #! mechanism is already described (more briefly) in lib/libsys/execve.2 lines 73...100. That duplication is certainly undesirable.
Apr 26 2026
The sh part looks good and appears to work in a quick test.
Apr 25 2026
Apr 24 2026
Fix assertions; correct assertion
Mar 1 2026
Feb 25 2026
Feb 19 2026
Feb 16 2026
Let's not mention the behaviour when return exits the shell during an EXIT trap action, since it's obscure and probably incorrect (I think it's supposed to work like exit, with a difference between return by itself and return "$?", but in practice it always ignores the argument during an EXIT trap action).
Feb 15 2026
Feb 8 2026
Feb 1 2026
Jan 31 2026
Jan 30 2026
One apparent mistake, looks OK otherwise.
Dec 30 2025
Dec 27 2025
Dec 7 2025
Nov 29 2025
Nov 19 2025
Nov 17 2025
Nov 16 2025
Nov 15 2025
Nov 7 2025
Nov 2 2025
Oct 31 2025
This is correct, and useful if there is a practical use case that frequently does $(alias) (but not $(alias NAME); a little more code would be needed). Please check the use cases so we add the right amount of logic here.
Sep 23 2025
Sep 21 2025
Sep 20 2025
Sep 16 2025
Sep 15 2025
Sep 14 2025
Aug 28 2025
It seems reasonable to me to use .profile and other files from root's home directory in single user mode as well. Having no .profile at all in single user mode would be bad. I don't think special logic in pkg for hard links is worth it for this particular special case.
Aug 12 2025
Jul 8 2025
Mar 8 2025
Mar 4 2025
This adds a non-POSIX feature (although it is pretty common); is the goal to make sh a mostly feature-complete alternative to bash?
Feb 22 2025
Jun 7 2024
Given that set -e is a controversial issue (see the disagreement here and in the "Conclusions" section of https://mywiki.wooledge.org/BashFAQ/105 ), I don't think the man page should recommend anything about it, although it should mention some pitfalls in a neutral manner.
May 4 2024
The immediately preceding sentence about shell functions is an example of unexpected behaviour of set -e. The part "all commands of the function are considered to be tested as well" may result in code unexpectedly executing in the function and the function returning a different return status.
Dec 1 2023
Nov 20 2023
Nov 17 2023
Nov 14 2023
This looks like a reasonable quick fix, but I think it's unfortunate the /root directory permissions are specified both in bsd.dirs.mk variables and in the BSD.root.dist mtree file. It looks like the bsd.dirs.mk variables are required because of pkgbase.
Jul 4 2023
Jun 8 2023
Jun 4 2023
I agree with the analysis, but the variables should still be defined inside main (with static) so they cannot be used outside. Some of the other functions in this file have their own smark locals that should not be mixed up with main's.
Jun 3 2023
To me, it looks like that situation can't actually happen. If there is an error or SIGINT during early initialization, state will still be 0 and the if (setjmp(main_handler.loc)) block will immediately call exitshell(exitstatus) without touching smark. If I'm wrong, please provide a reproduction scenario.
Apr 28 2023
Apr 27 2023
This doesn't follow the Don't Repeat Yourself principle, but currently I don't have a better idea how to express this code.
Jan 5 2023
Jan 1 2023
Code is OK like this.
Dec 22 2022
Dec 18 2022
Dec 14 2022
Adding support for escape sequences might make it important to increase PROMPTLEN.
Dec 11 2022
Dec 7 2022
How do other shells with a similar option handle this? For example, zsh has a TRAPS_ASYNC option, but does not document how to access the interrupted job in the trap action.
Oct 23 2022
In hindsight, this is how it should have been in the first place, since it's the same thing Linux distributions do. They (used to?) place *.csh files too for sourcing from /etc/csh.login.
Sep 27 2022
Since a similar effect can be obtained by having the shell ignore the signal via trap '' TTOU, I'm not sure it's a good idea to add an option for this.
