Skip to content

Commit a156059

Browse files
authored
fix!(backup): denying backup upload for non-encrypted firewalls (#1455)
1 parent 530aeb0 commit a156059

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

packages/ns-api/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
include $(TOPDIR)/rules.mk
77

88
PKG_NAME:=ns-api
9-
PKG_VERSION:=3.4.1
9+
PKG_VERSION:=3.4.2
1010
PKG_RELEASE:=1
1111

1212
PKG_BUILD_DIR:=$(BUILD_DIR)/ns-api-$(PKG_VERSION)

packages/ns-api/files/ns.backup

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ elif cmd == 'call':
170170
print(json.dumps(utils.generic_error(f'remote list failed')))
171171

172172
elif action == 'registered-backup':
173+
if os.path.exists(PASSPHRASE_PATH):
174+
print(utils.validation_error('passphrase', 'missing'))
173175
try:
174176
# create backup
175177
file_name = create_backup()

packages/ns-plug/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
include $(TOPDIR)/rules.mk
77

88
PKG_NAME:=ns-plug
9-
PKG_VERSION:=1.0.0
9+
PKG_VERSION:=1.0.1
1010
PKG_RELEASE:=1
1111

1212
PKG_BUILD_DIR:=$(BUILD_DIR)/ns-plug-$(PKG_VERSION)

packages/ns-plug/files/send-backup

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ function send {
2121
# send encrypted backup
2222
gpg --batch -c --yes --passphrase-file $PASSPHRASE $BACKUP
2323
remote-backup upload "$BACKUP.gpg"
24+
mv $MD5 $MD5_LAST
2425
else
25-
remote-backup upload "$BACKUP"
26+
# password not set, abort upload
27+
exit 4
2628
fi
2729
rm -f "$BACKUP" "$BACKUP.gpg"
28-
mv $MD5 $MD5_LAST
2930
exit $?
3031
}
3132

0 commit comments

Comments
 (0)