Sponsored Content
Top Forums UNIX for Advanced & Expert Users Linux capabilities discussion Post 302838755 by Corona688 on Tuesday 30th of July 2013 11:37:41 AM
Old 07-30-2013
Quote:
Originally Posted by leghorn
Also another question , If I compile the kernel that I'm currently using , what'll happen ?
The kernel is loaded at boot, and thereafter does not care what happens to the kernel files on disk except for modules.

If you have rebuilt your modules with new options, it's possible that it will have changed too far for your old kernel to load them anymore.

Generally, it'd be better to compile a new, separate kernel than to replace your old one -- that way you've got a backup, if the new one turns out to be broken in some way. I think (but aren't 100% positive) that's what "local version" is for, so that make install saves to /lib/modules/2.6.27-dirname-localversion instead of the /lib/modules/2.6.27-dirname your system came with. modprobe and the like ought to know the difference and do the right thing after you've rebooted into your new kernel.
 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix Capabilities?

We are looking into buying a new software, billing software that is, and want to know if you can run that on the same UNIX server as another major software? Is there a limit to the different types of software Unix can run, or is it like windows where you can install as many as you like? ... (2 Replies)
Discussion started by: hoz
2 Replies

2. SuSE

Restoration of Multimedia Capabilities in Red Hat Linux 9

Hello There Is there any way round to restore the multimedia capabilities in Red Hat Linux 9 which were withdrawn by Red Hat due to non-standardization of formats like MP3? Is it possible to listen to MP3s in XMMS Player or view Movies in Xine again as it was in Red Hat Linux 7.3? Furthermore, I... (5 Replies)
Discussion started by: Jawwad
5 Replies

3. UNIX for Advanced & Expert Users

p570 Capabilities

Hi there. I've been tasked with making a new design for our Unix systems :eek: Now the question I have is; How many LPARs can a p570 hold WITHOUT using a VIO Server. Many Thanks Kees (1 Reply)
Discussion started by: KeesH
1 Replies

4. Red Hat

Adding capabilities to an RPM

Hi. I downloaded a package that could only be installed on RHEL5, and not 4 or 3, so I got the source in order to compile it on RHEL 3 so hopefully it will work on all versions. So I have the source for a working package, but when I build it in RHEL 3 and then try to install it in RHEL 5, it... (6 Replies)
Discussion started by: Boaz
6 Replies

5. UNIX for Advanced & Expert Users

Use of Capabilities

I wonder if anyone could assist with some problems I'm having with Linux Capabilities and their use when using the commands "nice" and "schedtool". I run a couple of PCs, one is an elderly AMD Sempron 2800+ (32-bit, 2GHz clock and 3GB memory) that is used as a family multimedia system running... (3 Replies)
Discussion started by: MikeGM
3 Replies

6. UNIX for Advanced & Expert Users

CentOS7 restoring file capabilities

Quite an obscure question I think. We have a rebuild process for remote sites that allows us to PXE rebuild a till (actually a PC with a touch screen and various fancy bits) running CentOS. The current CentOS5 tills work just fine with a tar image restore and some personalisation. Sadly,... (4 Replies)
Discussion started by: rbatte1
4 Replies
CAPGET(2)						     Linux Programmer's Manual							 CAPGET(2)

NAME
capget, capset - set/get capabilities of thread(s) SYNOPSIS
#undef _POSIX_SOURCE #include <sys/capability.h> 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 effective capabilities identifying which capabilities (if any) it may currently exercise. Each thread also has a set of inheritable capa- bilities that may be passed through an execve(2) call, and a set of permitted capabilities that it can make effective or inheritable. These two functions are the raw kernel interface for getting and setting thread capabilities. Not only are these system calls specific to Linux, but the kernel API is likely to change and use of these functions (in particular the format of the cap_user_*_t types) is subject to extension with each kernel revision, but old programs will keep working. 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 structures 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; effective, permitted, inheritable are bitmasks of the capabilities defined in capability(7). Note the CAP_* values are bit indexes and need to be bit-shifted before ORing into the bit fields. To define the structures for passing to the system call you have to use the struct __user_cap_header_struct and struct __user_cap_data_struct names because the typedefs are only pointers. Kernels prior to 2.6.25 prefer 32-bit capabilities with version _LINUX_CAPABILITY_VERSION_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 capabilities 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 equivalent. 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 nonzero, 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 process 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. 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. ERRORS
EFAULT Bad memory address. hdrp must not be NULL. datap may only be NULL when the user is trying to determine the preferred capability 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 permitted. For kernels lacking VFS support, the CAP_SETPCAP capability 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 nonzero 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.25 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 2009-01-26 CAPGET(2)
All times are GMT -4. The time now is 01:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy