>> in manage/lib/do_copy.c, 'mkdir' is used which IMHO needs a special
>> treatment on Windows. See for example lib/gis/mapset_msc.c
>>
>
> here I leave this bug- I leave Windows developement as a challenge for
> others to pursue.
There are some candidates for this fix (contains some false positives):
Probably a search/replace of ' mkdir' would do, using G_mkdir() from
./lib/gis/paths.c
? Or we need to modify G_mkdir() to accepts two parameters.
No, G_mkdir() is fine.
On Unix, the mode argument should always be 0777, so the user has
complete control of the permissions via their umask; anything which
uses a more restrictive mode is second-guessing the user.
The only programs which should be setting permissions explicitly are
those which provide some other mechanism for the user to control the
permissions.
On Thu, Dec 07, 2006 at 12:02:09PM +0000, Glynn Clements wrote:
Markus Neteler wrote:
...
> Probably a search/replace of ' mkdir' would do, using G_mkdir() from
> ./lib/gis/paths.c
> ? Or we need to modify G_mkdir() to accepts two parameters.
No, G_mkdir() is fine.
On Unix, the mode argument should always be 0777, so the user has
complete control of the permissions via their umask; anything which
uses a more restrictive mode is second-guessing the user.
The only programs which should be setting permissions explicitly are
those which provide some other mechanism for the user to control the
permissions.
I have done the changes to G_mkdir() accordingly.
Also added a G_lstat() in lib/gis/paths.c for a similar
problem.
Find attached a diff for review.
The following 3 functions are too complicated for me (!)
to fix:
G_mkdir TODOS:
lib/g3d/g3dwindowio.c
lib/gis/mapset_msc.c
lib/raster/io_fifo.c
> > Probably a search/replace of ' mkdir' would do, using G_mkdir() from
> > ./lib/gis/paths.c
> > ? Or we need to modify G_mkdir() to accepts two parameters.
>
> No, G_mkdir() is fine.
>
> On Unix, the mode argument should always be 0777, so the user has
> complete control of the permissions via their umask; anything which
> uses a more restrictive mode is second-guessing the user.
>
> The only programs which should be setting permissions explicitly are
> those which provide some other mechanism for the user to control the
> permissions.
I have done the changes to G_mkdir() accordingly.
Also added a G_lstat() in lib/gis/paths.c for a similar
problem.
Find attached a diff for review.
The following 3 functions are too complicated for me (!)
to fix:
G_mkdir TODOS:
lib/g3d/g3dwindowio.c
The only code here which uses mkdir() is commented out.
lib/gis/mapset_msc.c
I'm currently testing the attached patch.
lib/raster/io_fifo.c
Can't we just kill this? I don't even know if it still works, given
that almost no-one actually uses --enable-fifo.
In any case, I doubt that file will work on Windows.
> The following 3 functions are too complicated for me (!)
> to fix:
> lib/gis/mapset_msc.c
I'm currently testing the attached patch.
I'm surprised I managed to make so many mistakes for such a relatively
small change. I've attached an updated patch; apart from eliminating
the compilation errors, it eliminates the warnings arising from the
addition of G_lstat().
> > lib/raster/io_fifo.c
>
> Can't we just kill this? I don't even know if it still works, given
> that almost no-one actually uses --enable-fifo.
>
> In any case, I doubt that file will work on Windows.
If we don't need it, let's remove it. Unused code is only
confusing.
just for curiosity, what's the (dis)advantage of using FIFO vs sockets?
> > > lib/raster/io_fifo.c
> >
> > Can't we just kill this? I don't even know if it still works, given
> > that almost no-one actually uses --enable-fifo.
> >
> > In any case, I doubt that file will work on Windows.
>
> If we don't need it, let's remove it. Unused code is only
> confusing.
just for curiosity, what's the (dis)advantage of using FIFO vs sockets?
Ugly code, not particularly robust, needs a global mode 1777
(world-writable, sticky-bit) directory for lock files (and thus the
need to deal with stale lock files), need to pre-create the FIFOs.
Also the need to store their paths in etc/monitorcap, which means
modifying it if you move the GRASS installation:
[Currently, we store relative paths, which don't actually work.]
The "obvious" mechanism for client-server communication is a socket.
The FIFO code existed for systems which don't have sockets. Nowadays,
such systems are about as common as 8-inch floppies or punched cards.
I only know of one person (Bev Wallace) who was actually using the
FIFO option, and that appears to be no longer relevant: