Page MenuHomeFreeBSD

jilles (Jilles Tjoelker)
User

Projects

User Details

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

Recent Activity

Jun 7 2024

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

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): Improve recommendation of use of -e.

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
jilles accepted D29494: sh: improve emacs mode.

Note that this can still be overridden via $EDITRC, ~/.editrc or a bind command after set -o emacs.

Mar 30 2021, 9:22 PM
jilles requested changes to D29493: sh: implement persistent history storage.

Another nice feature, but I expect that making it good enough to replace bigger shells will take more work. For example, the save-all/load-all approach may be rather slow with the number of history entries I personally like to keep.

Mar 30 2021, 9:18 PM

Mar 21 2021

jilles added a comment to D29361: sh(1): autocomplete commands.

Nice feature.

Mar 21 2021, 11:12 PM

Mar 11 2021

jilles requested changes to D29212: sh: add the -S flag, to call setsid() when forking subshells.

Perhaps it makes more sense to implement this as a separate program that performs setsid() and then execvp(). This is a bit like daemon, but not quite, since daemon also forks and makes it hard to track the child process. As noted in the man page, sh tends not to implement many extensions. Extensions like set -o trapsasync and set -o pipefail are different from this one because they are hard to implement outside the shell or in a shell script. Of these, set -o pipefail is particularly simple to implement in the shell.

Mar 11 2021, 9:24 PM

Jan 30 2021

jilles committed rG3708b615c354: sh: Allow more scripts without #! (authored by jilles).
sh: Allow more scripts without #!
Jan 30 2021, 3:12 PM
jilles committed rG9b38ede3a347: sh: Test that executing various binary files is rejected (authored by jilles).
sh: Test that executing various binary files is rejected
Jan 30 2021, 3:12 PM
jilles committed rGc48240fa6f8e: sh/tests: Add a second kind of binary scripts without #! (authored by jilles).
sh/tests: Add a second kind of binary scripts without #!
Jan 30 2021, 3:12 PM

Jan 19 2021

jilles added a comment to D28240: Remove deadlock in rc caused by pwait waiting for itself.

This was reported before as https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218598 but I did not know for sure what to do so I left it alone. Since the patch is essentially the same, perhaps we should make this change. The wording of the error message in the patch in the PR seems a bit more formal, so better.

Jan 19 2021, 10:07 PM · rc

Jan 9 2021

jilles accepted D27871: Rework jobc handling..
Jan 9 2021, 7:50 PM
jilles added inline comments to D28068: Bump amount of queued packets in for unresolved ARP/NDP entries to 16..
Jan 9 2021, 7:49 PM

Jan 3 2021

jilles committed rG52981a1694be: sh/tests: Add a second kind of binary scripts without #! (authored by jilles).
sh/tests: Add a second kind of binary scripts without #!
Jan 3 2021, 10:54 PM

Dec 28 2020

jilles added inline comments to D27787: tcgetwinsize(3): man page.
Dec 28 2020, 9:39 PM

Dec 26 2020

jilles committed rGab41d7f371f5: sh: Explain duplicate tcsetpgrp() calls (authored by jilles).
sh: Explain duplicate tcsetpgrp() calls
Dec 26 2020, 3:02 PM

Dec 16 2020

jilles accepted D27623: strerror.3: Add an example for perror().
Dec 16 2020, 3:10 PM
jilles requested changes to D27628: err.3: Fix an example.
Dec 16 2020, 3:05 PM