Data Structures | Functions

ink_cap.h File Reference

POSIX Capability related utilities. More...

#include "ink_mutex.h"
Include dependency graph for ink_cap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  ElevateAccess

Functions

void DebugCapabilities (char const *tag)
 Generate a debug message with the current capabilities for the process.
int PreserveCapabilities ()
 Set capabilities to persist across change of user id.
int RestrictCapabilities ()
 Initialize and restrict the capabilities of a thread.
int EnableCoreFile (bool flag)
 Control generate of core file on crash.
bool restoreRootPriv (uid_t *old_euid=NULL)
bool removeRootPriv (uid_t euid)

Detailed Description

POSIX Capability related utilities.

License

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file ink_cap.h.


Function Documentation

void DebugCapabilities ( char const *  tag  ) 

Generate a debug message with the current capabilities for the process.

Parameters:
tag Debug message tag.

Definition at line 39 of file ink_cap.cc.

References Debug, and is_debug_tag_set.

Referenced by main().

int EnableCoreFile ( bool  flag  ) 

Control generate of core file on crash.

flag sets whether core files are enabled on crash.

Returns:
0 on success, errno on failre.
Parameters:
flag New enable state.

Definition at line 99 of file ink_cap.cc.

References Debug, and Warning.

Referenced by change_uid_gid(), and set_core_size().

int PreserveCapabilities (  ) 

Set capabilities to persist across change of user id.

Returns:
0 on success, non-zero otherwise.

Definition at line 68 of file ink_cap.cc.

References Debug.

Referenced by main().

bool removeRootPriv ( uid_t  euid  ) 

Definition at line 151 of file ink_cap.cc.

References Debug.

Referenced by ElevateAccess::demote().

bool restoreRootPriv ( uid_t *  old_euid = NULL  ) 

Definition at line 167 of file ink_cap.cc.

References Debug.

Referenced by ElevateAccess::elevate().

int RestrictCapabilities (  ) 

Initialize and restrict the capabilities of a thread.

Returns:
0 on success, non-zero otherwise.

Definition at line 79 of file ink_cap.cc.

References Debug.

Referenced by main().