[GRASS-dev] Re: [GRASS-user] shared access to mapsets

Glynn Clements glynn at gclements.plus.com
Thu Jan 18 15:36:31 EST 2007


[CC'd to grass-dev]

Duncan Golicher wrote:

> Can anyone answer a very simple question. I am running grass6.1 under 
> Cygwin with all my data on an external hard drive. I recently installed 
> grass on a new PC. I now can't enter any of the mapsets I created on the 
> first machine from the second and can only get read access to them from 
> new mapsets. I have a different username on the second PC so I obviously 
> don't have permissions. What I can't find out, after Googling and 
> searching the list, are the steps I should take to change the 
> permissions, or perhaps the username in cygwin, so I can just share the 
> database between the two machines. 

Apart from any access controls implemented by the OS, GRASS itself
won't let you select a mapset as the current mapset unless you are the
owner of the mapset directory.

[This check is disabled on the native Windows version, as the
functions which it uses aren't present there.]

Note to developers: I'm starting to think that we should seriously
reconsider this restriction. Now that the .gislock file is in the
mapset directory rather than the home directory, is there any point in
having this check?

In general, to change the owner of a file under Windows XP Pro (I
don't know if XP Home is any different), perform the following
(excessively complex) sequence of steps:

[The process is complicated by the fact that even an administrator
cannot "give away" files; you have to permit the intended recipient to
take ownership, then have the recipient actually take ownership of the
files.]

+ Log in using either the account which owns the file or an account
with administrator privileges.

+ In Explorer, choose the "Folder Options ..." item from the "Tools"
menu.

+ Select the "View" tab in the Folder Options dialog.

+ Uncheck the "Use simple file sharing (Recommended)" option.

+ Click "OK".

+ In Explorer, select the file or directory whose ownership you wish
to change.

+ Select the "Properties" option from either the "File" menu or the
context menu (or Alt+Enter).

+ Select the "Security" tab (this tab is only available once you have
disabled simple file sharing as directed above).

+ Click the "Advanced" button.

+ The "Permissions" tab should be selected.

+ Click the "Add..." button.

+ Enter the name of the user to whom you wish to transfer ownership.

+ Press OK.

+ Check the box in the "Take Ownership" row and the "Allow" column.

+ Press OK.

+ Check the "Replace permission entries ..." option.

+ Press OK.

+ Press OK (for the Properties dialog).

+ Log in as the user to whom you wish to transfer ownership.

+ Disable simple file sharing as directed above (this is a per-user
setting).

+ Select the mapset directory in Explorer.

+ Select the "Properties" option from either the "File" menu or the
context menu.

+ Select the "Security" tab.

+ Click the "Advanced" button.

+ Select the "Owner" tab.

+ Select your name from the list.

+ Check the "Replace owner on subcontainers and objects" option.

+ Press OK.

+ Press OK (for the Properties dialog).

Optional: once you've changed the owner, you can remove the "take
ownership" permission entry. Also, you can re-enable simple file
sharing if desired; this will hide the Security tab in the Properties
dialog.

Tip: to save having to switch between your normal account and an
administrative account, create a shortcut to "C:\WINDOWS\explorer.exe"
with the "Run with different credentials" option enabled (click the
"Advanced" button in the shortcut's properties dialog). This lets you
do file management using an administrative account without having to
switch between logins. A few things don't quite work, e.g. 
notifications (you have to manually refresh the view with F5 whenever
you change something).

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list