* Re: "xfs_io -c chattr +i " on a symlink
@ 2006-08-04 8:15 Dan Am
2006-08-04 9:13 ` Timothy Shimmin
0 siblings, 1 reply; 11+ messages in thread
From: Dan Am @ 2006-08-04 8:15 UTC (permalink / raw)
To: xfs
On Fri, August 4, 2006 6:20 am, Chris Wedgwood wrote:
> I always disliked open/ioctl for this. I think we should actually have
a separate syscall for chattr, etc. (FreeBSD does this I think?)
So how does "attr -s someAttribute symlink" work ? This does the job very
well, distinguishing it from other filesystems.
Best
Dan
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: "xfs_io -c chattr +i " on a symlink
2006-08-04 8:15 "xfs_io -c chattr +i " on a symlink Dan Am
@ 2006-08-04 9:13 ` Timothy Shimmin
0 siblings, 0 replies; 11+ messages in thread
From: Timothy Shimmin @ 2006-08-04 9:13 UTC (permalink / raw)
To: Dan Am; +Cc: xfs
Dan Am wrote:
> On Fri, August 4, 2006 6:20 am, Chris Wedgwood wrote:
>> I always disliked open/ioctl for this. I think we should actually have
>> a separate syscall for chattr, etc. (FreeBSD does this I think?)
>
> So how does "attr -s someAttribute symlink" work ? This does the job very
> well, distinguishing it from other filesystems.
>
attr(1) sets the extended attribute and they are set by system calls.
It looks like you would need the -L option to attr(1) which ends up
calling the lsetxattr() syscall via the libattr library.
(Inode attributes shouldn't be confused with extended attributes, EAs, -
a cause of much confusion for me and others in the past :)
--Tim
^ permalink raw reply [flat|nested] 11+ messages in thread
* "xfs_io -c chattr +i " on a symlink
@ 2006-08-03 10:26 Dan Am
2006-08-03 14:13 ` Eric Sandeen
2006-08-04 0:28 ` Nathan Scott
0 siblings, 2 replies; 11+ messages in thread
From: Dan Am @ 2006-08-03 10:26 UTC (permalink / raw)
To: xfs
(resend, since I used the wrong account to send the initial mail, sorry)
Dear list,
I am trying to make a symlink immutable with chattr, however the command
seems to follow the link, which point to a NFS Mount.
Setting xattr works on symlink btw, which is useful.
More data below
Any ideas ?
Best Regards
Dan
Heres the situation from my machine's view:
/data > ls -l bin
lrwxrwxrwx 1 root root 48 Aug 2 15:53 bin -> /archive/l01abnfs07/bin
/data> xfs_io -c "chattr +i" bin
xfs_io: specified file ["bin"] is not on an XFS filesystem
~ > xfs_io -V
xfs_io version 2.8.4
~ > cat /etc/SuSE-release
SUSE LINUX Enterprise Server 9 (i586)
VERSION = 9
PATCHLEVEL = 3
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: "xfs_io -c chattr +i " on a symlink
2006-08-03 10:26 Dan Am
@ 2006-08-03 14:13 ` Eric Sandeen
2006-08-04 0:29 ` Nathan Scott
2006-08-04 0:28 ` Nathan Scott
1 sibling, 1 reply; 11+ messages in thread
From: Eric Sandeen @ 2006-08-03 14:13 UTC (permalink / raw)
To: Dan Am; +Cc: xfs
Dan Am wrote:
> (resend, since I used the wrong account to send the initial mail, sorry)
>
> Dear list,
>
> I am trying to make a symlink immutable with chattr, however the command
> seems to follow the link, which point to a NFS Mount.
> Setting xattr works on symlink btw, which is useful.
> More data below
> Any ideas ?
>
> Best Regards
> Dan
>
> Heres the situation from my machine's view:
> /data > ls -l bin
> lrwxrwxrwx 1 root root 48 Aug 2 15:53 bin -> /archive/l01abnfs07/bin
>
> /data> xfs_io -c "chattr +i" bin
> xfs_io: specified file ["bin"] is not on an XFS filesystem
>
> ~ > xfs_io -V
> xfs_io version 2.8.4
Try just using chattr.
[sandeen@sandeen ~]$ ln -s /tmp tmplink
[sandeen@sandeen ~]$ ls -l tmplink
lrwxrwxrwx 1 sandeen sandeen 4 Aug 3 09:05 tmplink -> /tmp
[sandeen@sandeen ~]$ su
Password:
[root@sandeen sandeen]# chattr +i tmplink
[root@sandeen sandeen]# stat -f tmplink
File: "tmplink"
ID: 802 Namelen: 255 Type: XFS (0x58465342)
Blocks: Total: 23377204 Free: 8557099 Available: 8557099 Size: 4096
Inodes: Total: 93554496 Free: 93202008
[root@sandeen sandeen]#
[root@sandeen sandeen]# lsattr tmplink
----i-------- tmplink
xfs_io also has an option to try to do operations even on non-xfs filesystems,
if that helps... if it follows the link & sets the attr on the link target, that
may not be behaving as expected though.
-Eric
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: "xfs_io -c chattr +i " on a symlink
2006-08-03 14:13 ` Eric Sandeen
@ 2006-08-04 0:29 ` Nathan Scott
2006-08-04 2:38 ` Eric Sandeen
2006-08-04 11:37 ` Dan Am
0 siblings, 2 replies; 11+ messages in thread
From: Nathan Scott @ 2006-08-04 0:29 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Dan Am, xfs
On Thu, Aug 03, 2006 at 09:13:07AM -0500, Eric Sandeen wrote:
> Try just using chattr.
Or not. :)
> [sandeen@sandeen ~]$ ln -s /tmp tmplink
> [sandeen@sandeen ~]$ ls -l tmplink
> lrwxrwxrwx 1 sandeen sandeen 4 Aug 3 09:05 tmplink -> /tmp
> [sandeen@sandeen ~]$ su
> Password:
> [root@sandeen sandeen]# chattr +i tmplink
> [root@sandeen sandeen]# stat -f tmplink
> File: "tmplink"
> ID: 802 Namelen: 255 Type: XFS (0x58465342)
> Blocks: Total: 23377204 Free: 8557099 Available: 8557099 Size: 4096
> Inodes: Total: 93554496 Free: 93202008
> [root@sandeen sandeen]#
> [root@sandeen sandeen]# lsattr tmplink
> ----i-------- tmplink
... I think you just set immutable on /tmp. Try a broken symlink,
instead of one that points to an existing inode.
cheers.
--
Nathan
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: "xfs_io -c chattr +i " on a symlink
2006-08-04 0:29 ` Nathan Scott
@ 2006-08-04 2:38 ` Eric Sandeen
2006-08-04 11:37 ` Dan Am
1 sibling, 0 replies; 11+ messages in thread
From: Eric Sandeen @ 2006-08-04 2:38 UTC (permalink / raw)
To: Nathan Scott; +Cc: Dan Am, xfs
Nathan Scott wrote:
> On Thu, Aug 03, 2006 at 09:13:07AM -0500, Eric Sandeen wrote:
>> Try just using chattr.
>
> Or not. :)
Whoops, oh well. Shoulda investigated a bit more I guess :)
-Eric
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: "xfs_io -c chattr +i " on a symlink
2006-08-04 0:29 ` Nathan Scott
2006-08-04 2:38 ` Eric Sandeen
@ 2006-08-04 11:37 ` Dan Am
2006-08-07 4:54 ` Nathan Scott
1 sibling, 1 reply; 11+ messages in thread
From: Dan Am @ 2006-08-04 11:37 UTC (permalink / raw)
To: xfs
On Fri, August 4, 2006 2:29 am, Nathan Scott wrote:
> ... I think you just set immutable on /tmp. Try a broken symlink,
> instead of one that points to an existing inode.
Nope:
/data/tara-test > ls -l test
lrwxr-xr-x 1 root root 13 Aug 4 13:33 test -> /archive/no-such-file
/data/tara-test > xfs_io -c "chattr +i" test
test: No such file or directory
Best Regards
Dan
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: "xfs_io -c chattr +i " on a symlink
2006-08-04 11:37 ` Dan Am
@ 2006-08-07 4:54 ` Nathan Scott
0 siblings, 0 replies; 11+ messages in thread
From: Nathan Scott @ 2006-08-07 4:54 UTC (permalink / raw)
To: Dan Am; +Cc: xfs
On Fri, Aug 04, 2006 at 01:37:32PM +0200, Dan Am wrote:
> On Fri, August 4, 2006 2:29 am, Nathan Scott wrote:
>
> > ... I think you just set immutable on /tmp. Try a broken symlink,
> > instead of one that points to an existing inode.
> Nope:
Eh?
> /data/tara-test > ls -l test
> lrwxr-xr-x 1 root root 13 Aug 4 13:33 test -> /archive/no-such-file
>
> /data/tara-test > xfs_io -c "chattr +i" test
> test: No such file or directory
Right, that was my point. As I said, you're out of luck - there
is currently no way to do what you want.
cheers.
--
Nathan
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: "xfs_io -c chattr +i " on a symlink
2006-08-03 10:26 Dan Am
2006-08-03 14:13 ` Eric Sandeen
@ 2006-08-04 0:28 ` Nathan Scott
2006-08-04 4:20 ` Chris Wedgwood
1 sibling, 1 reply; 11+ messages in thread
From: Nathan Scott @ 2006-08-04 0:28 UTC (permalink / raw)
To: Dan Am; +Cc: xfs
On Thu, Aug 03, 2006 at 12:26:56PM +0200, Dan Am wrote:
> (resend, since I used the wrong account to send the initial mail, sorry)
>
> Dear list,
>
> I am trying to make a symlink immutable with chattr, however the command
> seems to follow the link, which point to a NFS Mount.
> Setting xattr works on symlink btw, which is useful.
> More data below
> Any ideas ?
Its not possible to open(2) a symbolic link (see fs/namei.c::may_open),
which means you cannot get a file descriptor for a symlink, which means
you cannot issue an ioctl(2) to a symlink (which is how the inode flags
are set), which means you're out of luck on this one, sorry.
cheers.
--
Nathan
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: "xfs_io -c chattr +i " on a symlink
2006-08-04 0:28 ` Nathan Scott
@ 2006-08-04 4:20 ` Chris Wedgwood
0 siblings, 0 replies; 11+ messages in thread
From: Chris Wedgwood @ 2006-08-04 4:20 UTC (permalink / raw)
To: Nathan Scott; +Cc: Dan Am, xfs
On Fri, Aug 04, 2006 at 10:28:14AM +1000, Nathan Scott wrote:
> Its not possible to open(2) a symbolic link (see
> fs/namei.c::may_open), which means you cannot get a file descriptor
> for a symlink, which means you cannot issue an ioctl(2) to a symlink
> (which is how the inode flags are set), which means you're out of
> luck on this one, sorry.
I always disliked open/ioctl for this. I think we should actually
have a separate syscall for chattr, etc. (FreeBSD does this I think?)
^ permalink raw reply [flat|nested] 11+ messages in thread
* "xfs_io -c chattr +i " on a symlink
@ 2006-08-03 10:18 Daniel Amthor
0 siblings, 0 replies; 11+ messages in thread
From: Daniel Amthor @ 2006-08-03 10:18 UTC (permalink / raw)
To: xfs
Dear list,
I am trying to make a symlink immutable with chattr, however the command
seems to follow the link, which point to a NFS Mount.
Setting xattr works on symlink btw, which is useful.
More data below
Any ideas ?
Best Regards
Dan
Heres the situation from my machine's view:
/data > ls -l bin
lrwxrwxrwx 1 root root 48 Aug 2 15:53 bin -> /archive/l01abnfs07/bin
/data> xfs_io -c "chattr +i" bin
xfs_io: specified file ["bin"] is not on an XFS filesystem
~ > xfs_io -V
xfs_io version 2.8.4
~ > cat /etc/SuSE-release
SUSE LINUX Enterprise Server 9 (i586)
VERSION = 9
PATCHLEVEL = 3
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-08-07 4:56 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-04 8:15 "xfs_io -c chattr +i " on a symlink Dan Am
2006-08-04 9:13 ` Timothy Shimmin
-- strict thread matches above, loose matches on Subject: below --
2006-08-03 10:26 Dan Am
2006-08-03 14:13 ` Eric Sandeen
2006-08-04 0:29 ` Nathan Scott
2006-08-04 2:38 ` Eric Sandeen
2006-08-04 11:37 ` Dan Am
2006-08-07 4:54 ` Nathan Scott
2006-08-04 0:28 ` Nathan Scott
2006-08-04 4:20 ` Chris Wedgwood
2006-08-03 10:18 Daniel Amthor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox