4 desc="link returns EPERM if the source file has its immutable or append-only flag set"
25 expect 0 create ${n0} 0644
27 expect 1 stat ${n0} nlink
28 expect 0 link ${n0} ${n1}
29 expect 2 stat ${n0} nlink
31 expect 1 stat ${n0} nlink
33 expect 0 chflags ${n0} SF_IMMUTABLE
34 todo FreeBSD:ZFS "Creating a hard link to a file protected by SF_IMMUTABLE should return EPERM."
35 expect EPERM link ${n0} ${n1}
36 todo FreeBSD:ZFS "Creating a hard link to a file protected by SF_IMMUTABLE should return EPERM."
37 expect 1 stat ${n0} nlink
38 expect 0 chflags ${n0} none
39 todo FreeBSD:ZFS "Creating a hard link to a file protected by SF_IMMUTABLE should return EPERM."
40 expect 0 link ${n0} ${n1}
41 expect 2 stat ${n0} nlink
43 expect 1 stat ${n0} nlink
45 expect 0 chflags ${n0} SF_NOUNLINK
46 expect 0 link ${n0} ${n1}
47 expect 2 stat ${n0} nlink
48 expect 0 chflags ${n0} none
50 expect 1 stat ${n0} nlink
54 expect 0 chflags ${n0} SF_APPEND
55 expect 0 link ${n0} ${n1}
56 expect 2 stat ${n0} nlink
57 expect 0 chflags ${n0} none
59 expect 1 stat ${n0} nlink
62 expect 0 chflags ${n0} SF_APPEND
63 expect EPERM link ${n0} ${n1}
64 expect 0 chflags ${n0} none
65 expect 0 link ${n0} ${n1}
66 expect 2 stat ${n0} nlink
68 expect 1 stat ${n0} nlink
70 expect 0 chflags ${n0} UF_IMMUTABLE
71 expect EPERM link ${n0} ${n1}
72 expect 0 chflags ${n0} none
73 expect 0 link ${n0} ${n1}
74 expect 2 stat ${n0} nlink
76 expect 1 stat ${n0} nlink
78 expect 0 chflags ${n0} UF_NOUNLINK
79 expect 0 link ${n0} ${n1}
80 expect 2 stat ${n0} nlink
81 expect 0 chflags ${n0} none
83 expect 1 stat ${n0} nlink
85 expect 0 chflags ${n0} UF_APPEND
86 expect EPERM link ${n0} ${n1}
87 expect 0 chflags ${n0} none
88 expect 0 link ${n0} ${n1}
89 expect 2 stat ${n0} nlink
91 expect 1 stat ${n0} nlink