Skip to content

Commit

Permalink
NFS: check user and group existence
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Mar 20, 2018
1 parent e471e7b commit 062438b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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

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

Expand Down
2 changes: 2 additions & 0 deletions etc/nextcloudpi-config.d/NFS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ncp-web/ncp-launcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
{
$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 ,
Expand Down

0 comments on commit 062438b

Please sign in to comment.