public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Largret <largret@gmail.com>
To: linux-newbie <linux-newbie@vger.kernel.org>
Subject: chmod u+s confusion
Date: Fri, 07 Apr 2006 02:41:13 -0700	[thread overview]
Message-ID: <1144402873.8482.14.camel@localhost> (raw)

Hey,

I've used chmod to set suid for a file before and thought I had a good
grasp of how it worked. Recently I've found myself trying to set it for
a script. Here's what I see ($ denotes user account, # is root):

$ echo -e '#!/bin/sh\n\nwhoami'>whoami.sh
# chown root:root whoami.sh
# chmod 4755 whoami.sh
$ ./whoami.sh
chris
# chmod u+s `which whoami`
$ whoami
root

[Note: u+s is equivalent to 4xxx, sorry for the change-up]

So... why doesn't this make whoami.sh run the 'whoami' program as root?
It's worked for the programs whoami, and is a common mode set on
cdrecord.

Thanks for your help (and enlightenment).

--
Chris Largret <http://daga.dyndns.org>

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

             reply	other threads:[~2006-04-07  9:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-07  9:41 Chris Largret [this message]
2006-04-07  8:42 ` chmod u+s confusion David Fierbaugh
2006-04-07 18:06   ` Chris Largret
     [not found]     ` <200604071548.09870.david@fierbaugh.org>
2006-04-11  6:28       ` Chris Largret
2006-04-24 13:48 ` Kari Hurtta

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=1144402873.8482.14.camel@localhost \
    --to=largret@gmail.com \
    --cc=linux-newbie@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