Commits
- Commit:
4267117b60d80255740be96d5077585dc6fca353
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add commands to control syslogd
Currently supported syslog commands:
syslog
no syslog
syslog reload
syslog udp-af inet4
syslog udp-af inet6
- Commit:
444134c06cbc0ad8b7366aba187ea98566b758a5
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add cmdargs_output_setenv; will be needed for future work
ok tom
- Commit:
f6eb52baa944180134f8d515007da159090fa5d2
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
BUG-FIX Update sysctl.c to fix no ip ipsec-pfs command bug
Update sysctl.c to fix no ip ipsec-pfs command bug
ip ipsec-pfs
and
no ipipsec-pfs
were broken and not having an effect on
the
net.inet.ip.ipsec-pfs
- Commit:
e071ad386d88cfe4c5303487dabdbbac64e3ddcd
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Update stats.c to fix mbuf prints (compatibility broken due to changes in base)
Stefan@ reviewed
On Sun, Aug 06, 2023 at 11:20:07PM +0100, Tom Smyth wrote:
> Folks,
>
> I was trying to test the functions I was proposing to edit and I got the
> following warning
>
> nsh(p)/sho kernel mbuf
> % mbpr: unexpected change to mbstat; check source
>
> This issue occurs before and after made changes to get rid of the warning
We will need the tweak below to fix this issue.
This tweak is coming from the bottom of
https://gothub.org/?action=diff&commit=cea35e798e12953fe0c2bf514e802d209589bc05&path=src.git
which is another diff by yasuoka related to resizing mbstat.m_mtypes.
diff /home/stsp/src/nsh
commit - 574d5c2d6a16ae5600d65fedc157d03e7fcfdd43
path + /home/stsp/src/nsh
blob - 8fc7ec538398cea9a0d4e2a87d378caf25b7ab6f
file + stats.c
--- stats.c
+++ stats.c
@@ -782,7 +782,7 @@ mbpr(void)
memset(&seen, 0, sizeof(seen));
- if (nmbtypes != 256) {
+ if (nmbtypes != MBSTAT_COUNT) {
printf("%% mbpr: unexpected change to mbstat; check source\n");
return;
}
- Commit:
87295e3641fd4f47c78cbf982106f5df37fd706c
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Update stats.c to fix format types due to changes in 7.3+ current
Peer reviewed by Stefan@
On Sun, Aug 06, 2023 at 09:25:23PM +0100, Tom Smyth wrote:
> Does the following diff make sense ... ti does get rid of the compiler
> warnings.. but I wanted to be certain...
>
> tobsd# diff nsh1.2.4/nsh/stats.c nsh1.2.2/nsh/stats.c
> 855c855
> < printf("\t\t%u mbuf%s allocated to %s\n",
> ---
> > printf("\t\t%ld mbuf%s allocated to %s\n",
> 863c863
> < printf("\t\t%u mbuf%s allocated to <mbuf type %d>\n",
> ---
> > printf("\t\t%ld mbuf%s allocated to <mbuf type %d>\n"
These %u should be changed to %lu, not %ld. Then this fix is OK.
The same %u -> %lu change was made in yasuoka's diff for OpenBSD netstat:
https://gothub.org/?action=diff&commit=032e1cec45baf26f9fcab0835526606daebe822f&headref=HEAD&path=src.git
- Commit:
41499e1536a5972223b1e902fad04b7f5f451935
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Update stats.c compiler warnings
diff nsh1.2.4/nsh/stats.c nsh1.2.2/nsh/stats.c
> 781c781
> < int nmbtypes = sizeof(mbstat.m_mtypes) / sizeof(short);
> ---
> > int nmbtypes = sizeof(mbstat.m_mtypes) / sizeof(long);
Your fix is correct.
I would prefer an alternative fix which infers the size of array
elements via the sizeof(array[0]) idiom:
int nmbtypes = sizeof(mbstat.m_mtypes) / sizeof(mbstat.m_mtypes[0]);
The above expression will remain correct regardless of any future element
size changes.
And since other nsh code is already using the OpenBSD-specific nitems()
macro, which is a shorthand for the above idiom, we might as well use it
to write the above expression in a more readable way:
- Commit:
a0faec76c1ca1d5e829f04d65b45b8c9d032383a
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
important regression fix: do not truncate config files in /etc
Tom Smyth found during testing that when editing config files via the
"edit" ctl commands we would always truncate existing files in /etc.
And thus always see an empty file to load an example for.
Fix this by passing the correct mode to fopen(): a+ instead of w+
Committing right now to prevent data loss. People running nsh built
from the previous commit 574d5c2d6a16ae5600d65fedc157d03e7fcfdd43
should update.
- Commit:
574d5c2d6a16ae5600d65fedc157d03e7fcfdd43
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fill empty configuration files with an example config from /etc/examples
If the user begins editing an empty file which corresponds to a file
in the /etc/examples directory offer to load this example for editing.
Suggested by Tom Smyth.
ok tom, chris
- Commit:
cec4f8ceccb53f3f5297c9958b59c82a51a8e27c
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
leave pf processing of rc(8) enabled in integration script
Otherwise pfctl -e will never be run during boot, leaving pf
disabled by default.
- Commit:
e84a83799e9828f1fe70428efafe33402a7572e8
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Merge pull request #139 from stspdotname/env
add 'show environment', 'setenv', and 'unsetenv' commands
- Commit:
660067642dc57bd5820285c195ed5f240475319a
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add 'show environment', 'setenv', and 'unsetenv' commands
Being able to manage environment variables from within nsh will
be useful, especially if nsh is used as a login shell because
nsh's environment is visible to other commands run by nsh.
Setting variables can now affect the behaviour of nsh itself.
For example, it is possible to set NSH_MANUAL_PAGE from within a running nsh
session and the new value will immediately be used by the 'manual' command.
This particular variable is only useful to nsh developers themselves but the
same mechanism could be used for user-facing variables in the future.
If 'show environment' is run without further arguments all variables
will be displayed. Otherwise the value of the specified variable will
be displayed if the variable exists.
All commands support tab-completion for names which already exist in
the environment. The 'setenv' commands appends "=" if the name being
completed does not yet exist in the environment.
- Commit:
2d331b3f3d70a5e5bf1362ff9e23627f0ca15288
- From:
- Chris Cappuccio <chris@nmedia.net>
- Via:
- GitHub <noreply@github.com>
- Date:
Merge pull request #138 from stspdotname/cron
add crontab commands: show crontab, crontab edit, crontab install
- Commit:
d84619f38238a58126adf8d62870c7fc8593aca5
- From:
- chris <chris@nmedia.net>
- Date:
wgpeer description
ok stsp@
- Commit:
231579be3d457828eda9b86c4aa337062aceceee
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add a "scheduler" alias for the "crontab" commands; suggested by Tom
- Commit:
5cf29cab5266a19a1f3d44579672baadfc31e711
- From:
- chris <chris@nmedia.net>
- Date:
Remove ndp repeat (unused)
ok stsp@
- Commit:
a514ecfd177a7e0843b548370bc8cd608e2d3ecc
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add crontab commands: show crontab, crontab edit, crontab install
For now, display and edit the crontab file of the root user only.
The "show crontab" command displays the root user's crontab as shown
by the crontab -l command.
Editing is implemented via a new CTL handler which knows about the
semantics of the crontab(1) command.
If an NSH configuration contains crontab rules then the "crontab install"
command appears in the running-config in order to install the crontab
file managed by nsh to the system with crontab(1).
- Commit:
015e4f4fbea6473a68e4556b811f26161299464b
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix section number of references to bgplgsh(8) in bgpnsh man page
- Commit:
dbd13edec17dc895e68a1e8540827b7ce25f76a5
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix section number displayed in the bgpnsh man page
- Commit:
e1055a045b2f171c35afcb624845edf0c44d38b0
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
backout previous: the bgpnsh manual page belongs in manual section 1
Tom suggests sticking to section 8; I overlooked that bgplgsh is in section 8
- Commit:
4bd0390c2407d8dea0e573eab09dab255b0fb5d4
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
the bgpnsh manual page belongs in manual section 1
- Commit:
c68848fc55b00204ca1776be1f41f30a7b34a358
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
point readers at Section 7 from the enable command section
- Commit:
eeb7412e12bc3415f0a66b5c6c991ec0324b57a8
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
document new behaviour of the enable commmand
- Commit:
6be5baa37f70382742870a86df8a8678e5cb87cc
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
man page cleanup in the section which explains the various shell prompts
- Commit:
e5955f9ed50507ad2079f6ce70ac3d563beba20a
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix a typo I put into the man page
- Commit:
8a89202652d254bba81e5e269ff7393ac2d14736
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
man page updates related to the new -e re-exec feature