LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-31-2009, 08:21 AM   #1
Darric
LQ Newbie
 
Registered: Dec 2009
Posts: 2

Rep: Reputation: 0
Immutable Folder with removable contents


Hello forums! I've been a long time reader, but some how this is my first post.

Anyways, I did some searching on here, but could not find any thread that covered my question directly, which is understandable because it may seem odd.

Some time ago, I had somehow set permissions on a directory to where it could not be deleted by any user, but all of its contents would be deleted. I know its dumb, but for some reason I cannot remember how I made or chmod'd that directory to behave in that fashion.

Another user accidently deleted it using su - , and I have been trying to recreate it in the way that I had it ever since.

chattr affects the contents of the folder. I havent been able to test sticky bits on it, and I cannot recollect if stickies on parent directories affect contents of folders or no, man pages dont really specify.

I dont have access to this Unix system all the time, so as I said, so I dont get as much time as I would like to play around with it.

Any ideas out there for a scatter brain?

The system in question runs Irix just in case that helps.

But just to recap.. the desired outcome is doing a rm -rf on the directory, getting a permission error as to deleting the directory, but its contents being deleted.

Thanks in advance!
 
Old 12-31-2009, 08:58 AM   #2
GooseYArd
Member
 
Registered: Jul 2009
Location: Reston, VA
Distribution: Slackware, Ubuntu, RHEL
Posts: 183

Rep: Reputation: 46
you used chattr instead of chmod. If the directory has the immutable bit set (lsattr <dirname> will show you), just say:

chattr -i <whatever>
 
Old 12-31-2009, 09:19 AM   #3
Darric
LQ Newbie
 
Registered: Dec 2009
Posts: 2

Original Poster
Rep: Reputation: 0
I will have to mess with that again, but I was under the impression that chattr -i affects the files and sub directories of directory on which it is applied.
 
Old 01-01-2010, 01:11 AM   #4
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Make this directory owned by root and set permissions to 777
or to 1777 if you want that each user will be able to edit/remove only his own files.

It's exactly settings that /tmp has
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting 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



Similar Threads
Thread Thread Starter Forum Replies Last Post
folder contents not displayed raphtor Linux - Newbie 1 09-24-2008 08:29 PM
A script within a folder to delete the folder, script, and the folder's contents Cyberman Programming 15 10-17-2007 08:32 AM
want to 'tar' a folder without some contents of folder shipon_97 Linux - Newbie 5 10-13-2007 05:21 AM
compare folder contents babysnake Linux - Newbie 4 02-09-2007 08:04 AM
Cannot see contents of my folder nr4g3d Linux - Newbie 6 02-09-2004 04:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration