Skip to content

Commit

Permalink
CIFS: Fix cred option not detected + remove checking for cred options…
Browse files Browse the repository at this point in the history
… completely so that users are not stuck with the guest mount option when they want to use other then the cred cifs mount option. Only use guest option by default when no other BACKUP_OPTIONS are given
  • Loading branch information
SvenVD committed Mar 17, 2013
1 parent 93097d5 commit ae614dd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions usr/share/rear/lib/global-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ output_path() {
mount_url() {
local url=$1
local mountpoint=$2
local options=${3:-"rw,noatime"}
local defaultoptions="rw,noatime"
local options=${3:-"$defaultoptions"}

### Generate a mount command
local mount_cmd
Expand All @@ -102,10 +103,10 @@ mount_url() {
mount_cmd="${!var} $mountpoint"
;;
(cifs)
if grep -qP '\bcred=\b' <<<$options; then
mount_cmd="mount $v -o $options //$(url_host $url)$(url_path $url) $mountpoint"
else
if [ x"$options" = x"$defaultoptions" ];then
mount_cmd="mount $v -o $options,guest //$(url_host $url)$(url_path $url) $mountpoint"
else
mount_cmd="mount $v -o $options //$(url_host $url)$(url_path $url) $mountpoint"
fi
;;
(usb)
Expand Down

0 comments on commit ae614dd

Please sign in to comment.