immutable flag or similar for Solaris 10 / ZFS


 
Thread Tools Search this Thread
Operating Systems Solaris immutable flag or similar for Solaris 10 / ZFS
# 1  
Old 11-10-2010
immutable flag or similar for Solaris 10 / ZFS

Hi

We have two dirs where a customer needs full access. I wish to avoid technically that the customer cant delete those two dirs.

In Linux world, you have immutable flags (ACL) for this. Howto do the same with Solaris 10 and ZFS?
# 2  
Old 11-10-2010
ZFS implements the immutable flag. Here is how to use it:
Code:
# mkdir /pool/im   
# ls -d/ v /pool/im
drwxr-xr-x   2 root     root           2 nov. 10 16:07 /pool23g/ro/im
        {archive,nohidden,noreadonly,nosystem,noappendonly,nonodump,noimmutable,av_modified,noav_quarantined,nonounlink}
# chmod S+ci /pool/im
# ls -d/ v /pool23g/ro/im
drwxr-xr-x   2 root     root           2 nov. 10 16:07 /pool/im
        {archive,nohidden,noreadonly,nosystem,noappendonly,nonodump,immutable,av_modified,noav_quarantined,nonounlink}
# id
uid=0(root) gid=0(root)
# rmdir /pool/im
rmdir: /pool/im: cannot remove [Not owner]
# chmod S-ci /pool/im
# rmdir /pool/im

However, I believe this only works with SunOS 5.11 based OSes, not Solaris 10. I have no idea about if this will be backported.
An alternative would be a dtrace script that will monitor any attempt to remove that specific directory and make this fails.
# 3  
Old 11-10-2010
Quote:
Originally Posted by jlliagre
An alternative would be a dtrace script that will monitor any attempt to remove that specific directory and make this fails.
Hi jlliagre

Thanks, but this (as you said already) is only Solaris 11. How is the solution with the dtrace-script? You have an example?
# 4  
Old 11-11-2010
That script should immediately revive any directory named "immutable" that happen to be removed.
Code:
#!/usr/sbin/dtrace -ws
fbt::fop_rmdir:entry /stringof(args[1])=="immutable"/
{
  self->path=args[0]->v_path;
}
fbt::fop_rmdir:return /self->path/
{
  system("mkdir %s/immutable;chmod 04777 %s/immutable",stringof(self->path),stringof(self->path));
}

# 5  
Old 11-11-2010
If the user(s) can't write to the parent directory, they won't be able to remove or rename the directory.

Just like you can't (normally) remove or rename your own home directory.
# 6  
Old 11-16-2010
If the user(s) can't write to the parent directory, they won't be able to remove or rename the directory.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

Install Solaris 11 with ZFS

Hi, I'm not expert with solaris. I Familiar with Linux variant only. Could anyone point me to right tutorial? I got one > but not sure it can be use or not. I'm doing fresh install for new server. The server spec did not come out yet. Please assist me. Thanks. (17 Replies)
Discussion started by: mzainal
17 Replies

2. Solaris

Solaris ZFS question

What I am trying to do is reuse space that was used from an old solaris zone and take that space used in the 2 disk mirror from the 2nd zpool and relocate it to /var/audit in the root pool. The pysical server has 4 disks. 2 disks are a mirrored root zone(c1t0d0s0,c1t1d0s0) and the other were the... (1 Reply)
Discussion started by: jpolachak
1 Replies

3. Solaris

Is there a similar tool with authconfig of Linux on Solaris?

Hi Dears, I believe you know authconfig on most of Linux Distributions. However, on Solaris OS, I don't know the similar tool. Could you please share me the tool, if any? Note: I am using SunOS 5.10. (0 Replies)
Discussion started by: crest.boy
0 Replies

4. Solaris

dual boot solaris/solaris zfs file system

Hi, I am running into a some problems creating a dual boot system of 2 solaris instances using ZFS file system and I was wondering if someone can help me out. First some back ground. I have been asked to change the file system of our server from UFS to ZFS. Currently we are using Solaris... (3 Replies)
Discussion started by: estammis
3 Replies

5. Solaris

Solaris 10 ZFS ACL help

All, Does anyone know of a simple way to traverse a file system and collect all ACL's (or ACE's as they are called now)? We use to be able to use getfacl fairly easily for this task but now we are forced to use -v or -V with the 'ls' command to get the extended permissions for a... (1 Reply)
Discussion started by: Shoeless_Mike
1 Replies

6. Solaris

immutable bit question

Hi! All Just wondering if anyone has a idea about setting the immutable bit on a Solaris 10 ZFS file I tried this chmod S+ci toto.txt and got that :-( chmod: ERROR: invalid mode (0 Replies)
Discussion started by: Ex-Capsa
0 Replies

7. Solaris

CC 5.5 compiler flag to issue 64bit porting warnings on sparc-solaris

Hi, We are porting our application from 32bit to 64bit. We tried -xarch=v9, -xarc=v9a and -xport64=full options so that compiler to issue 64bit porting warnings. But we are not getting any porting warninings WE are using CC 5.5 compiler on sparc-solaris m/c. Please tell us some powerful... (0 Replies)
Discussion started by: shobhah
0 Replies

8. Solaris

Solaris 10 ZFS

I'm typing on a nice Sunblade 100 that is willing to be a lab rat for my experiments. I installed Solaris 10 and want to mess with ZFS. Does anyone have any docs on how to install zfs or how to convert my current UFS filesystems to ZFS? Does anyone have any experiences good or bad with ZFS... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies
Login or Register to Ask a Question