Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > What is "drwxrwxrwt" + drive ownership problem?

What is "drwxrwxrwt" + drive ownership problem?
Thread Tools
Mac Enthusiast
Join Date: Nov 1999
Location: Milkyway Galaxy
Status: Offline
Reply With Quote
Jul 26, 2001, 05:52 AM
 
Hello, i was recently snooping around my system, and I found a directory in a mounted file system had "drwxrwxrwt" for the file modes. I believe I understand UNIX file modes, but, i've never ever encounted a 't' in it? So what does 't' stand for? Does anyone have any idea?

Also, i have another (somewhat petty) question. if you do 'ls -l' in /Volumes, you'll see that the currently loged on user owns all the other drives. but recenly, i was playign around w/ it while loged in as my non-mail user ID and i changed the owner of /Volumes/<drive>. Now the only way for me to get the drive back is by doing 'chmod 777' to it, which is very unsafe. So how do i set it back like before so as who ever is the currently logged in user showes up as the owner of the drives in /Volumes?? Log in under different names and you'll see each time you log in, it changes the owner of the drive to who ever your logged in as.
Death To Extremists!
     
<Posthumous>
Guest
Status:
Reply With Quote
Jul 26, 2001, 08:26 AM
 
Originally posted by mactropolis:
<STRONG>Hello, i was recently snooping around my system, and I found a directory in a mounted file system had "drwxrwxrwt" for the file modes. I believe I understand UNIX file modes, but, i've never ever encounted a 't' in it? So what does 't' stand for? Does anyone have any idea?

Also, i have another (somewhat petty) question. if you do 'ls -l' in /Volumes, you'll see that the currently loged on user owns all the other drives. but recenly, i was playign around w/ it while loged in as my non-mail user ID and i changed the owner of /Volumes/&lt;drive&gt;. Now the only way for me to get the drive back is by doing 'chmod 777' to it, which is very unsafe. So how do i set it back like before so as who ever is the currently logged in user showes up as the owner of the drives in /Volumes?? Log in under different names and you'll see each time you log in, it changes the owner of the drive to who ever your logged in as.</STRONG>
Oh where do I begin... Let me start by telling you about the "t" in "drwxrwxrwt." When a directory is set with the "t" permission, this is known as the sticky bit. The "sticky bit" is used to impose extra file removal permissions on a directory. A directory that has write permissions enabled for a user, allows that user to add, as well as delete any files from this directory. If the sticky bit is enabled on the directory, files may only be removed if you match any one of these criteria:

- The owner of the sticky directory
- The owner of the file being removed
- The Superuser more commonly known as root

Enabling the sticky bit for a directory should be considered for any directories that can be written to by nonpriveleged users such as temp directories or public file upload directories.


Now, as far as your plight with your drive... did you do this from the gui or the command line? I can only talk command line with you here as I don't have OSX in front of me. In fact, I don't have it at all. So here goes nothing. One can use the "chown" change ownership command to change the ownership of files of any type. The "chgrp" command can be used to change the group ownership of the file. Now, which one did you do? Also, did you change the permissions via chmod on /volumes or /volumes/&lt;drive&gt;. Use the command as follows:

chown &lt;user&gt; &lt;file&gt;
chgrp &lt;user&gt; &lt;file&gt;

Now, by file I mean anything even a drive or device. In unix everything is abstracted to a file. Anyway, there may be different methods employed to make the drive owned by the logged in user. I'm not sure what the method is until I go play with a box. I'll tell you this, the "man" command is your friend. Do a "man chmod" at the command line and you'll be able to read the manual page for the chmod command or any command for that matter. You may want to try changing the ownership back using "chown." It is really hard to give you anymore info based on the information you've given me. Best of luck and study up on chown, chgrp, and chmod. If you search any of these terms in google.com you'll find more than enough information.

Cheers
     
Mac Enthusiast
Join Date: Nov 1999
Location: Milkyway Galaxy
Status: Offline
Reply With Quote
Jul 26, 2001, 09:17 PM
 
Originally posted by &lt;Posthumous&gt;:
<STRONG>

Oh where do I begin... Let me start by telling you about the "t" in "drwxrwxrwt." When a directory is set with the "t" permission, this is known as the sticky bit. The "sticky bit" is used to impose extra file removal permissions on a directory. A directory that has write permissions enabled for a user, allows that user to add, as well as delete any files from this directory. If the sticky bit is enabled on the directory, files may only be removed if you match any one of these criteria:

- The owner of the sticky directory
- The owner of the file being removed
- The Superuser more commonly known as root

Enabling the sticky bit for a directory should be considered for any directories that can be written to by nonpriveleged users such as temp directories or public file upload directories.


Now, as far as your plight with your drive... did you do this from the gui or the command line? I can only talk command line with you here as I don't have OSX in front of me. In fact, I don't have it at all. So here goes nothing. One can use the "chown" change ownership command to change the ownership of files of any type. The "chgrp" command can be used to change the group ownership of the file. Now, which one did you do? Also, did you change the permissions via chmod on /volumes or /volumes/&lt;drive&gt;. Use the command as follows:

chown &lt;user&gt; &lt;file&gt;
chgrp &lt;user&gt; &lt;file&gt;

Now, by file I mean anything even a drive or device. In unix everything is abstracted to a file. Anyway, there may be different methods employed to make the drive owned by the logged in user. I'm not sure what the method is until I go play with a box. I'll tell you this, the "man" command is your friend. Do a "man chmod" at the command line and you'll be able to read the manual page for the chmod command or any command for that matter. You may want to try changing the ownership back using "chown." It is really hard to give you anymore info based on the information you've given me. Best of luck and study up on chown, chgrp, and chmod. If you search any of these terms in google.com you'll find more than enough information.

Cheers</STRONG>
Hey!
Thanks for taking the time to post your detailed response.

Now i believe I understand what 't' is.

About the hard drive, I did indeed do it via the command line, not some app. I'm well versed with how to use *NIX. In this event, i don't know how it was before, thats why I can't fix it. I understand that i can manually chmod it back and forth to who ever i'm currently logged in as, but what I want is for it to be done automatically like before and like my other drives are. In other words, i know of the solution to the problem, i just want it back like before.
Death To Extremists!
     
Dedicated MacNNer
Join Date: Nov 2000
Location: Berkeley, CA
Status: Offline
Reply With Quote
Jul 26, 2001, 11:35 PM
 
Let's say you have a directory that is 775 withi root:admin user:group ownership. Even if a file doesn't belong to you, you can delete a file in that directory from the CLI at least. I'm not sure what happens with the Mac OS trash metaphor.

If you turn on the sticky bit, only the owner of the directory, the super-user and the owners can remove a file.
     
Mac Enthusiast
Join Date: Nov 1999
Location: Milkyway Galaxy
Status: Offline
Reply With Quote
Jul 27, 2001, 12:10 AM
 
how do u turn this sticky bit on and off anyway (not that i'm ever gonna use it)? What is its chmod number equivilent?
Death To Extremists!
     
Dedicated MacNNer
Join Date: Nov 2000
Location: Berkeley, CA
Status: Offline
Reply With Quote
Jul 27, 2001, 01:12 AM
 
Normally, you'd see something like:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>chmod <font color = blue>775</font> foo</font>[/code]

Permissions for User, Group, Other.

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier> u g o
---------
execute (<font color = blue>1</font>) | <font color = blue>1</font> <font color = blue>1</font> <font color = blue>1</font>
write (<font color = blue>2</font>) | <font color = blue>2</font> <font color = blue>2</font>
read (<font color = blue>4</font>) | <font color = blue>4</font> <font color = blue>4</font> <font color = blue>4</font>
---------
<font color = blue>7</font> <font color = blue>7</font> <font color = blue>5</font></font>[/code]

In actuality, there is another column before those three with bits for: sticky-bit (1,) setgid (2) and setuid (4.)

So, to turn on the sticky bit of a folder that you want any admin to be able to add stuff to, but not be able to delete anything but their own items, you would most likely:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>chmod <font color = blue>1775</font> foo</font>[/code] with maybe the ownership of the folder being whichever admin or maybe even root and the group ownership of the folder being "admin." Users not in the admin group and other than the owner of the folder will not be able to write to the folder.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:18 AM.
All contents of these forums © 1995-2009 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.4 © 2000-2009, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2