Menu

#20 database share

open
nobody
Backend (6)
3
2014-01-26
2011-10-01
atisne
No

It would be useful to be able to share a password databases. Especially at home or for a group of persons (administrators for example).
This could be easily reach if you grant read/write access for the group on the database file. (I'm discussing for unix-like systems.)
Unfortunately, the definition of the permission is lost. Indeed, when saving the database, a backup is done. It seems that a "move" of the database file is done to the backup file and a new database file is created. And so, this file get the permissions defined by the umask.
We can avoid this performing a copy instead of a move: we copy the database file to the backup file and then save the database in the same file. Thus, database file and backup file keep the right previously defined.
This also avoid the chmod at the end of pwsafe.sh.

Discussion

  • David

    David - 2014-01-11

    Sharing by keeping group permissions is a good point.

    Not sure a copy operation would work though, as it does not always keep the group on unix/linux (see cp -p parameter).

    I would prefer to use the new File I/O operations available in Java 7.
    For this we would either need to switch from Java 5 to Java 7, or use reflection.

     

    Last edit: David 2014-01-11
  • David

    David - 2014-01-26

    Have you tried setting the sticky group id on the directory involved?

    This should do the trick:

    chmod g+s /directory/
    

    Afterwards, all new files in 'directory' should belong to the same group as the directory.

     

Log in to post a comment.