Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Mar 2000 06:05:05 -0800 (PST)
From:      Derrick Baumer <bduk@earthlink.net>
To:        tms2@mail.ptd.net
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: strange behaviour of chown(due to my lameness probably)
Message-ID:  <200003281405.GAA38893@arthlink.net>
In-Reply-To: <38E07D91.8D91BFB8@mail.ptd.net> (tms2@mail.ptd.net)

next in thread | previous in thread | raw e-mail | index | archive | help

> From: "Thomas M. Sommers" <tms2@mail.ptd.net>
> 
> Ariel Burbaickij wrote:
> > 
> >   Wait.even the files that are owned by user who intend to change its
> >   ownership?Effictively,giving ownership to someone other over?
> 
> Yes. Suppose I am evil and want to delete all of your files. Normally I
> could not do it, because you are careful and allow only yourself to
> write your files (the permissions are, for example: -rw-r--r--). But if
> I could give you ownership of a file, I could create a shell program
> with the line 'rm -r ~you/*', make it setuid and executable, and give
> you ownership of it. Then if I run it, it will run with your uid, and
> will happily delete all of your files.
> 
> To prevent this and similar security breaches, only root can change file
> ownership.
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message

Just out of curiosity, why not just have the system check on
setuid/setgid?  Seems you *ought* to be able to give your files away
if that example is the only security breach that would be involved -
you'd just have to have a secure system for setuid modifications.

Another thought is that if you give ownership of the file to someone
else, you would not be able to take it back, and that could,
theoretically, become troublesome if the other person decided they
didn't want the file.  They could decide to be difficult and leave
the 40Meg file you just gave them in your home directory and you'd
never be able to get rid of it without asking Mr. Root to help.

Honestly, though, why not just have the other user make a copy of the
file in question?  chmod 644 so they can read it and when they make
their own copy of the file it would be under their permissions.

-- 
Derrick Baumer
bduk@earthlink.net


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003281405.GAA38893>