aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/wg-quick/darwin.bash (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Revert "wg-quick: wait on process substitutions"Jason A. Donenfeld2020-08-271-14/+14
| | | | | | | | | | | | | | | | | | This reverts commit 26683f6c9ad18d9914b23312c221f27fd5ecab51, which means the old problem comes back. That's an issue. But waiting on process substitutions is not available with commonly used bash versions: # wg-quick up demo [#] ip link add demo type wireguard [#] wg setconf demo /dev/fd/63 /usr/bin/wg-quick: line 251: wait: pid 2955 is not a child of this shell [#] ip link delete dev demo This means we have to wait a few years before fixing this issue. IOW, bash limitation; can't fix. Reported-by: Theodore Mozzo <theodore.mozzo@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: wait on process substitutionsJason A. Donenfeld2020-08-061-14/+14
| | | | | | | | | Bash does not propagate error values, which is a bummer, but process substitutions are a useful feature. Introduce a new idiom to deal with this: either "; wait $!" after the line to propagate the error, or "|| true" to indicate explicitly that we don't care about the error. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: support dns search domainsJason A. Donenfeld2020-05-091-5/+25
| | | | | | | If DNS= has an IP in it, treat it as a DNS server. If DNS= has a non-IP in it, treat it as a DNS search domain. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: bump copyrightJason A. Donenfeld2020-01-021-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: support being called from launchdJason A. Donenfeld2019-06-241-1/+16
| | | | | | | | This causes wg-quick up to wait for the monitor to exit before it exits, so that launchd can correctly wait on it. Reported-by: Cameron Palmer <cameron@promon.no> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: make darwin and freebsd path search strict like linuxJason A. Donenfeld2019-04-231-1/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: add 'strip' subcommandLuis Ressel2019-03-231-1/+9
| | | | | | | | | | `wg-quick strip` prints the config file to stdout after stripping it of all wg-quick-specific options. This enables tricks such as `wg addconf $DEV <(wg-quick strip $DEV)`. Signed-off-by: Luis Ressel <aranea@aixah.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: update copyrightJason A. Donenfeld2019-01-071-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: prefer system paths for toolsJason A. Donenfeld2018-08-121-1/+1
| | | | | | | | | | | | | The only things wg-quick(8) needs from Homebrew are bash(1) and wg(8). Other than that, it's explicitly coded against the native system utilities. Since wg-quick(8) and bash(1) are invoked in auto_su by their full absolute path (via $SELF and $BASH, respectively), we can simply set the $PATH to be prefixed by the default system binary paths. This way, if users install tools that conflict with system tools -- such as GNU coreutils -- we won't accidently call those. Reported-by: Deirdre Connolly <durumcrustulum@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: allow link local default gatewayJason A. Donenfeld2018-07-161-1/+0
| | | | | | | | It's unclear why it was like this in the first place, but it apparently broke certain IPv6 setups. Reported-by: Jonas Blahut <j@die-blahuts.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: set DNS servers after delay on route changeJason A. Donenfeld2018-05-311-2/+6
| | | | | | | | This works around a race condition in macOS's network daemons, while also adding one in the form of possibly calling kill -ALRM on a stale PID; unfortunately bash can't wait from a trap. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: add multiple IP addressesJason A. Donenfeld2018-05-271-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: determine IPs when saving interfaceJason A. Donenfeld2018-05-271-4/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: allow enumeration of socket filesJason A. Donenfeld2018-05-231-1/+1
| | | | | | | These OSes have an unpriv'd ifconfig, so this isn't an even larger info leak. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: support FreeBSD/Darwin search pathJason A. Donenfeld2018-05-231-5/+13
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: freebsd: add new implementationJason A. Donenfeld2018-05-221-16/+19
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: do not remove routes when no real interfaceJason A. Donenfeld2018-05-221-0/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: rename namefile environment variableJason A. Donenfeld2018-05-221-1/+1
| | | | | | This paves the way for an openbsd implementation. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: simpler inclusion checkJason A. Donenfeld2018-05-171-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: reorder functionsJason A. Donenfeld2018-05-171-19/+19
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: networksetup does not like missing stdioJason A. Donenfeld2018-05-171-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: avoid routing loop if no defaultJason A. Donenfeld2018-05-171-6/+16
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: sometimes there are no network servicesJason A. Donenfeld2018-05-171-2/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: use invoking shell in auto rootingJason A. Donenfeld2018-05-161-1/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: add intentionally undocumented userspace implementation knobJason A. Donenfeld2018-05-161-1/+1
| | | | | | | | This knob might disappear at some point, and we don't want to encourage its use, so it's not being documented, but this should help with development of new implementations. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: use bash from environment and require bash 4+Jason A. Donenfeld2018-05-161-13/+13
| | | | | | | | For properly configured Homebrew installations /usr/local/bin should be before /bin, so this should still work. This allows the script to be used in more than one setting. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: restore DNS on downJason A. Donenfeld2018-05-161-13/+25
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: bash correctnessJason A. Donenfeld2018-05-161-5/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: remove v6 routes after shutdownJason A. Donenfeld2018-05-161-3/+3
| | | | | | This works around a Darwin kernel bug regarding interface removal. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: darwin: ensure socket directory existsJason A. Donenfeld2018-05-161-5/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* wg-quick: add darwin implementationJason A. Donenfeld2018-05-151-0/+444
It's pretty rough and leaves much to be desired, but it works. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>