LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-26-2011, 02:02 PM   #1
murraymn
LQ Newbie
 
Registered: Jul 2005
Posts: 2

Rep: Reputation: 0
mv command and ACLs


I'd like to know if the mv command is supposed to apply the default acl of the destination directory to the moved file?

I'm on RHEL5, and when moving a file with no acl, to a directory with a default acl, the acl is not being applied.

Note: cp does apply the acl as expected.

Thx,
Mike
 
Old 04-26-2011, 02:52 PM   #2
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
What's an "acl"? The ownership and permisions?
 
Old 04-26-2011, 04:15 PM   #3
sibe
Member
 
Registered: Apr 2011
Location: Jakarta, Indonesia
Distribution: Fedora, CentOS
Posts: 122

Rep: Reputation: 21
Quote:
Originally Posted by MTK358 View Post
What's an "acl"? The ownership and permisions?
Access List. It's an extended attribute on a dir/file that provides specific permissions to certain users, regardless of the ordinary permission & ownership.

AFAIK, on RHEL5 mv does not change the original permission setting when it moves files to a an acl'ed dir.
 
Old 04-26-2011, 04:28 PM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
From the cp man page:

Code:
       --preserve[=ATTR_LIST]
              preserve the specified attributes (default: mode,ownership,time‐
              stamps),  if  possible  additional  attributes:  context, links,
              xattr, all
If ACLs are stored in xattr's, then "cp --preserve=xattr" should work.

mv's man page doesn't say anything about it, I guess that it keeps everything.
 
Old 04-27-2011, 09:31 AM   #5
nomb
Member
 
Registered: Jan 2006
Distribution: Debian Testing
Posts: 675

Rep: Reputation: 58
Quote:
Originally Posted by MTK358 View Post
From the cp man page:

Code:
       --preserve[=ATTR_LIST]
              preserve the specified attributes (default: mode,ownership,time‐
              stamps),  if  possible  additional  attributes:  context, links,
              xattr, all
If ACLs are stored in xattr's, then "cp --preserve=xattr" should work.

mv's man page doesn't say anything about it, I guess that it keeps everything.
That would preserve the permissions of the original file.

However he is asking if mv can apply the new permissions of the folder you are moving the file into.
 
Old 04-27-2011, 10:14 AM   #6
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
So he wants the copy of the file to have the same ACL as the destination folder?
 
Old 04-27-2011, 10:24 AM   #7
nomb
Member
 
Registered: Jan 2006
Distribution: Debian Testing
Posts: 675

Rep: Reputation: 58
Not sure about other filesystems but it seems like they are getting automatic inheritance of ACLs into ext4.

https://lkml.org/lkml/2011/2/23/196
 
Old 05-03-2011, 09:31 AM   #8
murraymn
LQ Newbie
 
Registered: Jul 2005
Posts: 2

Original Poster
Rep: Reputation: 0
My apologies...after the "what's an acl?" response I kinda moved on.

The filesystem was ext3.

I found/knew that cp does in fact apply the destination directory default acl, but mv apparently does not.
So yes I was wanting to know if mv can apply the new permissions of the folder you are moving the file into.

It appears the answer is no, for now.

Thanks everyone!
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help with permissions without using ACLs ehco2121 Linux - Newbie 1 02-09-2008 06:07 PM
Using Samba with ACLs drenze Linux - Server 1 10-19-2007 07:32 AM
squid acls ikinnu Linux - Networking 2 08-25-2007 04:24 PM
LDAP ACLs ziox Linux - Server 0 04-20-2007 11:07 PM
Linux ACLs kcv Linux - Security 6 09-14-2005 03:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:15 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