linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Cihan Kömeçoğlu" <cihan@enderunix.org>
To: Glynn Clements <glynn@gclements.plus.com>
Cc: linux-c-programming@vger.kernel.org
Subject: Re[2]: setuid funciton
Date: Thu, 27 Dec 2007 01:48:20 +0200	[thread overview]
Message-ID: <563266144.20071227014821@enderunix.org> (raw)
In-Reply-To: <18289.51784.890436.560301@cerise.gclements.plus.com>


I understand. Thanks for your answer
I try this code under Freebsd 6.2
and dont give me this output

Wednesday, December 26, 2007, 5:28:08 AM, you wrote:

> Cihan Kömeçoľlu wrote:

>> Hello everybody
>> 
>> I have written simple code about usage of setuid. this program file
>> set-user-id bit is on and this process after exec when I execute this
>> program, effective user id and saved-user-id bit will be
>> program-file's user id. this correct?
>> 
>> But the last output when I set uid to 80(www) ,effective user id
>> wasn't 80. Why not? saved set user id is still 80? What is the
>> problem?
>> 
>> 
>> I compiled below code with gcc and I set-user-id bit and change own
>> file with this command

> [snip]

> It works for me; I get:

> Real UID        = 1001
> Effective UID   = 80
> Real UID        = 1001
> Effective UID   = 1001
> Real UID        = 1001
> Effective UID   = 80

> This is with a 2.6.17.13 kernel, compiled from stock sources (no
> vendor patches).

> If you are using a kernel with additional security features (e.g. 
> SELinux, AppArmor etc), it may impose additional restrictions on
> setuid(). You could try using setreuid() to swap the real and
> effective UIDs, rather than relying upon the saved UID.




-- 
Cihan Kömeçoðlu,
EnderUNIX SDT                           mailto:cihan@enderunix.org

-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2007-12-26 23:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-25 19:12 setuid funciton Cihan Kömeçoğlu
2007-12-26  3:28 ` Glynn Clements
2007-12-26 23:48   ` Cihan Kömeçoğlu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=563266144.20071227014821@enderunix.org \
    --to=cihan@enderunix.org \
    --cc=glynn@gclements.plus.com \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).