Issue with trailing spaces on folder names

Bug discovered by one of my more punctuation-happy users, manifesting on: Webmin 1.851 Usermin 1.720 Virtualmin 5.99 Authentic Theme 18.49-8

To replicate this bug:

  1. Log into usermin
  2. Go into Manage Folders and choose to add a folder of type "Local mail file"
  3. Create a new folder, and set the folder name to a string WITH A TRAILING SPACE, eg "TestFolder " or "My Folder ".
  4. Still within Usermin, move or copy some messages into that newly created folder.
  5. Still within Usermin, open the newly created folder. It will appear as empty, despite the user having moved/copied messages into it.

Behind the scenes on the filesystem, the folder is successfully created as a directory WITH a trailing space in the filename. The directory DOES contain the mail messages that were moved/copied into the folder in usermin. They're just not being displayed successfully in Usermin. (Changing the folder name to remove the trailing space fixes the issue, and the messages in the folder then become visible as expected.)

I'm guessing this bug is down to a string operation stripping the trailing space; I haven't dug in to see if the issue is in Usermin itself or just in the Authentic theme.

Status: 
Active

Comments

Sounds like an escaping bug - for step 5, how did you select the new folder exactly?

konamacphee's picture
Submitted by konamacphee on Sun, 07/30/2017 - 07:49

Hi Jamie, in Usermin I opened the folder by simply clicking on its name in the "Mail" left hand menu tab, and also (as an extra test) by clicking on the "View" icon for that folder in the "Mail/Manage Folders" section.

It was the same result in either case; there was no apparent Usermin error in opening the folder, and it just showed as a "normal" but empty folder.

Ok, I was able to find the cause of this - surprisingly, perl treats files whose names end with a space in special way, which requires slightly different handling in the code. This will be fixed in the next Usermin release.

konamacphee's picture
Submitted by konamacphee on Sun, 07/30/2017 - 12:04

Brilliant, cheers Jamie!