Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/ws.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,11 +815,11 @@ void Workspace::drop_cap(cap_value_t cap_arg, int dbuid)
// cap_list[0] = CAP_DAC_OVERRIDE;
// cap_list[1] = CAP_CHOWN;

if (cap_set_flag(caps, CAP_PERMITTED, 1, cap_list, CAP_SET) == -1) {
if (cap_set_flag(caps, CAP_PERMITTED, 1, cap_list, CAP_SET) != 0) {
cerr << "Error: problem with capabilities." << endl;
}

if (cap_set_proc(caps) == -1) {
if (cap_set_proc(caps) != 0) {
cerr << "Error: problem dropping capabilities." << endl;
cap_t cap = cap_get_proc();
cerr << "Running with capabilities: " << cap_to_text(cap, NULL) << endl;
Expand Down Expand Up @@ -849,11 +849,11 @@ void Workspace::drop_cap(cap_value_t cap_arg1, cap_value_t cap_arg2, int dbuid)
// cap_list[0] = CAP_DAC_OVERRIDE;
// cap_list[1] = CAP_CHOWN;

if (cap_set_flag(caps, CAP_PERMITTED, 2, cap_list, CAP_SET) == -1) {
if (cap_set_flag(caps, CAP_PERMITTED, 2, cap_list, CAP_SET) != 0) {
cerr << "Error: problem with capabilities." << endl;
}

if (cap_set_proc(caps) == -1) {
if (cap_set_proc(caps) != 0) {
cerr << "Error: problem dropping capabilities." << endl;
cap_t cap = cap_get_proc();
cerr << "Running with capabilities: " << cap_to_text(cap, NULL) << endl;
Expand Down Expand Up @@ -882,11 +882,11 @@ void Workspace::lower_cap(int cap, int dbuid)
caps = cap_get_proc();

cap_list[0] = cap;
if (cap_set_flag(caps, CAP_EFFECTIVE, 1, cap_list, CAP_CLEAR) == -1) {
if (cap_set_flag(caps, CAP_EFFECTIVE, 1, cap_list, CAP_CLEAR) != 0) {
cerr << "Error: problem with capabilities." << endl;
}

if (cap_set_proc(caps) == -1) {
if (cap_set_proc(caps) != 0) {
cerr << "Error: problem lowering capabilities." << endl;
cap_t cap = cap_get_proc();
cerr << "Running with capabilities: " << cap_to_text(cap, NULL) << endl;
Expand Down Expand Up @@ -915,11 +915,11 @@ void Workspace::raise_cap(int cap)
caps = cap_get_proc();

cap_list[0] = cap;
if (cap_set_flag(caps, CAP_EFFECTIVE, 1, cap_list, CAP_SET) == -1) {
if (cap_set_flag(caps, CAP_EFFECTIVE, 1, cap_list, CAP_SET) != 0) {
cerr << "Error: problem with capabilities." << endl;
}

if (cap_set_proc(caps) == -1) {
if (cap_set_proc(caps) != 0) {
cerr << "Error: problem raising capabilities." << endl;
cap_t cap = cap_get_proc();
cerr << "Running with capabilities: " << cap_to_text(cap, NULL) << endl;
Expand Down