Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Misc
Reload this Page Extended permissions on ext3
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Misc Any questions or Linux discussion that does not fit in any of the other technical areas.

Reply
 
Thread Tools Display Modes
Old 05-16-2008   #1 (permalink)
archiveacl
Just Joined!
 
Join Date: May 2008
Posts: 2
Extended permissions on ext3

I am seeing some strange behavior with extended permissions on ext3. I am writing a file as root and setting a user ACE. I then change to that user and try to access the file based on the ACL that I have set.

In the example below, I am setting a user ACE to have no permissions to access the file (---). However, I find that when I access the file as that user, I am able to read it. I find this strange because according to the man page, as soon as it matches the user ACE entry, it should allow or deny access.

If I set an identical ACL except I add the "wx" permission bits to the user ACE (-wx), I am rejected (which is what I expect). I am just wondering why I can read the file when I have no permissions (---) set on the user ACE (I expected to be rejected). Examples are below:

Example with no permissions for the user ACE:
Code:
[root@jvincent-D800 ~]# cd /tmp
[root@jvincent-D800 tmp]# echo "hello world" > file.txt
[root@jvincent-D800 tmp]# setfacl -m u::rwx,g::rwx,o::rwx,u:postgres:---,m:--- file.txt
[root@jvincent-D800 tmp]# getfacl file.txt
# file: file.txt
# owner: root
# group: root
user::rwx
user:postgres:---
group::rwx                      #effective:---
mask::---
other::rwx

[root@jvincent-D800 tmp]# ls -l file.txt
-rwx---rwx+ 1 root root 12 May  7 11:33 file.txt

[root@jvincent-D800 tmp]# su - postgres
[postgres@jvincent-D800 ~]$ id
uid=501(postgres) gid=501(postgres) groups=501(postgres)
[postgres@jvincent-D800 ~]$ whoami
postgres
[postgres@jvincent-D800 ~]$ cat /tmp/file.txt
hello world
[postgres@jvincent-D800 ~]$
Example with -wx permissions for the user ACE:
Code:
[root@jvincent-D800 tmp]# cd /tmp
[root@jvincent-D800 tmp]# echo "hello world" > file.txt
[root@jvincent-D800 tmp]# setfacl -m u::rwx,g::rwx,o::rwx,u:postgres:-wx,m:rwx file.txt
[root@jvincent-D800 tmp]# getfacl file.txt
# file: file.txt
# owner: root
# group: root
user::rwx
user:postgres:-wx
group::rwx
mask::rwx
other::rwx

[root@jvincent-D800 tmp]# ls -l file.txt
-rwxrwxr--+ 1 root root 12 May  7 13:47 file.txt
[root@jvincent-D800 tmp]# su - postgres
[postgres@jvincent-D800 ~]$ id
uid=501(postgres) gid=501(postgres) groups=501(postgres)
[postgres@jvincent-D800 ~]$ whoami
postgres
[postgres@jvincent-D800 ~]$ cat /tmp/file.txt
cat: /tmp/file.txt: Permission denied
[postgres@jvincent-D800 ~]$
archiveacl is offline   Reply With Quote
Old 05-16-2008   #2 (permalink)
archiveacl
Just Joined!
 
Join Date: May 2008
Posts: 2
I figured out the problem. It turns out the version of the kernel that I was using had the bug. It has been fixed in later kernel versions.

Found bug in kernel version 2.6.17
Fixed in kernel version 2.6.20
archiveacl is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 07:42 PM.

Powered by vBulletin 3.6.8 ©2000 - 2007, content relevant URLs by vBSEO, Property of Core Root.

Content Relevant URLs by vBSEO 3.0.0