Opened 7 years ago

Closed 6 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 Changed 7 years ago by 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.

comment:2 in reply to:  1 Changed 7 years ago by martinl

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 Changed 7 years ago by martinl

Keywords: g.mapset added

comment:4 Changed 7 years ago by 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.

comment:5 in reply to:  4 Changed 7 years ago by martinl

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 Changed 7 years ago by torsti

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

comment:7 in reply to:  6 Changed 6 years ago by neteler

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.