Project

General

Profile

Bug #37802

Support spaces in path when adding storage to an iocage jail

Added by Disk Didler about 2 years ago. Updated about 2 years ago.

Status:
Done
Priority:
No priority
Assignee:
Brandon Schneider
Category:
Middleware
Target version:
Seen in:
Severity:
Low Medium
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

It's cutting off some of the path in the UI using the browse buttons.

Trying to mount this.
"/mnt/ARRAY/media/download/!complete/!tv auto import(complete)"
to this
"/mnt/iocage/jails/sabnzbd/root/media/TVdownload"

When I hit save, it screws up and ends up naming the destination "auto" (??) and shortens the source path to
"/mnt/ARRAY/media/download/!complete/!tv"

I suspect the command, in the backend of the GUI is actually not using quotation marks.
I can fix this myself by not using spaces (which I'm about to do) but this is worth noting.

Thanks team.


Related issues

Has duplicate FreeNAS - Bug #40764: Plugins mount points can't have spaces in nameing or startup failsClosed
Has duplicate FreeNAS - Bug #41252: Mount point does not handle spaces in paths from GUIClosed
Has duplicate FreeNAS - Bug #43189: Jail Mount Point: Paths with spacesClosed

Associated revisions

Revision b08925a4 (diff)
Added by Brandon Schneider about 2 years ago

fix(jails/fstab): Make sure we escape spaces how fstab likes Ugly, but what can ya do. Ticket: #37802

Revision 161b390f (diff)
Added by Brandon Schneider about 2 years ago

fix(jails/fstab): Make sure we escape spaces how fstab likes Ugly, but what can ya do. Ticket: #37802

Revision 92c956d1 (diff)
Added by Brandon Schneider about 2 years ago

fix(jails/fstab): Make sure we escape spaces how fstab likes Ugly, but what can ya do. Ticket: #37802

History

#1 Updated by Dru Lavigne about 2 years ago

  • Category changed from OS to GUI (new)
  • Assignee changed from Release Council to Erin Clark
  • Target version changed from Backlog to 11.2-BETA2

#2 Updated by Erin Clark about 2 years ago

  • Assignee changed from Erin Clark to Lola Yang

#3 Updated by Lola Yang about 2 years ago

  • Category changed from GUI (new) to Middleware
  • Assignee changed from Lola Yang to Brandon Schneider

It's a middleware issue, i give it to Brandon.

#4 Updated by Brandon Schneider about 2 years ago

  • Status changed from Unscreened to Not Started

#6 Updated by Dru Lavigne about 2 years ago

  • Target version changed from 11.2-BETA2 to 11.2-BETA3

#9 Updated by Dru Lavigne about 2 years ago

  • Has duplicate Bug #40764: Plugins mount points can't have spaces in nameing or startup fails added

#10 Updated by Dru Lavigne about 2 years ago

  • Has duplicate Bug #41252: Mount point does not handle spaces in paths from GUI added

#11 Updated by Brandon Schneider about 2 years ago

  • Status changed from Not Started to In Progress

#12 Updated by Brandon Schneider about 2 years ago

  • Category changed from Middleware to GUI (new)
  • Status changed from In Progress to Unscreened
  • Assignee changed from Brandon Schneider to Erin Clark

This isn't an issue in middleware, the GUI should not allow spaces in the path to begin with regardless, it requires ugly escaping in an fstab to do properly. Passing to Erin to distribute.

root@freenas:~ # midclt call jail.fstab "btsync" '{"action": "ADD", "source": "/root/a dir with spaces", "destination": "/blah", "fstype": "foo", "fsoptions": "ro", "dump": "0", "pass": "0"}'
True

root@freenas:~ # midclt call jail.fstab "btsync" '{"action": "LIST", "source": "", "destination": "", "fstype": "", "fsoptions": "", "dump": "", "pass": ""}'
{"0": ["/mnt/iocage/releases/11.2-RELEASE/root/bin", "/mnt/iocage/jails/btsync/root/bin", "nullfs", "ro", "0", "0"], "1": ["/mnt/iocage/releases/11.2-RELEASE/root/boot", "/mnt/iocage/jails/btsync/root/boot", "nullfs", "ro", "0", "0"], "2": ["/mnt/iocage/releases/11.2-RELEASE/root/lib", "/mnt/iocage/jails/btsync/root/lib", "nullfs", "ro", "0", "0"], "3": ["/mnt/iocage/releases/11.2-RELEASE/root/libexec", "/mnt/iocage/jails/btsync/root/libexec", "nullfs", "ro", "0", "0"], "4": ["/mnt/iocage/releases/11.2-RELEASE/root/rescue", "/mnt/iocage/jails/btsync/root/rescue", "nullfs", "ro", "0", "0"], "5": ["/mnt/iocage/releases/11.2-RELEASE/root/sbin", "/mnt/iocage/jails/btsync/root/sbin", "nullfs", "ro", "0", "0"], "6": ["/mnt/iocage/releases/11.2-RELEASE/root/usr/bin", "/mnt/iocage/jails/btsync/root/usr/bin", "nullfs", "ro", "0", "0"], "7": ["/mnt/iocage/releases/11.2-RELEASE/root/usr/include", "/mnt/iocage/jails/btsync/root/usr/include", "nullfs", "ro", "0", "0"], "8": ["/mnt/iocage/releases/11.2-RELEASE/root/usr/lib", "/mnt/iocage/jails/btsync/root/usr/lib", "nullfs", "ro", "0", "0"], "9": ["/mnt/iocage/releases/11.2-RELEASE/root/usr/libexec", "/mnt/iocage/jails/btsync/root/usr/libexec", "nullfs", "ro", "0", "0"], "10": ["/mnt/iocage/releases/11.2-RELEASE/root/usr/sbin", "/mnt/iocage/jails/btsync/root/usr/sbin", "nullfs", "ro", "0", "0"], "11": ["/mnt/iocage/releases/11.2-RELEASE/root/usr/share", "/mnt/iocage/jails/btsync/root/usr/share", "nullfs", "ro", "0", "0"], "12": ["/mnt/iocage/releases/11.2-RELEASE/root/usr/libdata", "/mnt/iocage/jails/btsync/root/usr/libdata", "nullfs", "ro", "0", "0"], "13": ["/mnt/iocage/releases/11.2-RELEASE/root/usr/lib32", "/mnt/iocage/jails/btsync/root/usr/lib32", "nullfs", "ro", "0", "0"], "14": ["/root/a", "dir", "with", "spaces", "/blah", "foo", "ro", "0", "0"]}

root@freenas:~ # cat /mnt/iocage/jails/btsync/fstab 
/mnt/iocage/releases/11.2-RELEASE/root/bin      /mnt/iocage/jails/btsync/root/bin nullfs  ro    0     0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/boot     /mnt/iocage/jails/btsync/root/boot      nullfs  ro    0 0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/lib      /mnt/iocage/jails/btsync/root/lib nullfs  ro    0     0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/libexec  /mnt/iocage/jails/btsync/root/libexec   nullfs  ro    0 0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/rescue   /mnt/iocage/jails/btsync/root/rescue    nullfs  ro    0 0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/sbin     /mnt/iocage/jails/btsync/root/sbin      nullfs  ro    0 0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/usr/bin  /mnt/iocage/jails/btsync/root/usr/bin   nullfs  ro    0 0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/usr/include  /mnt/iocage/jails/btsync/root/usr/include   nullfs ro       0       0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/usr/lib  /mnt/iocage/jails/btsync/root/usr/lib   nullfs  ro    0 0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/usr/libexec  /mnt/iocage/jails/btsync/root/usr/libexec   nullfs ro       0       0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/usr/sbin /mnt/iocage/jails/btsync/root/usr/sbin  nullfs  ro    0 0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/usr/share    /mnt/iocage/jails/btsync/root/usr/share     nullfs ro       0       0 # Added by iocage on 2018-08-17 04:33:05
/mnt/iocage/releases/11.2-RELEASE/root/usr/libdata  /mnt/iocage/jails/btsync/root/usr/libdata   nullfs ro       0       0 # Added by iocage on 2018-08-17 04:33:05
/mnt/iocage/releases/11.2-RELEASE/root/usr/lib32    /mnt/iocage/jails/btsync/root/usr/lib32     nullfs ro       0       0 # Added by iocage on 2018-08-17 04:33:05
/root/a dir with spaces /blah   foo     ro      0   0 # Added by iocage on 2018-08-17 04:45:31

#13 Updated by Disk Didler about 2 years ago

I'm confused, are you suggesting users shouldn't be able to use folders with spaces in mount points at all?

#14 Updated by Brandon Schneider about 2 years ago

  • Category changed from GUI (new) to Middleware
  • Status changed from Unscreened to In Progress
  • Assignee changed from Erin Clark to Brandon Schneider

Yes, it's not a great idea in general on FreeBSD, but I suppose we shouldn't enforce those standards on users who don't care about that.

This will make the fstab quite ugly, so perhaps the UI may want to beautify it, but I'll take the ticket and send a commit for this.

EXAMPLE:

/root/a\040dir\040with\040spaces        /mnt/iocage/jails/btsync/root/blah      nullfs  ro      0     0 # Added by iocage on 2018-08-17 06:12:56

#15 Updated by Brandon Schneider about 2 years ago

PR: https://github.com/freenas/freenas/pull/1700
DESC: Escape spaces in source and destination
RISK: Low
ACCEPTANCE: Use a spaced path for midclt and verify the fstab shows \040 instead of a space.

midclt call jail.fstab "btsync" '{"action": "ADD", "source": "/root/a dir with spaces", "destination": "/mnt/iocage/jails/btsync/root/blah", "fstype": "nullfs", "fsoptions": "ro", "dump": "0", "pass": "0"}' ; cat /mnt/iocage/jails/btsync/fstab
True

/mnt/iocage/releases/11.2-RELEASE/root/bin      /mnt/iocage/jails/btsync/root/bin nullfs  ro    0     0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/boot     /mnt/iocage/jails/btsync/root/boot      nullfs  ro    0 0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/lib      /mnt/iocage/jails/btsync/root/lib nullfs  ro    0     0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/libexec  /mnt/iocage/jails/btsync/root/libexec   nullfs  ro    0 0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/rescue   /mnt/iocage/jails/btsync/root/rescue    nullfs  ro    0 0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/sbin     /mnt/iocage/jails/btsync/root/sbin      nullfs  ro    0 0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/usr/bin  /mnt/iocage/jails/btsync/root/usr/bin   nullfs  ro    0 0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/usr/include  /mnt/iocage/jails/btsync/root/usr/include   nullfs ro       0       0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/usr/lib  /mnt/iocage/jails/btsync/root/usr/lib   nullfs  ro    0 0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/usr/libexec  /mnt/iocage/jails/btsync/root/usr/libexec   nullfs ro       0       0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/usr/sbin /mnt/iocage/jails/btsync/root/usr/sbin  nullfs  ro    0 0 # Added by iocage on 2018-08-17 04:33:03
/mnt/iocage/releases/11.2-RELEASE/root/usr/share    /mnt/iocage/jails/btsync/root/usr/share     nullfs ro       0       0 # Added by iocage on 2018-08-17 04:33:05
/mnt/iocage/releases/11.2-RELEASE/root/usr/libdata  /mnt/iocage/jails/btsync/root/usr/libdata   nullfs ro       0       0 # Added by iocage on 2018-08-17 04:33:05
/mnt/iocage/releases/11.2-RELEASE/root/usr/lib32    /mnt/iocage/jails/btsync/root/usr/lib32     nullfs ro       0       0 # Added by iocage on 2018-08-17 04:33:05
/root/a\040dir\040with\040spaces        /mnt/iocage/jails/btsync/root/blah      nullfs  ro      0     0 # Added by iocage on 2018-08-17 06:12:56

#16 Updated by Dru Lavigne about 2 years ago

  • Subject changed from Creating iocage mountpoint in new UI has issues with spaces in path to Support spaces in path when adding storage to an iocage jail
  • Needs Doc changed from Yes to No

#17 Updated by Bug Clerk about 2 years ago

  • Status changed from In Progress to Ready for Testing

#18 Updated by Dru Lavigne about 2 years ago

  • Needs Merging changed from Yes to No

#19 Updated by Dru Lavigne about 2 years ago

  • Has duplicate Bug #43189: Jail Mount Point: Paths with spaces added

#20 Updated by Bonnie Follweiler about 2 years ago

  • Status changed from Ready for Testing to Passed Testing
  • Needs QA changed from Yes to No

Test Passed in FreeNAS-11.2-INTERNAL19

root@bonniemini:~ # midclt call jail.fstab "btsync" '{"action": "ADD", "source": "/root/directory with spaces", "destination": "/mnt/iocage/jails/btsync/root/blank_dir", "fstype": "nullfs", "fsoptions": "ro", "dump": "0", "pass": "0"}' ; cat /mnt/iocage/jails/btsync/fstab
True
/root/directory\040with\040spaces /mnt/iocage/jails/btsync/root/blank_dir nullfs ro 0 0 # Added by iocage on 2018-09-07 19:38:16

#21 Updated by Dru Lavigne about 2 years ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF