Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

chown other users files

1 view
Skip to first unread message

Rodrick Brown

unread,
Mar 18, 2005, 8:01:20 AM3/18/05
to
Hello all i'm having a hell of a time installing an app basically its
doing something really funky during the configuration basically the app
runs as a user mqm, during the configuration it changes the owner of a
file on the fly then tries to change the permissions of the file.

ie
chown("/var/mqsi/users/mqsiser v/bin/mqsistart", 202, -1) = 0
chmod("/var/mqsi/users/mqsiser v/bin/mqsistart", 04554) Err#1 EPERM
*Note the mqm userid is 200*

So basically the way I got around doing the chown was to use the "set
rstchown=0" in /etc/system dont ask how I found this, is there
something similar for chmod ?


But now this is where i'm stuck the app is trying to issue a chmod
04554 to a file it no longer owns. The user it changes the file to is
also in the same group as the current user.

Is there any work around for this problem ?

This system is running Solaris 9 on a Sun Fire V440.

--
Unix Systems Engineer
The City of New York (DoITT)
http://www.nyc.gov/doitt
rbrown[(@)]doitt.nyc.gov
http://www.rodrickbrown.com

David Haynes

unread,
Mar 18, 2005, 9:53:31 AM3/18/05
to
On Fri, 18 Mar 2005 13:01:20 GMT, Rodrick Brown
<rbrown[@]doitt.nyc.gov> wrote:

>Hello all i'm having a hell of a time installing an app basically its
>doing something really funky during the configuration basically the app
>runs as a user mqm, during the configuration it changes the owner of a
>file on the fly then tries to change the permissions of the file.
>
>ie
>chown("/var/mqsi/users/mqsiser v/bin/mqsistart", 202, -1) = 0
>chmod("/var/mqsi/users/mqsiser v/bin/mqsistart", 04554) Err#1 EPERM
>*Note the mqm userid is 200*
>
>So basically the way I got around doing the chown was to use the "set
>rstchown=0" in /etc/system dont ask how I found this, is there
>something similar for chmod ?
>
>
>But now this is where i'm stuck the app is trying to issue a chmod
>04554 to a file it no longer owns. The user it changes the file to is
>also in the same group as the current user.
>
>Is there any work around for this problem ?
>
>This system is running Solaris 9 on a Sun Fire V440.

It there any (security) reason for not doing the chmod and then the
chown?

-david-


Casper H.S. Dik

unread,
Mar 18, 2005, 12:45:23 PM3/18/05
to
Rodrick Brown <rbrown[@]doitt.nyc.gov> writes:

>Hello all i'm having a hell of a time installing an app basically its
>doing something really funky during the configuration basically the app
>runs as a user mqm, during the configuration it changes the owner of a
>file on the fly then tries to change the permissions of the file.

>ie
>chown("/var/mqsi/users/mqsiser v/bin/mqsistart", 202, -1) = 0
>chmod("/var/mqsi/users/mqsiser v/bin/mqsistart", 04554) Err#1 EPERM
>*Note the mqm userid is 200*

>So basically the way I got around doing the chown was to use the "set
>rstchown=0" in /etc/system dont ask how I found this, is there
>something similar for chmod ?

No; that would completely destroy security. (chown allows you to
give away files; not chown random ones; and here you try to
create a set-uid executable)


You can't also change the order; the chown will clear the set-uid
bit.

Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

Barry Margolin

unread,
Mar 18, 2005, 8:20:27 PM3/18/05
to
In article <423b13b3$0$137$e4fe...@news.xs4all.nl>,

Casper H.S. Dik <Caspe...@Sun.COM> wrote:

> Rodrick Brown <rbrown[@]doitt.nyc.gov> writes:
>
> >Hello all i'm having a hell of a time installing an app basically its
> >doing something really funky during the configuration basically the app
> >runs as a user mqm, during the configuration it changes the owner of a
> >file on the fly then tries to change the permissions of the file.
>
> >ie
> >chown("/var/mqsi/users/mqsiser v/bin/mqsistart", 202, -1) = 0
> >chmod("/var/mqsi/users/mqsiser v/bin/mqsistart", 04554) Err#1 EPERM
> >*Note the mqm userid is 200*
>
> >So basically the way I got around doing the chown was to use the "set
> >rstchown=0" in /etc/system dont ask how I found this, is there
> >something similar for chmod ?
>
> No; that would completely destroy security. (chown allows you to
> give away files; not chown random ones; and here you try to
> create a set-uid executable)
>
>
> You can't also change the order; the chown will clear the set-uid
> bit.

It seems to me that this installer must be intended to be run as root,
not mqm. It's the only way that code could ever work.

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

0 new messages