Page MenuHomeFreeBSD

jilles (Jilles Tjoelker)
User

Projects

User Details

User Since
May 14 2014, 7:55 PM (595 w, 5 d)

Recent Activity

Tue, Sep 23

jilles committed rGca771d7ae527: init: Use root's home directory in single-user mode (authored by jilles).
init: Use root's home directory in single-user mode
Tue, Sep 23, 9:39 PM

Sun, Sep 21

jilles added inline comments to D52596: nanobsd: minor formatting cleanup.
Sun, Sep 21, 3:31 PM

Sat, Sep 20

jilles accepted D52161: sh: Remove /.profile.
Sat, Sep 20, 1:54 PM

Tue, Sep 16

jilles committed rG779812d66989: init: Use root's home directory in single-user mode (authored by jilles).
init: Use root's home directory in single-user mode
Tue, Sep 16, 8:42 PM
jilles closed D52527: init: Use root's home directory in single-user mode.
Tue, Sep 16, 8:42 PM

Mon, Sep 15

jilles added a comment to D52527: init: Use root's home directory in single-user mode.

I did wonder for a second if the /rescue variants of shells do or should assume setugid behavior and avoid loading dotfiles in case something in the profile or other bits finds a way to make the shell unusable, but I didn't really convince myself.

Mon, Sep 15, 10:00 PM

Sun, Sep 14

jilles requested review of D52527: init: Use root's home directory in single-user mode.
Sun, Sep 14, 10:08 PM

Aug 28 2025

jilles added a comment to D52161: sh: Remove /.profile.

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 28 2025, 7:50 PM
jilles accepted D52162: sh, csh: Add config tag to profile scripts in /.
Aug 28 2025, 3:13 PM

Aug 12 2025

jilles committed rG01bb889cc1b1: wordexp(3): Handle ECHILD from waitpid (authored by Kenny Levinsen <kl@kl.wtf>).
wordexp(3): Handle ECHILD from waitpid
Aug 12 2025, 9:21 PM
jilles committed rG5c37f7d22fa7: wordexp(3): Handle ECHILD from waitpid (authored by Kenny Levinsen <kl@kl.wtf>).
wordexp(3): Handle ECHILD from waitpid
Aug 12 2025, 9:20 PM

Jul 8 2025

jilles committed rGda9e73e5d483: wordexp(3): Handle ECHILD from waitpid (authored by Kenny Levinsen <kl@kl.wtf>).
wordexp(3): Handle ECHILD from waitpid
Jul 8 2025, 9:39 PM

Mar 8 2025

jilles added a comment to D49201: [WIP] sh: implement non-nested brace expansion.

This adds a non-POSIX feature (although it is pretty common); is the goal to make sh a mostly feature-complete alternative to bash?

Mar 8 2025, 3:13 PM

Mar 4 2025

jilles added a comment to D49201: [WIP] sh: implement non-nested brace expansion.

This adds a non-POSIX feature (although it is pretty common); is the goal to make sh a mostly feature-complete alternative to bash?

Mar 4 2025, 3:48 PM

Feb 22 2025

jilles added inline comments to D49106: sh.1: wordsmith the section about getopts.
Feb 22 2025, 5:32 PM

Jun 7 2024

jilles added a comment to D45073: sh(1): Replace recommendation of use of -e with a note.

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.

Jun 7 2024, 8:33 PM

May 4 2024

jilles added a comment to D45073: sh(1): Replace recommendation of use of -e with a note.

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.

May 4 2024, 1:23 PM

Dec 1 2023

jilles added inline comments to D38138: find: Add GNU find's -printf.
Dec 1 2023, 3:01 PM

Nov 20 2023

jilles added inline comments to D42667: find: implement -fprint and -fprint0.
Nov 20 2023, 11:02 PM

Nov 17 2023

jilles accepted D42621: aio_read.2: correct the description of aio_buf.
Nov 17 2023, 10:21 PM

Nov 14 2023

jilles accepted D42395: Fix /root permissions after 'make installworld'.

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.

Nov 14 2023, 10:06 PM

Jul 4 2023

jilles added inline comments to D40619: sh: auto-complete functions and aliases.
Jul 4 2023, 9:38 PM

Jun 8 2023

jilles committed rG2178e8c27aad: sh: make smark a static variable instead of a local in main() (authored by daniel_octaforge.org).
sh: make smark a static variable instead of a local in main()
Jun 8 2023, 9:04 PM
jilles closed D40415: sh(1): make smark a static variable instead of a local in main().
Jun 8 2023, 9:03 PM

Jun 4 2023

jilles accepted D40415: sh(1): make smark a static variable instead of a local in main().
Jun 4 2023, 8:17 PM
jilles added a comment to D40415: sh(1): make smark a static variable instead of a local in main().

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 4 2023, 2:04 PM

Jun 3 2023

jilles added a comment to D40413: sh(1): initialize smark to zero in main().

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.

Jun 3 2023, 8:51 PM

Apr 28 2023

jilles accepted D39839: sh: also auto-complete built-ins.
Apr 28 2023, 9:15 PM

Apr 27 2023

jilles added a comment to D39839: sh: also auto-complete built-ins.

This doesn't follow the Don't Repeat Yourself principle, but currently I don't have a better idea how to express this code.

Apr 27 2023, 8:02 PM
jilles added inline comments to D36594: Document library types in the intro(3) manual page.
Apr 27 2023, 7:56 PM

Jan 5 2023

jilles accepted D37926: sh: reindent a for loop in parser.c.
Jan 5 2023, 8:34 PM

Jan 1 2023

jilles added a comment to D35840: sh: implement PS1 \D to print current time.

Code is OK like this.

Jan 1 2023, 6:12 PM

Dec 22 2022

jilles accepted D37701: sh: Allow an ASCII ESC in PS.
Dec 22 2022, 2:48 PM

Dec 18 2022

jilles requested changes to D37701: sh: Allow an ASCII ESC in PS.
Dec 18 2022, 9:04 PM

Dec 14 2022

jilles requested changes to D37701: sh: Allow an ASCII ESC in PS.

Adding support for escape sequences might make it important to increase PROMPTLEN.

Dec 14 2022, 5:06 PM

Dec 11 2022

jilles added a comment to D37620: bin/sh: set $! to last foreground job pid on trap.

Thanks for the hint. kill %+ and jobs -p %+ are already working. So, no patch required. Might be a good idea to mention it in the man page.

Dec 11 2022, 10:42 PM

Dec 7 2022

jilles added a comment to D37620: bin/sh: set $! to last foreground job pid on trap.

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.

Dec 7 2022, 9:19 PM

Oct 23 2022

jilles added a comment to D37034: sh: when loading profile, read only .sh files..

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.

Oct 23 2022, 7:04 PM

Sep 27 2022

jilles added a comment to D36745: stty(1): provide details about interaction with job control.

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.

Sep 27 2022, 9:22 PM
jilles accepted D36505: sh: read more profile files..
Sep 27 2022, 8:51 PM
jilles accepted D36760: sh: Fix mismatch in array bounds for vforkexecshell()..

Fine with me to add this to make some compiler/linter happy, even though non-static array bounds in parameters don't really do anything.

Sep 27 2022, 8:50 PM

Sep 25 2022

jilles added inline comments to D36594: Document library types in the intro(3) manual page.
Sep 25 2022, 1:48 PM

Sep 9 2022

jilles added a comment to D36505: sh: read more profile files..

Oh, the unset obviously defeats the purpose. Defending against someone copying /etc/profile to /usr/local/etc/profile without leaving stray variables in the user's environment is a little harder.

Sep 9 2022, 3:47 PM
jilles requested changes to D36505: sh: read more profile files..
Sep 9 2022, 3:02 PM

Aug 19 2022

jilles accepted D35836: sh: accept fc options grouped behind one '-'.

@jilles is this patch in a good shape now?

Aug 19 2022, 8:40 PM

Aug 4 2022

jilles added inline comments to D35836: sh: accept fc options grouped behind one '-'.
Aug 4 2022, 12:29 PM

Jul 23 2022

jilles added a comment to D35836: sh: accept fc options grouped behind one '-'.

This should have testcases.

Jul 23 2022, 11:51 AM

Jul 22 2022

jilles accepted D35876: sh: nullify ENV in tests.

Thanks, I have also encountered this issue.

Jul 22 2022, 8:47 AM

Jul 19 2022

jilles added inline comments to D35840: sh: implement PS1 \D to print current time.
Jul 19 2022, 9:19 PM
jilles added a comment to D35840: sh: implement PS1 \D to print current time.

In a way, this has nothing to do with bash. I want sh PS4 to be able to generate some kind of timestamps when executing a script with tracing on. The way bash does it is just a convention which I think is not worth diverging from.

Jul 19 2022, 9:16 PM

Jul 18 2022

jilles added inline comments to D35588: bsdinstall: allow setting the root password via env variables.
Jul 18 2022, 9:12 PM
jilles requested changes to D35840: sh: implement PS1 \D to print current time.

A little unfortunate to have these strange backslash sequences spread out further, but it's nothing that bash doesn't do.

Jul 18 2022, 9:05 PM

Jun 12 2022

jilles committed rG5dd1f6f14416: utimensat(2): Remove description of compatibility code (authored by pluknet).
utimensat(2): Remove description of compatibility code
Jun 12 2022, 9:10 PM

May 26 2022

jilles accepted D35275: zdiff: avoid non-conformant features.
May 26 2022, 4:35 PM

May 21 2022

jilles requested changes to D35275: zdiff: avoid non-conformant features.
May 21 2022, 1:37 PM

Apr 20 2022

jilles accepted D34985: Fix sigtimedwait manpage..
Apr 20 2022, 10:11 PM
jilles added a comment to D34985: Fix sigtimedwait manpage..

POSIX indeed leaves this behavior unspecified, but Linux chooses the same as we do. Might want to add something like

POSIX leaves the behavior of
.Fn sigtimedwait
with a
.Dv NULL
.Fa timeout
pointer unspecified.

to the STANDARDS section.

Apr 20 2022, 8:21 PM

Apr 10 2022

jilles accepted D34751: time(3): Update the HISTORY section.
Apr 10 2022, 8:34 PM

Apr 3 2022

jilles accepted D34751: time(3): Update the HISTORY section.
Apr 3 2022, 2:00 PM

Apr 2 2022

jilles added inline comments to D34751: time(3): Update the HISTORY section.
Apr 2 2022, 6:43 PM

Mar 27 2022

jilles accepted D34544: sh: fix autocompletion for commands that share name with a directory.
Mar 27 2022, 8:55 PM

Mar 14 2022

jilles added inline comments to D34544: sh: fix autocompletion for commands that share name with a directory.
Mar 14 2022, 11:00 PM

Mar 13 2022

jilles requested changes to D34544: sh: fix autocompletion for commands that share name with a directory.
Mar 13 2022, 6:21 PM

Mar 9 2022

jilles accepted D34474: dumpon: use underlying device if encrypted swap is in use.
Mar 9 2022, 10:35 PM

Mar 8 2022

jilles added inline comments to D34474: dumpon: use underlying device if encrypted swap is in use.
Mar 8 2022, 8:48 PM

Feb 11 2022

jilles added inline comments to D34202: Search for objective c method definitions.
Feb 11 2022, 9:50 PM

Jan 26 2022

jilles committed rG5a1a07f2a0e1: sh: Don't add something to a null pointer (authored by jilles).
sh: Don't add something to a null pointer
Jan 26 2022, 10:19 PM
jilles closed D34011: sh: Don't add something to a null pointer.
Jan 26 2022, 10:18 PM
jilles added a comment to D21939: Enter chroot before looking up user or group to change to.

Interestingly, chroot() no longer requires root privileges. Does that change things here?

Jan 26 2022, 10:03 PM

Jan 23 2022

jilles requested review of D34011: sh: Don't add something to a null pointer.
Jan 23 2022, 9:28 PM

Jan 14 2022

jilles added inline comments to D33248: Optionally deliver SIGCAP on capsicum violations..
Jan 14 2022, 2:15 PM

Oct 27 2021

jilles committed rG72f750dc7c73: sh: Fix heredoc at certain places in case and for (authored by jilles).
sh: Fix heredoc at certain places in case and for
Oct 27 2021, 7:34 PM
jilles closed D32628: sh: Fix heredoc at certain places in case and for.
Oct 27 2021, 7:34 PM

Oct 26 2021

jilles added inline comments to D32628: sh: Fix heredoc at certain places in case and for.
Oct 26 2021, 10:05 PM

Oct 24 2021

jilles requested review of D32628: sh: Fix heredoc at certain places in case and for.
Oct 24 2021, 9:57 PM
jilles accepted D27003: sh: Set PATH envvar after setting HOME in dotfile.
Oct 24 2021, 9:51 PM

Oct 5 2021

jilles added inline comments to D32128: Add support for sysctl.conf.d.
Oct 5 2021, 9:59 PM · rc

Oct 1 2021

jilles added inline comments to D32243: Improve documentation for pthread mutex attributes; describe internals and quirks of the private and process-shared locks.
Oct 1 2021, 8:39 PM

Sep 22 2021

jilles added a comment to D32063: man: reset OPTIND after parsing args.

I agree that OPTIND=1 is needed, but I have another reason for it. POSIX requires that a script set OPTIND=1 between using different sets of parameters with getopts; otherwise, the results are unspecified.

Sep 22 2021, 9:01 PM
jilles accepted D30464: sh: Add -o verify to use O_VERIFY when sourcing scripts.

OK. Thanks for the reminder.

Sep 22 2021, 8:42 PM

Sep 17 2021

jilles accepted D31876: read builtin: Empty variables on timeout.
Sep 17 2021, 3:27 PM

Sep 8 2021

jilles added a comment to D31876: read builtin: Empty variables on timeout.

This is more consistent, and probably more useful (while read loops tend not to treat EOF and read errors differently).

Sep 8 2021, 10:46 PM

Aug 28 2021

jilles accepted D31706: sh: improve emacs mode.
Aug 28 2021, 2:06 PM
jilles added a comment to D31706: sh: improve emacs mode.

OK, but perhaps this fix should be in libedit instead. The same issue can be seen in other libedit clients such as ftp(1).

Aug 28 2021, 1:09 PM

Jul 25 2021

jilles committed rG0c47338023d4: libc/tests: Correctly compare si_status from wait6() (authored by jilles).
libc/tests: Correctly compare si_status from wait6()
Jul 25 2021, 8:21 PM

Jul 10 2021

jilles added a comment to D31133: Add a pdvfork system call..

This functionality clearly fills a gap, but the provided interface is too low level for applications to call. The code in lib/libc/gen/posix_spawn.c uses various non-standard facilities to handle things like signals correctly. Depending on how this is planned to be used, additional libc code may be useful, but it need not be part of this review.

Jul 10 2021, 9:40 PM

Jun 20 2021

jilles added inline comments to D30614: xinstall: fix invocation of llvm-strip.
Jun 20 2021, 10:42 PM

Jun 11 2021

jilles added a comment to D30464: sh: Add -o verify to use O_VERIFY when sourcing scripts.

Looks reasonable, assuming veriexec itself is reasonable (in many cases, it seems to me that verifying the root filesystem would be a simpler and more reliable approach).

Jun 11 2021, 3:15 PM

Jun 8 2021

jilles requested changes to D30614: xinstall: fix invocation of llvm-strip.
Jun 8 2021, 9:22 PM

Jun 2 2021

jilles added a comment to D30614: xinstall: fix invocation of llvm-strip.

The -- was added so that source pathnames starting with - would not break. I guess destination pathnames starting with - already did not work before D25551, so that was not a regression. This could be fixed differently by prepending ./ if the name starts with -.

Jun 2 2021, 7:33 PM

May 30 2021

jilles accepted D30498: Fix syscall kld example.

As this is a small fix to the EXAMPLE, is it necessary to bump .Dd at commit time?

May 30 2021, 7:34 PM

May 29 2021

jilles added inline comments to D30498: Fix syscall kld example.
May 29 2021, 7:01 PM
jilles accepted D30464: sh: Add -o verify to use O_VERIFY when sourcing scripts.

Looks reasonable, assuming veriexec itself is reasonable (in many cases, it seems to me that verifying the root filesystem would be a simpler and more reliable approach).

May 29 2021, 4:49 PM

May 18 2021

jilles added a comment to D30330: rc.conf(5): Add _limits, _login_class, and _oomprotect.

Unfortunately, some ports like PostgreSQL redefine start_cmd which would make _oomprotect="ALL" silently not work for the database. I am not sure where it would be a good place, but I think it would be worthwhile to document that redefining ${name}_cmd has such a pitfall.

May 18 2021, 9:42 PM

May 12 2021

jilles added a comment to D30188: [patch] syslog.3 - LOG_PID cannot be disabled.

The comment is correct. LOG_PID has no effect and the process ID is always included. This change was made along with the move from RFC 3164 to RFC 5424 log messages.

May 12 2021, 8:26 PM

May 6 2021

jilles accepted D29493: sh: implement persistent history storage.

Some people may get negatively surprised if they first encounter this change in a git update. A post to -current@ and Relnotes: yes are probably a good idea.

May 6 2021, 8:41 PM

May 4 2021

jilles added a comment to D29960: ptrace: document ENOMEM.

I like it better if EFAULT is reserved as much as possible to the case where a syscall argument points to an invalid memory location for the calling process, which is undefined behaviour according to POSIX and other standards and often behaves poorly (for example, completing an operation but discarding the result). If the address in the target process passed to PT_READ_I is invalid, this is fully defined and may not be fully avoidable (for example if the traced process is running concurrently).

May 4 2021, 7:45 PM

May 2 2021

jilles requested changes to D29493: sh: implement persistent history storage.
May 2 2021, 6:40 PM
jilles added a comment to D29493: sh: implement persistent history storage.

There should be documentation about this in the man page.

May 2 2021, 6:40 PM

Mar 30 2021

jilles requested changes to D29493: sh: implement persistent history storage.
In D29493#661261, @bapt wrote:

@jilles do you think we should add an option to disable the load and save so people willing to have a giant history while not suffering from the load/save can do it? if yes do you have any options to suggest?

Mar 30 2021, 10:38 PM