I was doing some testing on edge cases for a plugin I maintain. This issue is reproducible simply by trying to create a share on a running system.
I tried to create a share with the following name:
Weird? [naming] & stuff / other stuff
As expected, Unraid gave me the following error:
You cannot use the following within share names : \ / * < > | "
I removed the forward slash and tried again with the following new, supposedly compliant share name:
Weird? [naming] & stuff other stuff
This time when pushing "Add Share" it hung on Processing Request for a little while, and then took me to a new page with the following error:
Share Weird? [naming] has been deleted.
Pushing the Done button on that page, I was taken to my Shares overview, where I currently see the share "Weird? [naming] & stuff other stuff" as if it weren't actually deleted
However, looking at the syslog, I see the following output. Samba seems to repeatedly restart and fopen seems to be having problems:
Sep 19 11:42:56 Tower emhttpd: error: put_config_idx, 619: Invalid argument (22): fopen: /boot/config/shares/Weird? [naming] & stuff other stuff.cfg
Sep 19 11:42:56 Tower emhttpd: shcmd (1310): mkdir '/mnt/user/Weird? [naming] & stuff other stuff'
Sep 19 11:43:06 Tower emhttpd: shcmd (1311): chmod 0777 '/mnt/user/Weird? [naming] & stuff other stuff'
Sep 19 11:43:06 Tower emhttpd: shcmd (1312): chown 'nobody':'users' '/mnt/user/Weird? [naming] & stuff other stuff'
Sep 19 11:43:06 Tower emhttpd: error: put_config_idx, 619: Invalid argument (22): fopen: /boot/config/shares/Weird? [naming] & stuff other stuff.cfg
Sep 19 11:43:06 Tower emhttpd: Starting services...
Sep 19 11:43:06 Tower emhttpd: error: put_config_idx, 619: Invalid argument (22): fopen: /boot/config/shares/Weird? [naming] & stuff other stuff.cfg
Sep 19 11:43:06 Tower emhttpd: Starting services...
Sep 19 11:43:06 Tower emhttpd: shcmd (1319): /etc/rc.d/rc.samba restart
Sep 19 11:43:08 Tower root: Starting Samba: /usr/sbin/smbd -D
Sep 19 11:43:08 Tower root: /usr/sbin/nmbd -D
Sep 19 11:43:08 Tower root: /usr/sbin/wsdd
Sep 19 11:43:08 Tower root: /usr/sbin/winbindd -D
Sep 19 11:43:08 Tower emhttpd: shcmd (1325): /etc/rc.d/rc.samba restart
Sep 19 11:43:11 Tower root: Starting Samba: /usr/sbin/smbd -D
Sep 19 11:43:11 Tower root: /usr/sbin/nmbd -D
Sep 19 11:43:11 Tower root: /usr/sbin/wsdd
Sep 19 11:43:11 Tower root: /usr/sbin/winbindd -D
Sep 19 11:43:11 Tower emhttpd: Starting services...
Sep 19 11:43:11 Tower emhttpd: shcmd (1342): /etc/rc.d/rc.samba restart
Sep 19 11:43:13 Tower root: Starting Samba: /usr/sbin/smbd -D
Sep 19 11:43:13 Tower root: /usr/sbin/nmbd -D
Sep 19 11:43:13 Tower root: /usr/sbin/wsdd
Sep 19 11:43:13 Tower root: /usr/sbin/winbindd -D
Sep 19 11:43:13 Tower emhttpd: error: put_config_idx, 619: Invalid argument (22): fopen: /boot/config/shares/Weird? [naming] & stuff other stuff.cfg
Sep 19 11:43:13 Tower emhttpd: Starting services...
Sep 19 11:43:13 Tower emhttpd: error: put_config_idx, 619: Invalid argument (22): fopen: /boot/config/shares/Weird? [naming] & stuff other stuff.cfg
Sep 19 11:43:13 Tower emhttpd: Starting services...
Sep 19 11:43:13 Tower emhttpd: shcmd (1358): /etc/rc.d/rc.samba restart
Sep 19 11:43:16 Tower root: Starting Samba: /usr/sbin/smbd -D
Sep 19 11:43:16 Tower root: /usr/sbin/nmbd -D
Sep 19 11:43:16 Tower root: /usr/sbin/wsdd
Sep 19 11:43:16 Tower root: /usr/sbin/winbindd -D
Sep 19 11:43:16 Tower emhttpd: shcmd (1364): /etc/rc.d/rc.samba restart
Sep 19 11:43:18 Tower root: Starting Samba: /usr/sbin/smbd -D
Sep 19 11:43:18 Tower root: /usr/sbin/nmbd -D
Sep 19 11:43:18 Tower root: /usr/sbin/wsdd
Sep 19 11:43:18 Tower root: /usr/sbin/winbindd -D
In terms of bugs, I think there are a couple. Possibly better validation is needed on Share name input, the Share Deleted warning didn't actually appear to delete the share, the Share Deleted warning didn't print the entire name. That said, the folder creation still worked, the shares.ini file seemed to get updated as normal, I was able to edit it relatively normally (save for the long loading times) and I was able to delete without issue.
While this is a bug, it appears relatively minor, at least for my use case.
Edit: I tried with $ and # in the share name as well and they were considered valid as well
Recommended Comments
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.