Lines 29-34
Link Here
|
29 |
*/ |
29 |
*/ |
30 |
|
30 |
|
31 |
#include <sys/types.h> |
31 |
#include <sys/types.h> |
|
|
32 |
|
33 |
#include <linux/capability.h> |
34 |
#include <linux/unistd.h> |
35 |
|
36 |
_syscall2(int, capget, cap_user_header_t, header, cap_user_data_t, data) |
37 |
_syscall2(int, capset, cap_user_header_t, header, const cap_user_data_t, data) |
38 |
|
32 |
#include <sys/stat.h> |
39 |
#include <sys/stat.h> |
33 |
#include <sys/ioctl.h> |
40 |
#include <sys/ioctl.h> |
34 |
#include <sys/wait.h> |
41 |
#include <sys/wait.h> |
Lines 2296-2301
Link Here
|
2296 |
sigset_t sgt; |
2303 |
sigset_t sgt; |
2297 |
struct sigaction sa; |
2304 |
struct sigaction sa; |
2298 |
|
2305 |
|
|
|
2306 |
cap_user_header_t head; |
2307 |
cap_user_data_t data; |
2308 |
|
2309 |
|
2299 |
if (!reload) { |
2310 |
if (!reload) { |
2300 |
|
2311 |
|
2301 |
#if INITDEBUG |
2312 |
#if INITDEBUG |
Lines 2380-2385
Link Here
|
2380 |
} |
2391 |
} |
2381 |
SETSIG(sa, SIGCHLD, chld_handler, SA_RESTART); |
2392 |
SETSIG(sa, SIGCHLD, chld_handler, SA_RESTART); |
2382 |
} |
2393 |
} |
|
|
2394 |
|
2395 |
/* |
2396 |
* This seems like the right place to do this, just before |
2397 |
* we read /etc/inittab... |
2398 |
*/ |
2399 |
|
2400 |
head = malloc(8); |
2401 |
data = malloc(3 * 4); /* three 32 bit numbers... */ |
2402 |
|
2403 |
if (head && data) { |
2404 |
head->pid = 0; |
2405 |
head->version = _LINUX_CAPABILITY_VERSION; |
2406 |
|
2407 |
if (capget(head, data) == 0) { |
2408 |
/* Max out the inheritable capability set. */ |
2409 |
data->inheritable = data->effective; |
2410 |
|
2411 |
if (capset(head, data) == 0) { |
2412 |
log(L_CO, bootmsg, "set inheritable caps"); |
2413 |
} else log(L_CO, bootmsg, |
2414 |
"unable to set inheritable caps"); |
2415 |
} else log(L_CO, bootmsg, "not setting inheritable caps"); |
2416 |
|
2417 |
free(head); |
2418 |
free(data); |
2419 |
|
2420 |
} |
2421 |
|
2383 |
|
2422 |
|
2384 |
/* |
2423 |
/* |
2385 |
* Start normal boot procedure. |
2424 |
* Start normal boot procedure. |