| 298 | } |
| 299 | |
| 300 | static struct selabel_handle * |
| 301 | get_labeling_handle (void) |
| 302 | { |
| 303 | static bool initialized; |
| 304 | static struct selabel_handle *hnd; |
| 305 | if (!initialized) |
| 306 | { |
| 307 | initialized = true; |
| 308 | hnd = selabel_open (SELABEL_CTX_FILE, NULL, 0); |
| 309 | if (!hnd) |
| 310 | error (0, errno, _("warning: security labeling handle failed")); |
| 311 | } |
| 312 | return hnd; |
| 313 | } |
| 314 | |
| 315 | /* Modify file context to match the specified policy. |
| 316 | If an error occurs the file will remain with the default directory |
no outgoing calls
no test coverage detected