XATTR_GET(3) 1 XATTR_GET(3)xattr_get - Get an extended attributeSYNOPSIS
string xattr_get (string $filename, string $name, [int $flags])
DESCRIPTION
This function gets the value of an extended attribute of a file.
Extended attributes have two different namespaces: user and root. The user namespace is available to all users, while the root namespace is
available only to users with root privileges. xattr operates on the user namespace by default, but this can be changed with the $flags
parameter.
PARAMETERS
o $filename
- The file from which we get the attribute.
o $name
- The name of the attribute.
o $flags
-
Supported xattr flags
+-----------------+---------------------------------------------------+
| | |
|XATTR_DONTFOLLOW | |
| | |
| | Do not follow the symbolic link but operate on |
| | symbolic link itself. |
| | |
| | |
| XATTR_ROOT | |
| | |
| | Set attribute in root (trusted) namespace. |
| | Requires root privileges. |
| | |
+-----------------+---------------------------------------------------+
RETURN VALUES
Returns a string containing the value or FALSE if the attribute doesn't exist.
EXAMPLES
Example #1
Checks if system administrator has signed the file
<?php
$file = '/usr/local/sbin/some_binary';
$signature = xattr_get($file, 'Root signature', XATTR_ROOT);
/* ... check if $signature is valid ... */
?>
SEE ALSO xattr_list(3), xattr_set(3), xattr_remove(3).
PHP Documentation Group XATTR_GET(3)
Check Out this Related Man Page
XATTR_LIST(3) 1 XATTR_LIST(3)xattr_list - Get a list of extended attributesSYNOPSIS
array xattr_list (string $filename, [int $flags])
DESCRIPTION
This functions gets a list of names of extended attributes of a file.
Extended attributes have two different namespaces: user and root. The user namespace is available to all users, while the root namespace is
available only to users with root privileges. xattr operates on the user namespace by default, but this can be changed with the $flags
parameter.
PARAMETERS
o $filename
- The path of the file.
o $flags
-
Supported xattr flags
+-----------------+---------------------------------------------------+
| | |
|XATTR_DONTFOLLOW | |
| | |
| | Do not follow the symbolic link but operate on |
| | symbolic link itself. |
| | |
| | |
| XATTR_ROOT | |
| | |
| | Set attribute in root (trusted) namespace. |
| | Requires root privileges. |
| | |
+-----------------+---------------------------------------------------+
RETURN VALUES
This function returns an array with names of extended attributes.
EXAMPLES
Example #1
Prints names of all extended attributes of file
<?php
$file = 'some_file';
$root_attributes = xattr_list($file, XATTR_ROOT);
$user_attributes = xattr_list($file);
echo "Root attributes:
";
foreach ($root_attributes as $attr_name) {
printf("%s
", $attr_name);
}
echo "
User attributes:
";
foreach ($attributes as $attr_name) {
printf("%s
", $attr_name);
}
?>
SEE ALSO xattr_get(3).
PHP Documentation Group XATTR_LIST(3)
Hi,
Is it possible to create a user in Linux 8.0 with all the attribute and the privilages of super user (root). Without using root as the logg in name.
Thanx (6 Replies)
Hi ,,,
I create new user on AIX 5.2 but the user have privileges root user
Why the user have privileges root user although the user specification not the same specification root user ???
PLease help me ... (6 Replies)
Hello,
As admin with root rights, to execute any command from another user without password-ask, I do : su - <user> -c "<cmd>"
But how can I do to give the same rights to another physical user without using root user ? :confused:
I've try to create another user "toor" with the same primary... (4 Replies)
Hi All,
I changed the root user home directory to /home/root for some testing purpose, afterwards the logged user name its showing "I have no name" instead of root and also when we want to su to root its giving root user doesnot exist, so I tried to add the root user then its giving root user... (3 Replies)
Hello everyone
I have a question ?
Its possible to create another user exactly as root?
If not its possible what options I have to create a user like root.
Thanks for your comments.
Greetings (5 Replies)
Hi everyone hope you can help me
i have 5 root users and the problem with that is how can you see
witch root user did what on the box how can you track the users that
played on the servers.
1) What commands they typed (in linux you get history )
2) From witch ip did they connect to the server (3 Replies)
Hi I am using UNIX .
I do not have root acces .
How do i check different users cronjobs .Is there any command to check using mutiple users in one shot
With user : AAA i can get all cronjob using crontab -l AAA
similarly with user BBB i can get all cron entries . For that i need to login as... (5 Replies)