Opened 11 years ago
Closed 10 years ago
#1912 closed defect (fixed)
g.mapset warns of illegal filename in mapset= but creates the mapset anyway.
| Reported by: | torsti | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.0.0 |
| Component: | Default | Version: | svn-trunk |
| Keywords: | g.mapset | Cc: | |
| CPU: | Unspecified | Platform: | Linux |
Description
See also ticket:1293
g.mapset -c mapset="möö" WARNING: Illegal filename <möö>. Character <�> not allowed.
The mapset is created despite of the warning. You can also switch to mapsets with illegal filenames.
Change History (7)
follow-up: 2 comment:1 by , 11 years ago
comment:2 by , 11 years ago
Replying to torsti:
Looking at the source it seems the issue is that neither general/g.mapset/main.c nor lib/gis/make_mapset.c include a call to G_legal_name() and the mapset dir itself is created with G_mkdir() which is just a thin wrapper around mkdir().
So probably make_mapset.c is what should be patched.
The warning is printed by the parsers (which calls G_find_file()), I disabled this check (file overwrite) for 'mapset' element in r55612. In r55608 I added to G_make_mapset() check for name legality. Done only in GRASS 7.
comment:3 by , 11 years ago
| Keywords: | g.mapset added |
|---|
follow-up: 5 comment:4 by , 11 years ago
g.mapset now (updated up to r55613) behaves as expected, but I noticed there is a similar issue in make_loc.c and calling e.g. g.proj -c location=illêgäl still works. Don't really want to open a new ticket, because it's so similar an issue.
comment:5 by , 11 years ago
follow-up: 7 comment:6 by , 11 years ago
Seems to work, g.proj -c enforces valid location names. Great!
comment:7 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |

Looking at the source it seems the issue is that neither general/g.mapset/main.c nor lib/gis/make_mapset.c include a call to G_legal_name() and the mapset dir itself is created with G_mkdir() which is just a thin wrapper around mkdir().
So probably make_mapset.c is what should be patched.