LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-20-2017, 07:18 AM   #1
andrew.comly
Member
 
Registered: Dec 2012
Distribution: Trisquel-Mini 7.0, Lubuntu 14.04, Debian lxde 8.0
Posts: 311
Blog Entries: 2

Rep: Reputation: 16
Question setfacl -s from ibm tutorial fails


setfacl -s doesn't work

I am reading the IBM tutorial on setfacl on the IBM Knowledge Center.

I would like to use the "-s" option for the command setfacl. The bash version on my Trisquel 7.0 OS is:
Code:
$ bash --version
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
In the manual file for setfacl on my system, there is no "-q, -s, -S" options like on the ibm Knowledge Center webpage above.

I start out with files w, y and z:
Code:
# file: w
# owner: a
# group: a
user::rw-
group::rw-
other::r--

# file: y
# owner: a
# group: a
user::rw-
group::rw-
other::r--

# file: z
# owner: a
# group: a
user::rw-
user:a:rwx
group::rw-
group:a:r--
mask::rwx
other::r--
I first try
Example 1:
Code:
$ setfacl -s user::rwx,group::---,other::---,user:b:r-x z
Usage: setfacl [-bkndRLP] { -m|-M|-x|-X ... } file ...
Try `setfacl --help' for more information.
Before on another websites' tutorial I learned: 1) u for user, g for group and o for other; 2) only option to modify is "-m". Thus I changed as follows:
Code:
$ setfacl -m u::rwx,g::---,o::---,u:b:r-x w
$ getfacl w
# file: w
# owner: a
# group: a
user::rwx
user:b:r-x
group::---
mask::r-x
other::---
Example 2:
The tutorial writes the equivalent of "setfacl -m group:egdoc:+r y", and with the above I correct it and try:
Code:
$ setfacl -m g:egdoc:+r y
setfacl: Option -m: Invalid argument near character 9
Being that I have used the "-m" option successfully before to add permissions for groups with setfacl, I thought that perhaps there is a version problem, thus adjusted the code to the below:
Code:
$ setfacl -m g:egdoc:r y
Changing the "+r" to a "r" really helped.

After this advance, I applied these changes again to example 1, w/o the -s option:
Code:
$ setfacl -m u::rwx,g::---,o::---,u:b:r-x z
{success}

Now, I tried to incorporate the "-s" option in order to fix example 1:
Code:
$ setfacl -s u::rwx,g::---,o::---,u:b:r-x z
Usage: setfacl [-bkndRLP] { -m|-M|-x|-X ... } file ...
Try `setfacl --help' for more information.

$ setfacl -ms u::rwx,g::---,o::---,u:b:r-x z
setfacl: Option -m: Invalid argument near character 1

$ setfacl -sm u::rwx,g::---,o::---,u:b:r-x z
Usage: setfacl [-bkndRLP] { -m|-M|-x|-X ... } file ...
Try `setfacl --help' for more information.
Still no CUBAN CIGAR (no success) with the "-s" option:

Why doesn't anything multiple and/or option "-s" from ibm's tutorial work on linux? Why don't so many manfiles on my system have certain options that the same command would have on websites like ibm and dice.com?

Last edited by andrew.comly; 07-20-2017 at 08:33 AM. Reason: gross errors
 
Old 07-20-2017, 11:42 AM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Maybe you shouldn't read documentation written for an other platform?
https://linux.die.net/man/1/setfacl
 
1 members found this post helpful.
Old 07-21-2017, 09:16 AM   #3
andrew.comly
Member
 
Registered: Dec 2012
Distribution: Trisquel-Mini 7.0, Lubuntu 14.04, Debian lxde 8.0
Posts: 311

Original Poster
Blog Entries: 2

Rep: Reputation: 16
Lightbulb I missed that it was for some other platform, thanks.

Quote:
Originally Posted by NevemTeve View Post
Maybe you shouldn't read documentation written for an other platform?
https://linux.die.net/man/1/setfacl
Again, it looks like die.net really has quite a lot to offer, great suggestion.

Copying the ACL of one file to another:
Code:
-rw-rw-r--+ 1 a a      0  7月 18 21:56 y
-rwxrwx---+ 1 a a      0  7月 18 21:56 z

$ getfacl y | setfacl --set-file=- z

$ ll y z
-rw-rw-r--+ 1 a a 0  7月 18 21:56 y
-rw-rw-r--+ 1 a a 4  7月 21 09:43 z
I then was able to successfully copy the access ACL into the Default ACL:
Code:
$ ll
...
drwxrwxr-x  3 a a   4.0K  7月 10 07:29 dir

$ getfacl --access dir | setfacl -d -M- dir

$ ll
...
drwxrwxr-x+ 3 a a   4.0K  7月 10 07:29 dir
All is well again!

Last edited by andrew.comly; 07-24-2017 at 02:26 AM. Reason: conclusion
 
  


Reply

Tags
cli, permissions, setfacl



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
setfacl to provide user access to /var/log does not work Curiosity42 Red Hat 19 02-16-2013 05:53 AM
Ubuntu Jaunty resolution doesn't work on IBM TP770 stevenpotter Linux - Newbie 0 07-08-2009 01:31 AM
IBM keyboard special keys not working - setkeycodes doesn't seem to work harmonator Linux - Hardware 0 03-19-2009 03:38 PM
Same Wireless Wireless Module Doesn't Work in Different Places-IBM Thinkpad T30 wkdude18 Linux - Wireless Networking 3 07-02-2008 07:11 PM
IBM Thinkpad R40 - Sound tests fine during install but doesn't work after! sfunk1x Linux - Laptop and Netbook 2 01-26-2005 07:06 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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