public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
* chmod u+s confusion
@ 2006-04-07  9:41 Chris Largret
  2006-04-07  8:42 ` David Fierbaugh
  2006-04-24 13:48 ` Kari Hurtta
  0 siblings, 2 replies; 5+ messages in thread
From: Chris Largret @ 2006-04-07  9:41 UTC (permalink / raw)
  To: linux-newbie

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-04-24 13:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-07  9:41 chmod u+s confusion Chris Largret
2006-04-07  8:42 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox