NFS: check user and group existence

This commit is contained in:
nachoparker 2018-03-20 19:28:29 +01:00
parent e471e7b8bf
commit 062438b7e3
3 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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"

View File

@ -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 ,