Closed Bug 230961 Opened 21 years ago Closed 20 years ago

I can rename a mail folder with illegal characters

Categories

(SeaMonkey :: MailNews: Message Display, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 89986

People

(Reporter: eagle.lu, Assigned: sspitzer)

References

(Blocks 1 open bug)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.4.1) Gecko/20040102
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; zh-CN; rv:1.4.1) Gecko/20040102

I find this maybe a new feature to allow illegal characters in the folder name.
Because when I find out why, I found the corresponding code is in the file:
mailnews/base/util/nsMsgUtil.cpp. In the function NS_MsgHashIfNecessary(), there
are following codes:

  else
  {
      // found illegal chars, hash the whole thing
      // if we do substitution, then hash, two strings
      // could hash to the same value.
      // for example, on mac:  "foo__bar", "foo:_bar", "foo::bar"
      // would map to "foo_bar".  this way, all three will map to
      // different values
      PR_snprintf(hashedname, 9, "%08lx",
                (unsigned long) StringHash(str.get()));
      name = hashedname;
  }

which means before renaming folder, if illegal character is found in the new
name, these codes will convert it to legal character by using PR_nsprintf(...).

If this is a new feature, why I can't delete it as a normal folder?


Reproducible: Always

Steps to Reproduce:
Reproduce steps:
1. start mozilla1.4
2. open "mail&news group" window
3. create a folder in "Local Folders" e.g. "abc"
   a folder named "abc" will occur in the left window under "Local Folders"
directory
4. select the folder "abc" and right click mouse 
   a context memu will popup
5. select "Rename folder..." menu item
   a rename dialog will appear
6. In the rename dialog, enter "def\/,[]" and press OK button




Actual Results:  
   The folder "abc" will rename to "def\/,[]" and you can't delete it by right
clicking mouse on it and selecting "Delete Folder" menu item.


Expected Results:  
In netscape7.0, I can't rename a folder's name with illegal characters.
Looks like this might be a dupe of #140212.
Almost real illegal file name character problems in folder name are already
resolved by using different file name for such folders.
Try to create folder name of "\" locally and see real file name for it.
This is the reason why different result was obtained between Netscape 7(old
build of Mozilla) and later Mozilla builds.

However, some special characters which are used in URL(/,# etc.) in folder name
still have problems, although some of them are not illegal file name characters.
See dependecy tree of meta bug 124287.
> Meta bug: Problems with folders having names with illegal characters

In addtion, "." has problems.
(a) Folder name start with "." - Unix hidden file.
(b) Folder name end with "." - file created by MS Windows becomes file name with
 no ending period and no file extention.
See Bug 229522 for (a) and see Bug 117840 for (b). 

There is another interesting problem.
 Since escaped form of "%" is "%25", "%25" is unescaped to "%".
 Therefore, folder can not be accessed if "%25" is included in file name.
See Bug 93666 for this problem.


*** This bug has been marked as a duplicate of 89986 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
v.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.