Commits
- Commit:
90fedfb73083b2f7c1e18269ee044c0f3098cfa9
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add support for backing up and restoring every user's ~/.nshenv
Include data from users' ~/.nshenv in show running-config and write-config.
Add nshenv and restoreenv commands which handle saving and restoring.
These commands are not supposed to be user-facing. Their only purpose
is to preserve data during write-config and restore it during nsh -i.
During restore we take care not to overwrite existing ~/.nshenv files.
The purpose of this feature is to restore ~/.nshenv files which
were lost during a disaster. If the user has already saved new settings
then we can just leave them as they are.
- Commit:
eb5d12f955f3d56f05ad6ec160eba2786b113dd8
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix sqlite API error handling
- call sqlite3_errmsg(db) before closing the db, not after
- sqlite3_errmsg() can only be used when sqlite3_step() returns SQLITE_ERROR
- check for errors from sqlite3_finalize()
- close db handle even when an error occurred during sqlite3_open()
with suggestions from chris
testing + ok tom
- Commit:
dd054fead9185c4e49b5985abed6b555cd29ecbe
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
Fix dhcpd handling with respect to rdoamins
Run dhcpd in the correct rdomain when rdomain is != 0 and start dhcpd with
a list of interfaces on its command line. All interfaces must be in the
same rdomain; dhcpd will then set its own rdomain accordingly.
Use a separate DHCP lease database per rdomain just in case a given MAC
and IP tuple appears in multiple rdomains.
earlier version ok + testing by Tom
- Commit:
85c6a750079d9a9f6d6d41f565f5eaaa6e11144c
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
allow T_HANDLER to process any number of arguments between 0 and 6
This way we can write handlers that accept all arguments listed in their
ctl table as actual arguments, rather than passing unused parameters which
contain ununitialized garbage.
The benefit is better clarity about the expected values of arguments passed
on by handler functions. Adjust motd and crontab handlers accordingly which
use T_HANDLER. All instances of call_editor() now use T_HANDLER_FILL1.
ok chris
- Commit:
b99c9f3f176c3755b6d2490580abcd61931231bf
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix conversion of struct ctl2->table to struct ctl->table
The old code would only convert the first command table entry to a
dummy struct ctl sitting on the stack. This confuses code which loops
over the command table and requires a sentinel to break out of this loop.
Segfault found by Tom
- Commit:
51640dae4f57867a9261104ee4618d43a1e3ced6
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
detect ambiguous matches from genget on a ctl2 table
Cannot happen right now since the table has only one entry but better
be prepared for a future where we would crash otherwise.
- Commit:
8f5b5e45a980c2f2bf7106963a74aa8558469d7b
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
repair "write-config" command which broke with introduction of struct ctl2
Writing any changes to dhcp config was causing "genget internal failure".
Regression found by Tom.
- Commit:
0b2393c6d725b6b3d75b61dd387fce4836cf24db
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
always keep basic environment variables intact after 'enable' command
Make nshdoas preserve some important environment variables even when
there is no rule in /etc/doas.conf. Without a matching rule in doas.conf
we ended up running the privileged shell in an empty environment, which
leads to tools such as vi(4) erroring out for lack of a terminal type.
As before, the keepenv option in /etc/doas.conf can be used to preserve
the entire user environment.
We now preserve the following variables by default:
DOAS_USER=nsh # added by nshdoas
HOME=/root # overridden by nshdoas
LOGNAME=root # overridden by nshdoas
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin
SHELL=/usr/local/bin/nsh
TERM=xterm
USER=root # overridden by nshdoas
Problem noticed by Tom.
- Commit:
df1b71b4ffb08376e1c36576d0cb9ba9456cbeba
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
introduce struct ctl2 with backwards compat wrappers
The new struct avoids the necessity to cast configuration file test handler
arguments from char ** to a char *, such that the char ** pointer can be
stored in ctl->args[1].
Such shadowing of variable types results in code that is hard to follow.
We can convert daemons one-by-one to fully replace struct ctl eventually.
As an example, convert dhcpd handling to struct ctl2 already.
Ok tom, chris
- Commit:
e05df6135adc342714e1eb0aa52000db39b6010c
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Merge pull request #143 from smytht/master
Improve Readme by converting to markdown and adding a quick installation guide for nsh
- Commit:
46c96f53ccd68549c97b2d487e0c2ac9ee4fbd57
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Update README.md use email addresses proper
Update README.md use email addresses proper
- Commit:
5b66ac0b69d9684f9579c5cef44a1d4c41993249
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
backout previous dhcp rdomain commits
I forgot that these diffs only work correctly with the &fillargs
patch which has been backed out. This needs more work before it
can come back...
- Commit:
00e8db465653edc90186beafdf38e122b3b18cb5
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Update README.md fix typo
fix typo screen not scree
- Commit:
2d3516ed898463fd58314a74d781b842857315ed
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
use a separate DHCP lease database per rdomain
ok Tom
- Commit:
58ba5c905845bb208f71a354da42ad592c86c538
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Update README.md fix number formats
Update README.md fix number formats
- Commit:
0698bd5fd36695ee913ac16345bcaf7dc83d2dbf
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
run dhcpd in the correct rdomain when rdomain is != 0
test + ok Tom
- Commit:
a2ba468c5640c0aa0ebebf95784b7b1d27f8e60f
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Update README.md fix typos in and after section 7
Update README.md fix typos in and after section 7
- Commit:
edd6dd9f2f1c93acebcaaa1421088f724f9e7132
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Update and rename nsh-openbsd-integration.sh to extensive-nsh-openbsd-integration.sh
Add in extensive warnings to indicate this is a more invasive installation script, (for users who mainly want to manage systems with nsh) (moving config files for import not copying
to avoid confusion between which config files are the source of truth,
added in a write configuration command at end of nsh configuration to capture the config before reboot.
- Commit:
c64231097b881d6a690491f2d8a5346a82fabae6
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Update README.md to include the detail of requirements
Update README.md to include the detail of requirements for nsh to control the system
- Commit:
689678529a5a9e360548c12adcd6fafaf21e0877
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Update motd to explain how nsh has integrated with OpenBSD
add
- Commit:
740feb0c47c85a20acac2ed8a812efc6f3ee3e21
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
back out "fix bogus pointer being passed to fill_tmpfile() for T_HANDLER_FILL1"
This backs out commit 1bb61b1da84f5690f3125d4f6595b833632622b4:
The commit broke configuration file syntax checks. It triggeed errors
from exec since we were trying to exec a list of garbage arguments.
I misunderstood what the fillargs[1] pointer represents. Even though it
is a char * the value stored in case of FILLARGS1 is in fact a char *[].
- Commit:
fda8e7566fd711262851b9a88a1d44adc972b997
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Create rc.local-nsh-openbsd-integration.sh
rc.local based integration
script
rc.local-nsh-openbsd-integration.sh
- Commit:
b89991056cdba3650e3f4782b0a938b3c38116f9
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Update rc.local-nsh-openbsd-integrate.sh
Update script to copy config files not move them
so that the user can return to using OpenBSD and standard config more easily.
- Commit:
624653db0d50939833541cd881c457bcf09eb605
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
Merge pull request #1 from smytht/smytht-README.md
Update and rename README to README.md
- Commit:
13b060f0bd029db1742acb1f3722c05cf079f2b1
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
when an exec() call fails then show which command nsh was trying to run