Hi,
It seems that the commands and functions that operate on the .basex files, such as ADD and db:add(...), make the .basex files writable by the creator but not by anyone else. On the other hand, executing a query requires write permission for at least some of the .basex files, even if the query does not attempt to update the database. As a result, if I create a database and want anyone other than me to be able to use it (via the GUI, for example), I have to change permissions on the .basex files after creating the database. Apparently, I have to change the permissions again if I later update the database and rebuild the indexes.
Do folks on this list have a slick way to keep the permissions as open as needed? I tried searching the list archive but didn't find anything that looked relevent.
Would it be a reasonable enhancement request to make this a bit smoother? For example, an option could let you specify that the .basex files being created or modified should be writable by all. Alternatively or in addition, perhaps it is possible to stop requiring write permission for non-updating queries; I'm not familiar with the reason why write permission is needed.
Thanks, Amanda
Hi Amanda,
In Java, we use default operations for creating files and directories. My knowledge on Linux file permissions is limited, but I just ran BaseX on two different Linux machines, and I noticed that different permissions were assigned to the newly created files on both systems.
So.. Maybe there are some Linux experts on this list who can tell us if there are ways to define default permissions for newly created files for specific users, or all sub-directories in the BaseX directory?
Alternatively or in addition, perhaps it is possible to stop requiring write permission for non-updating queries; I’m not familiar with the reason why write permission is needed.
This is tricky indeed indeed. Databases are opened in the very core of BaseX, and they are not bound to specific users. A database will be opened once, but it may then accessed by different users in the client/server architecture.
But I assume that the problems you describe are caused by multiple users accessing the same database directory on a Linux machine, and that you don't use the client/server architecture?
Cheers, Christian
Thanks for the reply, Christian.
I want to create the databases on Linux, and then multiple users need to access the database directory. The other users are generally on Windows. You're correct, I'm not using the client/server architecture. (I haven't looked into it. If you think it's what I really should be doing, I can start to look at it.)
If it's a Linux thing, not specific to BaseX, then maybe that is good news for me. I'll see what I can find about default permissions on Linux.
Cheers, Amanda
-----Original Message----- From: Christian Grün [mailto:christian.gruen@gmail.com] Sent: Monday, August 03, 2015 10:58 AM To: Amanda Galtman Amanda.Galtman@mathworks.com Cc: basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] File permissions on .basex files
Hi Amanda,
In Java, we use default operations for creating files and directories. My knowledge on Linux file permissions is limited, but I just ran BaseX on two different Linux machines, and I noticed that different permissions were assigned to the newly created files on both systems.
So.. Maybe there are some Linux experts on this list who can tell us if there are ways to define default permissions for newly created files for specific users, or all sub-directories in the BaseX directory?
Alternatively or in addition, perhaps it is possible to stop requiring write permission for non-updating queries; I’m not familiar with the reason why write permission is needed.
This is tricky indeed indeed. Databases are opened in the very core of BaseX, and they are not bound to specific users. A database will be opened once, but it may then accessed by different users in the client/server architecture.
But I assume that the problems you describe are caused by multiple users accessing the same database directory on a Linux machine, and that you don't use the client/server architecture?
Cheers, Christian
I want to create the databases on Linux, and then multiple users need to access the database directory. The other users are generally on Windows. You're correct, I'm not using the client/server architecture. (I haven't looked into it. If you think it's what I really should be doing, I can start to look at it.)
The C/S architecture ensures that no one can update the data in parallel. If there will be no updates, your setup should be fine (apart from issues like the ones you encountered..).
-----Original Message----- From: Christian Grün [mailto:christian.gruen@gmail.com] Sent: Monday, August 03, 2015 11:35 AM To: Amanda Galtman Amanda.Galtman@mathworks.com Cc: basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] File permissions on .basex files
I want to create the databases on Linux, and then multiple users need to access the database directory. The other users are generally on Windows. You're correct, I'm not using the client/server architecture. (I haven't looked into it. If you think it's what I really should be doing, I can start to look at it.)
The C/S architecture ensures that no one can update the data in parallel. If there will be no updates, your setup should be fine (apart from issues like the ones you encountered..).
Thanks, that's really useful to know. In our system, there is only one user updating the databases, so I'll stick with the approach I have.
basex-talk@mailman.uni-konstanz.de