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

drwxrwsrwt on /tmp

743 views
Skip to first unread message

Todd C. Merrill

unread,
Jun 8, 1994, 3:12:56 PM6/8/94
to
How do I duplicate the permissions on /tmp:

19 perseus:/>ll -d /tmp
drwxrwsrwt 5 bin staff 1024 Jun 8 14:59 /tmp/

This has that "sticky" bit set so other people can't delete your files,
but everyone can write there.

I've tried chmod [0-7]777, but I can't get the group "x" to go to a "s".
Maybe it doesn't matter...

0777 drwxrwxrwx
1777 drwxrwxrwt
2777 drwxrwxrwx
3777 drwxrwxrwt
4777 drwsrwxrwx
5777 drwsrwxrwt
6777 drwsrwxrwx
7777 drwsrwxrwt

This happens to be with SunOS 4.1.3, but I need to make similar
directories on HP-UX 9.01 and Ultrix 4.3.

Until next time...
Todd
to...@loki.stanford.edu

"Microsoft has had two goals in the last 10 years. One was to copy the
Mac, and the other was to copy Lotus' success in the spreadsheet.... They
were able to copy the Mac because the Mac was frozen in time. The Mac
didn't change much for the last 10 years.... It was a sitting duck. It's
amazing that it took Microsoft 10 years to copy something that was a
sitting duck."
--Steven Jobs
---

DFRussell

unread,
Jun 8, 1994, 4:04:01 PM6/8/94
to
chmod g+s /tmp

--
dfru...@unixmail.rtpnc.epa.gov; MMTSI UGTS, at the EPA
DISCLAIMER: I don't speak for the EPA or Martin Marietta.
-----------------------------------------------------------
Tiger! Tiger! burning bright, in the forests of the night,
What immortal hand or eye, could frame thy fearful symmetry.

Barry Margolin

unread,
Jun 10, 1994, 4:31:26 PM6/10/94
to
In article <2t557o$1...@nntp2.Stanford.EDU> to...@loki.stanford.edu (Todd C. Merrill) writes:
>How do I duplicate the permissions on /tmp:
>
>19 perseus:/>ll -d /tmp
>drwxrwsrwt 5 bin staff 1024 Jun 8 14:59 /tmp/
>
>This has that "sticky" bit set so other people can't delete your files,
>but everyone can write there.
>
>I've tried chmod [0-7]777, but I can't get the group "x" to go to a "s".
>Maybe it doesn't matter...

It doesn't matter. The set-gid bit causes new files to be given the group
of the directory instead of the group of the user. For temporary files,
the group doesn't matter. In fact, I'd argue that it's probably safer
*not* to have set-gid on /tmp.

Anyway, the chmod(1) man page explains why you couldn't do it. In the
description of Absolute modes it says:

2000 Set group ID on execution (this bit is ignored if
the file is a directory; it may be set or cleared
only using symbolic mode).

You were setting the mode of a directory, so this bit was ignored.

And in the description of symbolic modes, it says:

s Set owner or group ID. This is only useful with
u or g. Also, the set group ID bit of a direc-
tory may only be modified with `+' or `-'.

So, if you want to set the set-gid bit of a directory, you must first set
all the other modes, and then do:

# chmod g+s /tmp
--
Barry Margolin
System Manager, Thinking Machines Corp.

bar...@think.com {uunet,harvard}!think!barmar

0 new messages