Class: CapNG::State
- Inherits:
-
Object
- Object
- CapNG::State
- Defined in:
- ext/capng/state.c,
ext/capng/state.c
Overview
Handle CapNG state.
Instance Method Summary collapse
-
#initialize ⇒ nil
constructor
Initalize State class.
-
#restore ⇒ nil
Restore saved capability state.
-
#save ⇒ nil
Save current capability state.
Constructor Details
#initialize ⇒ nil
Initalize State class.
77 78 79 80 81 82 83 84 85 86 |
# File 'ext/capng/state.c', line 77
static VALUE
rb_capng_state_initialize(VALUE self)
{
struct CapNGState* capng_state;
TypedData_Get_Struct(self, struct CapNGState, &rb_capng_state_type, capng_state);
capng_state->state = NULL;
return Qnil;
}
|
Instance Method Details
#restore ⇒ nil
Restore saved capability state.
115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'ext/capng/state.c', line 115
static VALUE
rb_capng_state_restore(VALUE self)
{
struct CapNGState* capng_state;
void* state = NULL;
TypedData_Get_Struct(self, struct CapNGState, &rb_capng_state_type, capng_state);
state = capng_state->state;
capng_restore_state(&state);
return Qnil;
}
|
#save ⇒ nil
Save current capability state.
94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'ext/capng/state.c', line 94
static VALUE
rb_capng_state_save(VALUE self)
{
struct CapNGState* capng_state;
void* state = NULL;
TypedData_Get_Struct(self, struct CapNGState, &rb_capng_state_type, capng_state);
state = capng_save_state();
capng_state->state = state;
return Qnil;
}
|