10 Commits

Author SHA1 Message Date
Tom Limoncelli
49606c19f7 Update RELEASE_ENGINEERING.md 2018-12-19 14:20:19 -05:00
Tom Limoncelli
ccd4f92e0b Update CHANGELOG.md 2018-12-19 14:20:05 -05:00
Tom Limoncelli
70e8c625e5 Add support for NetBSD and SunOS (SmartOS)
Add support for NetBSD and SunOS (SmartOS)
2018-12-09 07:32:44 -05:00
Travis Paul
e17c44aa61 Add NetBSD and SmartOS to list of supported OSes. 2018-12-03 09:19:27 -06:00
Travis Paul
f681872c4d Remove -n 1 argument from the xargs invocation in blackbox_shred_all_files.
The -I and -n options are mutually-exclusive, don't work as
expected with xargs from SunOS, and appear to be unecessary anyway.
2018-11-30 13:51:01 +08:00
Travis Paul
3594a3124e Bash from pkgsrc has a flag to disable importing functions unless explicitly enabled.
The patch was created in response to ShellShock and still remains:
https://www.mail-archive.com/smartos-discuss@lists.smartos.org/msg01247.html
https://github.com/NetBSD/pkgsrc/blob/trunk/shells/bash/patches/patch-shell.c
2018-11-30 13:49:15 +08:00
Travis Paul
fd3ad2fcea Add better support for NetBSD and SunOS in test scripts. 2018-11-30 10:59:21 +08:00
Travis Paul
3a491aad01 Add NetBSD and SunOS (SmartOS) support to _stack_lib.sh. 2018-11-29 14:01:54 +08:00
Travis Paul
b3b0604be7 Add NetBSD and SunOS support to cp_permissions.
Note that this likely won't work on Solaris without Coreutils as
Solaris lacks stat(1). SmartOS has stat from Coreutils in base
and the chmod(1) from it's OpenSolaris heritage. Using the chmod
from either Coreutils or Solaris will work the same (in this case)
on SmartOS.
2018-11-29 13:31:47 +08:00
Travis Paul
6408b622bf Add NetBSD and SunOS support to md5sum_file. 2018-11-29 12:47:37 +08:00
8 changed files with 59 additions and 14 deletions

View File

@@ -1,3 +1,15 @@
Release v1.20181219
* New OS support: Add support for NetBSD and SunOS (SmartOS)
* Testing: Improve confidence test.
* .blackbox is now the default config directory for new repos. (#272)
* Add blackbox_decrypt_file (#270)
* Improved compatibility: change"/bin/[x]" to "/usr/bin/env [x]" (#265)
* Add blackbox_less. (#263)
* add nix method of install (#261)
* Linked setting up of GPG key (#260)
Release v1.20180618 Release v1.20180618
* Restore `make manual-install` with warning. (#258) * Restore `make manual-install` with warning. (#258)

View File

@@ -134,6 +134,8 @@ BlackBox automatically determines which VCS you are using and does the right thi
- MacOS X - MacOS X
- Cygwin (Thanks, Ben Drasin!) **See Note Below** - Cygwin (Thanks, Ben Drasin!) **See Note Below**
- MinGW (git bash on windows) **See Note Below** - MinGW (git bash on windows) **See Note Below**
- NetBSD
- SmartOS
To add or fix support for a VCS system, look for code at the end of `bin/_blackbox_common.sh` To add or fix support for a VCS system, look for code at the end of `bin/_blackbox_common.sh`

View File

@@ -25,6 +25,17 @@ Build Tasks
Stable Releases Stable Releases
=============== ===============
Step 0. Test the software
Run this command to run the unit and system tests:
```
make test
```
NOTE: The tests require pinentry-tty. On macOS with NIX this
can be installed via: `nix-env -i pinentry`
Marking the software to be "stable": Marking the software to be "stable":
Step 1. Update CHANGELOG.md Step 1. Update CHANGELOG.md

View File

@@ -411,6 +411,12 @@ function md5sum_file() {
Darwin | FreeBSD ) Darwin | FreeBSD )
md5 -r "$1" | awk '{ print $1 }' md5 -r "$1" | awk '{ print $1 }'
;; ;;
NetBSD )
md5 -q "$1"
;;
SunOS )
digest -a md5 "$1"
;;
Linux | CYGWIN* | MINGW* ) Linux | CYGWIN* | MINGW* )
md5sum "$1" | awk '{ print $1 }' md5sum "$1" | awk '{ print $1 }'
;; ;;
@@ -427,10 +433,13 @@ function cp_permissions() {
Darwin ) Darwin )
chmod $( stat -f '%p' "$1" ) "${@:2}" chmod $( stat -f '%p' "$1" ) "${@:2}"
;; ;;
FreeBSD ) FreeBSD | NetBSD )
chmod $( stat -f '%p' "$1" | sed -e "s/^100//" ) "${@:2}" chmod $( stat -f '%p' "$1" | sed -e "s/^100//" ) "${@:2}"
;; ;;
Linux | CYGWIN* | MINGW* ) SunOS )
chmod $( stat -c '%a' "$1" ) "${@:2}"
;;
Linux | CYGWIN* | MINGW* | SunOS )
if [[ -e /etc/alpine-release ]]; then if [[ -e /etc/alpine-release ]]; then
chmod $( stat -c '%a' "$1" ) "${@:2}" chmod $( stat -c '%a' "$1" ) "${@:2}"
else else

View File

@@ -57,7 +57,7 @@ function create_self_deleting_tempfile() {
: "${TMPDIR:=/tmp}" ; : "${TMPDIR:=/tmp}" ;
filename=$(mktemp -t _stacklib_.XXXXXXXX ) filename=$(mktemp -t _stacklib_.XXXXXXXX )
;; ;;
Linux | CYGWIN* | MINGW* ) Linux | CYGWIN* | MINGW* | NetBSD | SunOS )
filename=$(mktemp) filename=$(mktemp)
;; ;;
* ) * )
@@ -78,7 +78,7 @@ function create_self_deleting_tempdir() {
: "${TMPDIR:=/tmp}" ; : "${TMPDIR:=/tmp}" ;
filename=$(mktemp -d -t _stacklib_.XXXXXXXX ) filename=$(mktemp -d -t _stacklib_.XXXXXXXX )
;; ;;
Linux | CYGWIN* | MINGW* ) Linux | CYGWIN* | MINGW* | NetBSD | SunOS )
filename=$(mktemp -d) filename=$(mktemp -d)
;; ;;
* ) * )
@@ -102,7 +102,7 @@ function make_self_deleting_tempfile() {
: "${TMPDIR:=/tmp}" ; : "${TMPDIR:=/tmp}" ;
name=$(mktemp -t _stacklib_.XXXXXXXX ) name=$(mktemp -t _stacklib_.XXXXXXXX )
;; ;;
Linux | CYGWIN* | MINGW* ) Linux | CYGWIN* | MINGW* | NetBSD | SunOS )
name=$(mktemp) name=$(mktemp)
;; ;;
* ) * )
@@ -127,7 +127,7 @@ function make_tempdir() {
# which needs to fit within sockaddr_un.sun_path (see unix(7)). # which needs to fit within sockaddr_un.sun_path (see unix(7)).
name=$(mktemp -d -t SO ) name=$(mktemp -d -t SO )
;; ;;
Linux | CYGWIN* | MINGW* ) Linux | CYGWIN* | MINGW* | NetBSD | SunOS )
name=$(mktemp -d) name=$(mktemp -d)
;; ;;
* ) * )
@@ -160,14 +160,14 @@ function fail_if_not_running_as_root() {
function fail_if_in_root_directory() { function fail_if_in_root_directory() {
# Verify nobody has tricked us into being in "/". # Verify nobody has tricked us into being in "/".
case $(uname -s) in case $(uname -s) in
Darwin | FreeBSD ) Darwin | FreeBSD | NetBSD )
if [[ $(stat -f'%i' / ) == $(stat -f'%i' . ) ]] ; then if [[ $(stat -f'%i' / ) == $(stat -f'%i' . ) ]] ; then
echo 'SECURITY ALERT: The current directory is the root directory.' echo 'SECURITY ALERT: The current directory is the root directory.'
echo 'Exiting...' echo 'Exiting...'
exit 1 exit 1
fi fi
;; ;;
Linux | CYGWIN* | MINGW* ) Linux | CYGWIN* | MINGW* | SunOS )
if [[ $(stat -c'%i' / ) == $(stat -c'%i' . ) ]] ; then if [[ $(stat -c'%i' / ) == $(stat -c'%i' . ) ]] ; then
echo 'SECURITY ALERT: The current directory is the root directory.' echo 'SECURITY ALERT: The current directory is the root directory.'
echo 'Exiting...' echo 'Exiting...'

View File

@@ -39,7 +39,12 @@ export -f exported_internal_shred_file
DEREFERENCED_BIN_DIR="${0%/*}" DEREFERENCED_BIN_DIR="${0%/*}"
MAX_PARALLEL_SHRED=10 MAX_PARALLEL_SHRED=10
bash_args=
if bash --help | grep import-functions >/dev/null 2>/dev/null; then
bash_args=--import-functions
fi
export IFS= export IFS=
tr '\n' '\0' <"$BB_FILES" | xargs -0 -I{} -n 1 -P $MAX_PARALLEL_SHRED bash -c "exported_internal_shred_file $DEREFERENCED_BIN_DIR \"{}\"" $DEREFERENCED_BIN_DIR/fake tr '\n' '\0' <"$BB_FILES" | xargs -0 -I{} -P $MAX_PARALLEL_SHRED bash $bash_args -c "exported_internal_shred_file $DEREFERENCED_BIN_DIR \"{}\"" $DEREFERENCED_BIN_DIR/fake
echo '========== DONE.' echo '========== DONE.'

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../bin blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../bin
export PATH="${blackbox_home}:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/local/bin:${blackbox_home}" export PATH="${blackbox_home}:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/local/bin:/usr/pkg/bin:/usr/pkg/gnu/bin:${blackbox_home}"
export LANG=C.UTF-8 # Required ro "gpg --export" to work properly. export LANG=C.UTF-8 # Required ro "gpg --export" to work properly.

View File

@@ -24,6 +24,12 @@ function md5sum_file() {
Darwin | FreeBSD ) Darwin | FreeBSD )
md5 -r "$1" | awk '{ print $1 }' md5 -r "$1" | awk '{ print $1 }'
;; ;;
NetBSD )
md5 -q "$1"
;;
SunOS )
digest -a md5 "$1"
;;
Linux ) Linux )
md5sum "$1" | awk '{ print $1 }' md5sum "$1" | awk '{ print $1 }'
;; ;;
@@ -72,10 +78,10 @@ function assert_file_group() {
assert_file_exists "$file" assert_file_exists "$file"
case $(uname -s) in case $(uname -s) in
Darwin|FreeBSD ) Darwin | FreeBSD | NetBSD )
found=$(stat -f '%Dg' "$file") found=$(stat -f '%Dg' "$file")
;; ;;
Linux ) Linux | SunOS )
found=$(stat -c '%g' "$file") found=$(stat -c '%g' "$file")
;; ;;
CYGWIN* ) CYGWIN* )
@@ -102,11 +108,11 @@ function assert_file_perm() {
assert_file_exists "$file" assert_file_exists "$file"
case $(uname -s) in case $(uname -s) in
Darwin|FreeBSD ) Darwin | FreeBSD | NetBSD )
found=$(stat -f '%Sp' "$file") found=$(stat -f '%Sp' "$file")
;; ;;
# NB(tlim): CYGWIN hasn't been tested. It might be more like Darwin. # NB(tlim): CYGWIN hasn't been tested. It might be more like Darwin.
Linux | CYGWIN* ) Linux | CYGWIN* | SunOS )
found=$(stat -c '%A' "$file") found=$(stat -c '%A' "$file")
;; ;;
* ) * )