[GRASS-dev] TGRASS: mapset management question
Markus Neteler
neteler at osgeo.org
Mon Sep 21 14:06:15 PDT 2015
On Thu, Sep 17, 2015 at 11:19 PM, Markus Neteler <neteler at osgeo.org> wrote:
> On Thu, Sep 17, 2015 at 1:53 PM, Markus Neteler <neteler at osgeo.org> wrote:
...
> So, multiple mapset support backported.
>
> Thanks again to Soeren to figure it out.
...
> PS: Now we only need to shut up the warnings there :)
Found it:
lib/temporal/lib/connect.c
static char *get_mapset_connection_name(const char *mapset, int contype)
{
const char *val = NULL;
char *ret_val = NULL;;
const char *gisdbase = G_getenv_nofatal("GISDBASE");
const char *location = G_getenv_nofatal("LOCATION_NAME");
int ret;
G_debug(1,"Checking mapset <%s>", mapset);
ret = G_mapset_permissions2(gisdbase, location, mapset);
switch (ret) {
case 0: /* Check if the mapset exists and user is owner */
//G_warning(_("You don't have permission to access the mapset <%s>"),
// mapset);
break;
case -1:
G_warning(_("Mapset <%s> does not exist."),
mapset);
break;
default:
break;
}
...
The problem is that in case of e.g. t.rast.list the
G_mapset_permissions2() test is too "agressive" since it checks if I
am the *owner* of another mapset (I am not in my case) while I just
want to read data from there.
Since we have 160+ mapsets in our EU LAEA location generated and owned
by a series of owners, I get spammed with messages of above case 0.
In the end the result of e.g. t.rast.list is almost invisible.
Is there a way to add an extra condition within the case 0. Or do we
need a new G_mapset_permissions3() being less picky about ownership?
Markus
More information about the grass-dev
mailing list