real- and effective uid woes

real- and effective uid woes

Post by Peter Simon » Mon, 19 Jan 1998 04:00:00



-----BEGIN PGP SIGNED MESSAGE-----

Hi everybody,

I have the following problem: A program of mine is started with the
setuid-bit set, so that it runs under a different user id than the one
that started it. Unfortunately I now experience problems when I exec()
other programs, which seem to refuse working correctly unless ruid and
euid are identical.

So what I want to do is to make sure that -all- my process' user ids
are the same. The setruid() call seems to do this, but has been
deprecated. setuid() seems to do this also, but only succeeds when my
effective user id is "root", what it isn't.

So can someone give me a hint how I can archive this trick then?

        -peter

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: latin1

iQCVAwUBNMJJQQ9HL1s0103BAQEeUQP9HocI61qrbCOQ4q01PaJN9OEdfew+Jh+1
mwyBawsi4URe/+9b6vW5tflX8Ik1hBf9ErX40uf13BskQ8DbNuyrUj401KLPJrH2
miGnoAsgG/O9M9rSMlPWc80PWw5sWN+b+lNQpESNPOW3UxKxbPS31HDCHLfzqqoI
ltmQU5x4bbU=
=fBt0
-----END PGP SIGNATURE-----

 
 
 

real- and effective uid woes

Post by Jeff S. Dickso » Fri, 23 Jan 1998 04:00:00



> I have the following problem: A program of mine is started with the
> setuid-bit set, so that it runs under a different user id than the one
> that started it. Unfortunately I now experience problems when I exec()
> other programs, which seem to refuse working correctly unless ruid and
> euid are identical.

Since the effective user ID is not superuser my guess is that you are
encountering file permission problems. See intro(2).

Jeff S.*son


 
 
 

1. effective UID vs. Real UID with su - problem

Experts,

The situation is :
---------------------------------------------------------------------------
sunfire{/home/dxsnezhk}# id
uid=60144(dxsnezhk) gid=1(other)
sunfire{/home/dxsnezhk}# /usr/xpg4/bin/id -u -nr
dxsnezhk
sunfire{/home/dxsnezhk}# whoami
dxsnezhk
sunfire{/home/dxsnezhk}# who am i
dxsnezhk   pts/1        Mar 31 11:06    (10.4.242.8)
sunfire{/home/dxsnezhk}# su -
Password:
Sun Microsystems Inc.   SunOS 5.8       Generic Patch   October 2001
You have new mail.
sunfire{/}# id
uid=0(root) gid=1(other)
sunfire{/}# /usr/xpg4/bin/id -u -nr
root
sunfire{/}# whoami
root
sunfire{/}# who am i
dxsnezhk   pts/1        Mar 31 11:06    (10.4.242.8)
sunfire{/}# passwd
passwd:  Changing password for dxsnezhk
New password:
sunfire{/}#
---------------------------------------------------------------------------

As you can see, even with su -      my real UID does not change for
some commands? I am coming from HP-UX background and I expect EUID ==
RUID upon
su - . Also, I don't understand why id and who command report
different values. What am I missing ?

Thanks.
Dimitry.

2. How to change resolution?

3. setuid to a non-root uid for both effective&real uid

4. HPux 9.x to 10.x upgrade

5. Effective and Real UID and GID

6. 4096 files/user and 4096 tasks/user possible?

7. Effective vs. Real UIDs

8. Linux boot up problem

9. effective and real uids

10. Can you explain me the meaning of effective and real uid

11. UID / effective UID problem

12. Set effective uid?

13. Spawning shells with different effective uid's