Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #209785

Re: How to set access permissions to protect a database file?

From Reco <recoverym4n@enotuniq.net>
Newsgroups linux.debian.user
Subject Re: How to set access permissions to protect a database file?
Date 2019-06-10 08:00 +0200
Message-ID <y7lvz-1YN-1@gated-at.bofh.it> (permalink)
References <y1P3k-1gM-7@gated-at.bofh.it> <y1RRv-32d-1@gated-at.bofh.it> <y1T6V-3Pi-1@gated-at.bofh.it> <y1TzX-4fN-1@gated-at.bofh.it> <y7e14-5UH-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


	Hi.

On Sun, Jun 09, 2019 at 06:32:42PM -0300, Markos wrote:
> Many thanks to Mick, David and Joe,
> 
> To guarantee "some" protection to the file containing the database I decided to use the following strategy:
> 
> I created, as root, the directory /home/reading_room
> 
> And activated the "sticky bit" of the reading_room directory with the command:
> 
> chmod +t /home/reading_room/
> 
> And transferred, the files to the new directory with the following access permissions:
> 
> reading_room.tcl  rwxr--r-x  (owner markos)
> 
> reading_room.db rw-r--rw- (owner markos)
> 
> This way other users can run the reading_room.tcl program but can't  but not edit.

Try it someday.

cd /tmp
echo foo 1.db
chmod 646 1.db
echo bar | sudo -u nobody tee /tmp/1.db >/dev/null
cat 1.db

Sticky bit combined with 'w' allows user to overwrite (or append) the
file.

> And can't delete the files (.tcl or .db)

That's true, and since most editors try to use "create temporary file
and move it along the original" - you mistook it for "other users cannot
edit the file".

Reco

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to set access permissions to protect a database file? Markos <markos@c2o.pro.br> - 2019-05-26 02:20 +0200
  Re: How to set access permissions to protect a database file? David Christensen <dpchrist@holgerdanske.com> - 2019-05-26 05:20 +0200
  Re: How to set access permissions to protect a database file? mick crane <mick.crane@gmail.com> - 2019-05-26 05:20 +0200
    Re: How to set access permissions to protect a database file? David Christensen <dpchrist@holgerdanske.com> - 2019-05-26 06:40 +0200
      Re: How to set access permissions to protect a database file? mick crane <mick.crane@gmail.com> - 2019-05-26 07:10 +0200
        Re: How to set access permissions to protect a database file? Markos <markos@c2o.pro.br> - 2019-06-10 00:00 +0200
          Re: How to set access permissions to protect a database file? mick crane <mick.crane@gmail.com> - 2019-06-10 00:40 +0200
          Re: How to set access permissions to protect a database file? Reco <recoverym4n@enotuniq.net> - 2019-06-10 08:00 +0200
            Re: How to set access permissions to protect a database file? john doe <johndoe65534@mail.com> - 2019-06-10 10:40 +0200
          Re: How to set access permissions to protect a database file? David Christensen <dpchrist@holgerdanske.com> - 2019-06-11 05:00 +0200
  Re: How to set access permissions to protect a database file? Joe <joe@jretrading.com> - 2019-05-26 10:20 +0200
    Re: How to set access permissions to protect a database file? Dan Ritter <dsr@randomstring.org> - 2019-06-10 01:10 +0200

csiph-web