OpenSolaris

Printable Version Enter a New Search
Bug ID 6623426
Synopsis if immutable is set on a directory, unsetting all attributes fails
State 10-Fix Delivered (Fix available in build)
Category:Subcategory kernel:zfs
Keywords
Responsible Engineer Mark Shellenbaum
Reported Against
Duplicate Of
Introduced In solaris_nevada
Commit to Fix snv_80
Fixed In snv_80
Release Fixed solaris_nevada(snv_80)
Related Bugs
Submit Date 30-October-2007
Last Update Date 19-December-2007
Description
BFU to onnv-gate:2007-10-29, which integraded CIFS,

# zpool create tank <vdev>
# mkdir /tank/dir.0
# ls -d/c /tank/dir.0
drwxr-xr-x   2 root     root           2 Oct 29 23:17 /tank/dir.0
                {A------m--}
# chmod S+ci /tank/dir.0
# ls -d/c /tank/dir.0
# ls -d/c /tank/dir.0
drwxr-xr-x   2 root     root           2 Oct 29 23:17 /tank/dir.0
                {A-----im--}

****** Abnormal unset *****

# chmod S-cAHRSadimqu /tank/dir.0 
chmod: ERROR: cannot set the following attributes on /tank/dir.0: not supported
        {noarchive,nohidden,noreadonly,nosystem,noappendonly,nonodump,noimmutable,noav_modified,noav_quarantined,nonounlink}
# echo $?
1
# ls -d/c /tank/dir.0
drwxr-xr-x   2 root     root           2 Oct 29 23:17 /tank/dir.0
                {A-----im--}

But try each attribute seperately, it could unset,
Another funny thing is 'S-cA' could unset A, but while unset others, 'A' will be set automatically. regardless to file or directory, is it expected?

# for opt in A H R S a d m q u i ; do echo "chmod S-c$opt /tank/dir.0";  chmod S-c$opt /tank/dir.0 ; echo $? ; ls -d/c /tank/dir.0 ; done
chmod S-cA /tank/dir.0
0
drwxr-xr-x   2 root     root           2 Oct 29 23:17 /tank/dir.0
                {------im--}
chmod S-cH /tank/dir.0
0
drwxr-xr-x   2 root     root           2 Oct 29 23:17 /tank/dir.0
                {A-----im--}
chmod S-cR /tank/dir.0
0
drwxr-xr-x   2 root     root           2 Oct 29 23:17 /tank/dir.0
                {A-----im--}
chmod S-cS /tank/dir.0
0
drwxr-xr-x   2 root     root           2 Oct 29 23:17 /tank/dir.0
                {A-----im--}
chmod S-ca /tank/dir.0
0
drwxr-xr-x   2 root     root           2 Oct 29 23:17 /tank/dir.0
                {A-----im--}
chmod S-cd /tank/dir.0
0
drwxr-xr-x   2 root     root           2 Oct 29 23:17 /tank/dir.0
                {A-----im--}
chmod S-cm /tank/dir.0
0
drwxr-xr-x   2 root     root           2 Oct 29 23:17 /tank/dir.0
                {A-----i---}
chmod S-cq /tank/dir.0
0
drwxr-xr-x   2 root     root           2 Oct 29 23:17 /tank/dir.0
                {A-----i---}
chmod S-cu /tank/dir.0
0
drwxr-xr-x   2 root     root           2 Oct 29 23:17 /tank/dir.0
                {A-----i---}
chmod S-ci /tank/dir.0
0
drwxr-xr-x   2 root     root           2 Oct 29 23:17 /tank/dir.0
                {A---------}


If use a plain file, it'll not get above issues.

# touch /tank/file.0
# ls -/c /tank/file.0
-rw-r--r--   1 root     root           0 Oct 29 23:23 /tank/file.0
                {A------m--}
# chmod S+ci /tank/file.0
# ls -/c /tank/file.0
-rw-r--r--   1 root     root           0 Oct 29 23:23 /tank/file.0
                {A-----im--}
# chmod S-cAHRSadimqu /tank/file.0
# echo $?
0
# ls -/c /tank/file.0
-rw-r--r--   1 root     root           0 Oct 29 23:23 /tank/file.0
                {----------}
# chmod S+cAim /tank/file.0
#  ls -/c /tank/file.0
-rw-r--r--   1 root     root           0 Oct 29 23:23 /tank/file.0
                {A-----im--}
for opt in A H R S a d m q u i ; do echo "chmod S-c$opt /tank/file.0";  chmod S-c$opt /tank/file.0 ; echo $? ; ls -d/c /tank/file.0 ; done
chmod S-cA /tank/file.0
0
-rw-r--r--   1 root     root           0 Oct 29 23:23 /tank/file.0
                {------im--}
chmod S-cH /tank/file.0
0
-rw-r--r--   1 root     root           0 Oct 29 23:23 /tank/file.0
                {A-----im--}
chmod S-cR /tank/file.0
0
-rw-r--r--   1 root     root           0 Oct 29 23:23 /tank/file.0
                {A-----im--}
chmod S-cS /tank/file.0
0
-rw-r--r--   1 root     root           0 Oct 29 23:23 /tank/file.0
                {A-----im--}
chmod S-ca /tank/file.0
0
-rw-r--r--   1 root     root           0 Oct 29 23:23 /tank/file.0
                {A-----im--}
chmod S-cd /tank/file.0
0
-rw-r--r--   1 root     root           0 Oct 29 23:23 /tank/file.0
                {A-----im--}
chmod S-cm /tank/file.0
0
-rw-r--r--   1 root     root           0 Oct 29 23:23 /tank/file.0
                {A-----i---}
chmod S-cq /tank/file.0
0
-rw-r--r--   1 root     root           0 Oct 29 23:23 /tank/file.0
                {A-----i---}
chmod S-cu /tank/file.0
0
-rw-r--r--   1 root     root           0 Oct 29 23:23 /tank/file.0
                {A-----i---}
chmod S-ci /tank/file.0
0
-rw-r--r--   1 root     root           0 Oct 29 23:23 /tank/file.0
                {A---------}
Work Around
N/A
Comments
N/A