Commit Briefs

0e324bf209 Stefan Sperling

support special example configs not found in /etc/examples/ (special-examplecfg)

Read configs for sshd(8) and smtpd(8) from the live system. These programs are run by default and have no file in the /etc/examples/ directory. Use /etc/npppd/npppd.conf as a fallback if no example is found in /etc/examples. We hope to move npppd.conf to the examples directory in the future. Generate an /etc/motd example with contents as seen after a fresh installation of OpenBSD.


330fe27c7f Stefan Sperling

add nshdoas to fix the 'enable' command when stdin is not a TTY

nshdoas is based on doas(1). It reads /etc/doas.conf and asks for the root password in case no matching rule exists. This avoids the need to fall back on su(1) and makes it possible to use the 'enable' command when sending nsh commands on standard input. ok Tom


05ca4b38cd Stefan Sperling

allow nsh to change its behaviour when standard input is not a TTY

Introduce an 'interactive_mode' flag which indicates whether standard input is a TTY. This allows nsh to accept commands on standard input for scripting purposes. This will be needed for better integration of at(1). The 'enable' command will not work in non-interactive mode yet. This will be fixed soon. ok tom


662852943e Stefan Sperling

make ~/.nshrc unreadable for group/others

Suggested by Tom


9249dbee79 Stefan Sperling

add a 'saveenv' command

The saveenv command stores environment variables set by setenv in ~/.nshenv. ok + additional testing tom


79415f5117 Stefan Sperling

add a hash table implementation

ok tom


444134c06c Stefan Sperling

add cmdargs_output_setenv; will be needed for future work

ok tom


f6eb52baa9 GitHub

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


e071ad386d GitHub

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; }


87295e3641 GitHub

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


Branches

Tags

Tree

.gitignorecommits | blame
COPYRIGHTcommits | blame
Makefilecommits | blame
READMEcommits | blame
arp.ccommits | blame
bgpcommands.ccommits | blame
bgpnsh/
bridge.ccommits | blame
bridge.hcommits | blame
carp.ccommits | blame
cmdargs.ccommits | blame
commands.ccommits | blame
commands.hcommits | blame
compile.shcommits | blame
complete.ccommits | blame
conf.ccommits | blame
ctl.ccommits | blame
ctl.hcommits | blame
ctlargs.ccommits | blame
editing.hcommits | blame
externs.hcommits | blame
genget.ccommits | blame
hashtable.ccommits | blame
helpcommands.ccommits | blame
ieee80211.ccommits | blame
if.ccommits | blame
ip.hcommits | blame
kroute.ccommits | blame
main.ccommits | blame
makeargv.ccommits | blame
media.ccommits | blame
more.ccommits | blame
nameserver.ccommits | blame
ndp.ccommits | blame
nopt.ccommits | blame
nsh-dist.txtcommits | blame
nsh-scripts/
nsh-version.mkcommits | blame
nsh.8commits | blame
nshdoas/
passwd.ccommits | blame
pflow.ccommits | blame
pfsync.ccommits | blame
ppp.ccommits | blame
prompt.ccommits | blame
route.ccommits | blame
save-ro.sh*commits | blame
save-rw.sh*commits | blame
show.ccommits | blame
sqlite3.ccommits | blame
stats.ccommits | blame
stringlist.ccommits | blame
stringlist.hcommits | blame
sysctl.ccommits | blame
sysctl.hcommits | blame
test/
trunk.ccommits | blame
tunnel.ccommits | blame
umb.ccommits | blame
utf8.ccommits | blame
utils.ccommits | blame
version.ccommits | blame
wg.ccommits | blame
who.ccommits | blame

README

nsh//network config shell//Chris Cappuccio <chris@nmedia.net> version 1.1

NSH is a CLI intended for OpenBSD-based network appliances. It replaces
ifconfig, sysctl and route with its own simple command language, and
encapsulates configuration for other daemons into one place, effectively
replacing /etc/netstart and parts of /etc/rc for appliance-style usage.

Daemons and services encapsulated by nsh:

bgpd, dhcpd, dhcpleased, dhcrelay, dvmrpd, eigrpd, ftp-proxy, ifstated, inetd, 
iked, ipsecctl, ldapd, ldpd, npppd, ntpd, ospfd, ospf6d, pf, rad, relayd, 
resolvd, ripd, sasyncd, slaacd, smtpd, snmpd, sshd, tftpd, tftp-proxy.

NSH is freely licensed, in the BSD style.

In conjunction with the OpenBSD kernel and the daemons you wish to control,
you have a fully functioning system.

See https://github.com/yellowman/nsh/wiki/NSH-Manual-page or 
nsh.8 manual for installation instructons and command set.

See the Todo list on https://github.com/users/yellowman/projects/1 for 
details on implementation status and future ideas.

See http://github.com/yellowman/nsh/ for current source code repository.
See http://www.nmedia.net/nsh/ for example configurations and mailing
list.

See https://www.youtube.com/watch?v=WMKxIHaWaG0 for an EurobsdCon 2022 
Presentation on NSH for network administrators.