static void sehandle_fini(int close_status) { if (sehandle) { selabel_close(sehandle); sehandle = NULL; } if (close_status) { selinux_status_close(); } }
void dpkg_selabel_close(void) { #ifdef WITH_LIBSELINUX if (sehandle == NULL) return; selinux_status_close(); selabel_close(sehandle); sehandle = NULL; #endif }
rpmRC rpmtsSELabelInit(rpmts ts, int open_status) { #if WITH_SELINUX const char * path = selinux_file_context_path(); if (ts == NULL || path == NULL) { return RPMRC_FAIL; } if (open_status) { selinux_status_close(); if (selinux_status_open(0) < 0) { return RPMRC_FAIL; } } else if (!selinux_status_updated() && ts->selabelHandle) { return RPMRC_OK; } struct selinux_opt opts[] = { { .type = SELABEL_OPT_PATH, .value = path} };