From 062438b7e3e823936e45d94f8ac1174c1c70cef9 Mon Sep 17 00:00:00 2001 From: nachoparker Date: Tue, 20 Mar 2018 19:28:29 +0100 Subject: NFS: check user and group existence --- changelog.md | 6 ++++-- etc/nextcloudpi-config.d/NFS.sh | 2 ++ ncp-web/ncp-launcher.php | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 26a63e9c..b26daf85 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ -[v0.53.4](https://github.com/nextcloud/nextcloudpi/commit/2e5443e) (2018-03-18) nc-ramlogs: fix enabled by default upon installoation +[v0.53.5](https://github.com/nextcloud/nextcloudpi/commit/49734e3) (2018-03-20) NFS: check user and group existence + +[v0.53.4 ](https://github.com/nextcloud/nextcloudpi/commit/5192766) (2018-03-18) nc-ramlogs: fix enabled by default upon installoation [v0.53.3 ](https://github.com/nextcloud/nextcloudpi/commit/2f7aa40) (2018-03-17) docker: fix development container script folder @@ -13,7 +15,7 @@ [v0.52.1 ](https://github.com/nextcloud/nextcloudpi/commit/974da0f) (2018-03-16) docker: include nc-webui -[v0.52.0](https://github.com/nextcloud/nextcloudpi/commit/3ff4e9d) (2018-03-12) added nc-rsync-auto +[v0.52.0 ](https://github.com/nextcloud/nextcloudpi/commit/3ff4e9d) (2018-03-12) added nc-rsync-auto [v0.51.0 ](https://github.com/nextcloud/nextcloudpi/commit/2566e44) (2018-03-12) added nc-rsync diff --git a/etc/nextcloudpi-config.d/NFS.sh b/etc/nextcloudpi-config.d/NFS.sh index 7b990cf3..81acf758 100644 --- a/etc/nextcloudpi-config.d/NFS.sh +++ b/etc/nextcloudpi-config.d/NFS.sh @@ -80,6 +80,8 @@ configure() # CHECKS ################################ + id "$USER_" &>/dev/null || { echo "user USER_ does not exist" ; return 1; } + id -g "$GROUP_" &>/dev/null || { echo "group GROUP_ does not exist"; return 1; } [ -d "$DIR_" ] || { echo -e "INFO: directory $DIR_ does not exist. Creating"; mkdir -p "$DIR_"; } [[ $( stat -fc%d / ) == $( stat -fc%d $DIR_ ) ]] && \ echo -e "INFO: mounting a in the SD card\nIf you want to use an external mount, make sure it is properly set up" diff --git a/ncp-web/ncp-launcher.php b/ncp-web/ncp-launcher.php index 829c39ef..aba9b985 100644 --- a/ncp-web/ncp-launcher.php +++ b/ncp-web/ncp-launcher.php @@ -118,7 +118,7 @@ else if ( $_POST['action'] == "launch" && $_POST['config'] ) { $value = "[". join(",", $value) ."]"; } - preg_match( '/^[\[\]\w.,@_\/-:]+$/' , $value , $matches ) + preg_match( '/^[\[\]\w-.,@_\/:]+$/' , $value , $matches ) or exit( '{ "output": "Invalid input" , "token": "' . getCSRFToken() . '" }' ); $code = preg_replace( '/\n' . $name . '_=.*' . PHP_EOL . '/' , PHP_EOL . $name . '_=' . $value . PHP_EOL , -- cgit v1.2.3