Opened 10 years ago
Closed 7 years ago
#2447 closed defect (wontfix)
G_legal_filename: Special characters allowed in filenames
Reported by: | hcho | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.2.3 |
Component: | LibGIS | Version: | svn-trunk |
Keywords: | G_legal_filename | Cc: | |
CPU: | All | Platform: | All |
Description
Currently, G_legal_filename is not filtering out some special characters including tab, newline, {, |, }, etc. Also, the description of the function is incorrect because '_' is a non-alphanumeric character allowed in filenames. I'm not sure exactly what special characters are really legal. This function should also check non-printable characters.
Change History (7)
comment:1 by , 10 years ago
comment:5 by , 7 years ago
Milestone: | 7.2.1 → 7.2.2 |
---|
comment:7 by , 7 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
No activity last 3 years, closing. Feel free to reopen if needed.
Note:
See TracTickets
for help on using tickets.
Replying to hcho:
All control characters, including tab and newline are rejected by
source:grass/trunk/lib/gis/legal_name.c#L44
Braces and vertical bar aren't considered invalid.
Which characters are invalid is somewhat arbitrary, although it has to include those which have a specific meaning to the parser (equals, comma), to the OS (slash) or within map names (at). Apart from those, space, single quote, double quote, asterisk, control characters and 8-bit characters are considered invalid, although there's no fundamental reason for these (some of these may have been added to avoid issues with code which used system() and/or popen(), but those functions should have been been eliminated in GRASS 7).
The set of invalid characters hasn't been updated to include all of those which are invalid on Windows, specifically backslash, colon, question mark, less than, greater than, vertical bar (asterisk, double quote and slash are also invalid but are already rejected). It's unlikely that any of these are likely to be used in existing data sets, with the possible exception of colon.