3

execveat is handled by do_open_execat, which specifies that it wants to be able to open the target file for execution. The file opening procedure is handled via do_filp_open and path_openat, with a path-walking process which is documented separately. The result of all this, regardless of how the process starts, is a struct file and its associated struct ...


3

Try this: #!/bin/bash while read file; do stat -c '%A %n' "$file" >> $(stat -c '%a' "$file").txt done < <(find "$1") Usage: ./script.sh /path/to/directory the first stat -c '%A %n' "$file" prints the permissions and path to the file, e.g. -rw-rw-rw- /foo/bar the second stat -c '%a' "$file" prints the permissions in octal form, e.g. ...


2

Non-privileged users cannot shutdown a machine from command line. If you absolutely need to send shutdown as Bob, you can add him to sudoers using visudo. sudo visudo Add the following line to is: bob ALL = (root) NOPASSWD: /sbin/shutdown -h "now" Save file. Then you can su as bob and test the command: sudo /sbin/shutdown -h "now"


2

If you own the file then you can pretty much do anything with it and filesystem permissions won't stop you. Permissions such as "000" aren't designed to protect you from yourself, it's to protect files from other people using the same system. So if you have one person who logs in as 'user1' and another who logs in as 'user2' then filesystem permissions can ...


2

To avoid getting permission errors from find, you would have to avoid provoking these errors. You do that by avoiding entering directories that are not accessible. Find and display the pathnames of directories that are not readable by the current user, but don't descend into them, GNU find style: find / -type d ! -readable -prune The -prune action ...


2

The problem was solved by deleting the configuration directory /home/kurt/.config/chromium/ Chromium was able to run and generate new configuration files, free of permission issues. Thank you for the edits and comments


2

As you can see from your debug output, when you set mode to 2777, it is interpreted as a decimal number, so the (octal) mode applied is 05331. You need to change mode: 2777 to mode: 02777 or mode: '2777' for ansible to recognize it as octal. From ansible template module: "You must either add a leading zero so that Ansible's YAML parser knows it is an ...


2

Unlinking access.txt from the directory is not a change to access.txt, but a change to the directory, so user2's write permission on the directory is what is relevant. The write permission on the file would be of interest if user2 wanted to modify the file, rather than the containing directory.


1

What kind of permissions are recorded in open file description, does it contain a full ACL No. No "permissions" are kept in the "open file description" (struct file) beyond the file access modes and the file status flags which could be retrieved with fcntl(F_GETFL) or via /proc/PID/fdinfo/FD. All the file permissions are held in the struct inode referenced ...


1

You don't delete files, you remove their entry from a directory. You need directory write permission to do this. (this permission exists in your example). You may want to look at the sticky bit. Apply it to the directory i.e. chmod +t …/logs/d. This will make it so that only the owner (and user with capability CAP_DAC_OVERRIDE e.g. root) can remove a file ...


1

The ro group has full permissions to that directory which means that any of its members can delete or modify files or directories inside whether they own them or not and regardless of the file permissions. If you only want the group members to be able to read the files inside, either change the group to john or remove write permissions for the group. Do one ...


1

MS-Windows sets the execute bit on every file. (One of the reasons for its poorer security). noexec is the option to disable excitability. Using the umask will stop directories from being traversable, because directories need execute permission. Therefore mount with option noexec.


1

With a default of 002, any user in the group associated with my username will be able to edit my files. The idea isn't that there would be other users in the user's personal group. The idea is that there might be groups for projects or such, and they might have multiple users as members. The group owner of the files can then be the project (not any of the ...


1

You are unlikely to find many commands (if any) that have an option to suppress error messages. This is because it's trivial to discard stderr with a construct such as 2>/dev/null. In particular, find does not have such an option natively.


1

The comparison to file descriptors is highly misleading: the current and root directory of a process are not file descriptors or any kind of pointers to an "open file description" (a struct file), but just pointers to directory entries (struct dentrys). The kernel does not keep an open file description referring to the directory inode pointed by either the ...


1

There's no convenient way. That's why GNU find added -readable and friends. You can build an expression that approximates the permission test by enumerating the groups that the user is in. Untested. can_access="( -user $(id -u) -perm -0${oct}00 -o (" for g in $(id -G); do can_access="$can_access -group $g -o" done can_access="${can_access% -o} ) -perm -...


1

SELinux is there for a reason. It enforces access restrictions above the standard file system permissions and really makes your server more secure. You should try to make this work with SELinux enforced :-) You need to figure out which TeemIP web directories are to be readonly and which are to be writable by Apache. Then, using the instructions in https://...


1

I had this same problem and in my case it was because I had run out of inotify watches. If this is the case you will see an error when trying to tail -f a long file, as suggested in https://askubuntu.com/questions/154255/how-can-i-tell-if-i-am-out-of-inotify-watches. You can then see which processes are consuming inotify watches with for foo in /proc/*/fd/*;...


1

User accounts serve two purposes. I'm going to refer to "system accounts" and "user accounts". On Ubuntu system accounts all have UID less than 1000. Likewise system groups have GID less than 1000. There are some single user systems which have done away with "user" accounts almost entirely such as Android (though in recent years, we've seen multi-user ...


Only top voted, non community-wiki answers of a minimum length are eligible