Bash-Linux.com : Le SHELL pour les nuls

  Actuellement 50 lignes de commande et 1472 man disponibles
login as: root
root@213.186.33.18's password:
Last login: Sun Feb 12 8:19:32 2012 from 38.107.179.229
[root@bash-linux ~] # echo "Bienvenue sur Bash-Linux.com"_
 Manuel des commandes UNIX (man) Version anglaise

Indiquez la fonction :

Man Capset en anglais

CAPGET(2) Linux Programmer's Manual CAPGET(2)
 
NAME


capget, capset - set/get capabilities of thread(s)
 
SYNOPSIS


#undef _POSIX_SOURCE #include int capget(cap_user_header_t hdrp, cap_user_data_t datap); int capset(cap_user_header_t hdrp, const cap_user_data_t datap);
 
DESCRIPTION


As of Linux 2.2, the power of the superuser (root) has been partitioned into a set of discrete capabilities. Each thread has a set of effec- tive capabilities identifying which capabilities (if any) it may cur- rently exercise. Each thread also has a set of inheritable capabili- ties that may be passed through an execve(2) call, and a set of permit- ted capabilities that it can make effective or inheritable. These two functions are the raw kernel interface for getting and set- ting thread capabilities. Not only are these system calls specific to Linux, but the kernel API is likely to change and use of these func- tions (in particular the format of the cap_user_*_t types) is subject to change with each kernel revision. The portable interfaces are cap_set_proc(3) and cap_get_proc(3); if possible you should use those interfaces in applications. If you wish to use the Linux extensions in applications, you should use the easier- to-use interfaces capsetp(3) and capgetp(3). Current details Now that you have been warned, some current kernel details. The struc- tures are defined as follows. #define _LINUX_CAPABILITY_VERSION_1 0x19980330 #define _LINUX_CAPABILITY_U32S_1 1 #define _LINUX_CAPABILITY_VERSION_2 0x20071026 #define _LINUX_CAPABILITY_U32S_2 2 typedef struct __user_cap_header_struct { __u32 version; int pid; } *cap_user_header_t; typedef struct __user_cap_data_struct { __u32 effective; __u32 permitted; __u32 inheritable; } *cap_user_data_t; The calls will fail with the error EINVAL, and set the version field of hdrp to the kernel preferred value of _LINUX_CAPABILITY_VERSION_? when an unsupported version value is specified. In this way, one can probe what the current preferred capability revision is. Kernels prior to 2.6.25 prefer 32-bit capabilities with version _LINUX_CAPABILITY_VER- SION_1, and kernels 2.6.25+ prefer 64-bit capabilities with version _LINUX_CAPABILITY_VERSION_2. Note, 64-bit capabilities use datap[0] and datap[1], whereas 32-bit capabilities only use datap[0]. Another change affecting the behavior of these system calls is kernel support for file capabilities (VFS capability support). This support is currently a compile time option (added in kernel 2.6.24). For capget() calls, one can probe the capabilities of any process by specifying its process ID with the hdrp->pid field value. With VFS Capability Support VFS Capability support creates a file-attribute method for adding capa- bilities to privileged executables. This privilege model obsoletes kernel support for one process asynchronously setting the capabilities of another. That is, with VFS support, for capset() calls the only permitted values for hdrp->pid are 0 or getpid(2), which are equiva- lent. Without VFS Capability Support When the kernel does not support VFS capabilities, capset() calls can operate on the capabilities of the thread specified by the pid field of hdrp when that is non-zero, or on the capabilities of the calling thread if pid is 0. If pid refers to a single-threaded process, then pid can be specified as a traditional process ID; operating on a thread of a multithreaded process requires a thread ID of the type returned by gettid(2). For capset(), pid can also be: -1, meaning perform the change on all threads except the caller and init(8); or a value less than -1, in which case the change is applied to all members of the pro- cess group whose ID is -pid. For details on the data, see capabilities(7).
 
RETURN VALUE


On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
 
ERRORS


EFAULT Bad memory address. hdrp must not be NULL. datap may only be NULL when the user is trying to determine the preferred capabil- ity version format supported by the kernel. EINVAL One of the arguments was invalid. EPERM An attempt was made to add a capability to the Permitted set, or to set a capability in the Effective or Inheritable sets that is not in the Permitted set. EPERM The caller attempted to use capset() to modify the capabilities of a thread other than itself, but lacked sufficient privilege. For kernels supporting VFS capabilities, this is never permit- ted. For kernels lacking VFS support, the CAP_SETPCAP capabil- ity is required. (A bug in kernels before 2.6.11 meant that this error could also occur if a thread without this capability tried to change its own capabilities by specifying the pid field as a non-zero value (i.e., the value returned by getpid(2)) instead of 0.) ESRCH No such thread.
 
CONFORMING TO


These system calls are Linux-specific.
 
NOTES


The portable interface to the capability querying and setting functions is provided by the libcap library and is available here: http://www.kernel.org/pub/linux/libs/security/linux-privs
 
SEE ALSO


clone(2), gettid(2), capabilities(7)
 
COLOPHON


This page is part of release 3.05 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2008-07-14 CAPGET(2)


 Dernières recherches
Man  en anglais Man capset en anglaisMan  en français Man capset en français
Man  en anglais Man passwd en anglaisMan  en français Man passwd en français
Man  en anglais Man getsid en anglaisMan  en français Man getsid en français
Man  en anglais Man remove en anglaisMan  en français Man remove en français
Man  en anglais Man sscanf en anglaisMan  en français Man sscanf en français
Man  en anglais Man execvp en anglaisMan  en français Man execvp en français
Man  en anglais Man listen en anglaisMan  en français Man listen en français
Man  en anglais Man fseeko en anglaisMan  en français Man fseeko en français
Man  en anglais Man access en anglaisMan  en français Man access en français
Man  en anglais Man fflush en anglaisMan  en français Man fflush en français
Man  en anglais Man strtol en anglaisMan  en français Man strtol en français
Man  en anglais Man msgget en anglaisMan  en français Man msgget en français
Man  en anglais Man catman en anglaisMan  en français Man catman en français
Man  en anglais Man semget en anglaisMan  en français Man semget en français
Man  en anglais Man usleep en anglaisMan  en français Man usleep en français

 Recherche

Dans ce moteur de recherche, vous pouvez taper directement votre besoin, en une phrase normale, humaine.
Exemple : vous cherchez comment remplacer un mot par un autre dans tous les fichiers d'un certain dossier. Vous pouvez écrire "Comment remplacer un mot par un autre dans tous les fichiers d'un dossier". Le moteur vous ramenera les résultats en fonction de leur pertinence.
Vous pouvez bien sûr ne chercher qu'un seul mot-clé, par exemple "find".
 Toutes les lignes de code
Par popularité
Par fonction
Recherche avancée
 Les logiciels SHELL/SSH
Putty
Astuces Bash
Faire du SHELL avec PHP!
 La doc officielle
Les man Linux en français
Les man Linux en anglais
 Proposer vos bash
Partagez vos lignes!
 Les requêtes
Déposer une requête
Voir/répondre à une requête
 Quelques sites interessants
Bons sites pour apprendre
 Rechercher