#580 Issue closed: mount is not working with space in cifs share

Labels: support / question, fixed / solved / done

chancesy opened issue at 2015-04-23 02:12:

Hi.

I am executing a rear backup with BACKUP=NETFS using cifs
i am having an issue if a cifs share contains spaces.

Here is my local.conf

OUTPUT=ISO

BACKUP=NETFS
BACKUP_URL=cifs://NZ-SAP-BACKUP1/SAP\040Production\040Servers/NZ-TESTLINUX/ACTIVE/
BACKUP_OPTIONS="cred=/usr/share/rear/conf/nz-sap-backup1.cifs"
BACKUP_PROG_EXCLUDE=( "${BACKUP_PROG_EXCLUDE[@]}" '/hana/data/HD1/data/mnt00001/*' '/hana/log/HD1/log/mnt00001/*' '/hana/data/HD1/BACKUP/*' )

Cheers,
Chance

gdha commented at 2015-04-26 16:36:

Where did it fail (see rear.log)? Is it not possible to rename the share without spaces? Looks easier to me.

gdha commented at 2015-08-06 12:48:

@chancesy did you retry it (in debug mode) to catch the error?

chancesy commented at 2015-08-07 23:58:

I just change the mount point / share without spaces :) easier that way

RunsOnRum commented at 2017-05-18 06:47:

I have run into the same issue, I tried to escape out of the space and I tried to put quotes around the whole address and still no go.

I don't think just changing the location is a suitable answer because at some stage there will be a user that will run into a situation where they can't change the path as other systems depend on it.

If you want a robust piece of software, then things like this should be corrected.

schlomo commented at 2017-05-18 07:41:

@jasonhurd I agree with you and in general we try to use quotes around such variables in ReaR. I suppose therefore that the fix will be quite easy.

grep -r '[^"]\$BACKUP_URL' . | wc -l in the ReaR source shows 53 matches, I would start from fixing that. If somebody needs this urgently then please provide a PR, otherwise we will try to pick it up late (but cannot guarantee a time).

jsmeix commented at 2017-05-18 09:00:

Only as a side note for the fun of weirdness
have a look at "Non-ASCII characters in file names" in
https://en.opensuse.org/SDB:Plain_Text_versus_Locale

In general ReaR is far away from being safe against
whitespace characters in file and directory names
or other names that matter for ReaR (i.e. file and directory
names that are only in the backup do not matter for ReaR).

In general regarding non-ASCII characters
see "Character encoding" in
https://github.com/rear/rear/wiki/Coding-Style

jsmeix commented at 2017-06-01 08:57:

Regarding
https://github.com/rear/rear/issues/580#issuecomment-302326660
I submitted https://github.com/rear/rear/issues/1372


[Export of Github issue for rear/rear.]