Opened 12 years ago

Closed 11 years ago

#1912 closed defect (fixed)

g.mapset warns of illegal filename in mapset= but creates the mapset anyway.

Reported by: torsti Owned by: grass-dev@…
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)

comment:1 by torsti, 12 years ago

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.

in reply to:  1 comment:2 by martinl, 12 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 martinl, 12 years ago

Keywords: g.mapset added

comment:4 by torsti, 12 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.

in reply to:  4 comment:5 by martinl, 12 years ago

Replying to torsti:

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.

please try out r55614.

comment:6 by torsti, 12 years ago

Seems to work, g.proj -c enforces valid location names. Great!

in reply to:  6 comment:7 by neteler, 11 years ago

Resolution: fixed
Status: newclosed

Replying to torsti:

Seems to work, g.proj -c enforces valid location names. Great!

Closing.

Note: See TracTickets for help on using tickets.