#include "stdio-util.h"
#include "string-table.h"
#include "string-util.h"
+#include "strv.h"
#include "unit-name.h"
#include "user-util.h"
int cg_pid_get_path(const char *controller, pid_t pid, char **path) {
_cleanup_fclose_ FILE *f = NULL;
char line[LINE_MAX];
- const char *fs, *controller_str;
+ const char *fs, *controller_str = NULL;
size_t cs = 0;
int unified;
#if 0 /// UNNEEDED by elogind
extern const gather_stdout_callback_t gather_environment[_STDOUT_CONSUME_MAX];
#endif // 0
-
#include <sys/types.h>
#include "format-util.h"
-#include "ioprio.h"
+//#include "ioprio.h"
#include "macro.h"
#define procfs_file_alloca(pid, field) \
static inline bool nice_is_valid(int n) {
return n >= PRIO_MIN && n < PRIO_MAX;
}
-#endif // 0
static inline bool ioprio_class_is_valid(int i) {
return IN_SET(i, IOPRIO_CLASS_NONE, IOPRIO_CLASS_RT, IOPRIO_CLASS_BE, IOPRIO_CLASS_IDLE);
}
int ioprio_parse_priority(const char *s, int *ret);
+#endif // 0
#define log_enforcing(...) log_full_errno(security_getenforce() == 1 ? LOG_ERR : LOG_DEBUG, errno, __VA_ARGS__)
#endif
-bool mac_selinux_have(void) {
+bool mac_selinux_use(void) {
#ifdef HAVE_SELINUX
if (cached_use < 0)
cached_use = is_selinux_enabled() > 0;
#endif
}
-bool mac_selinux_use(void) {
- if (!mac_selinux_have())
- return false;
-
- /* Never try to configure SELinux features if we aren't
- * root */
-
- return getuid() == 0;
-}
-
void mac_selinux_retest(void) {
#ifdef HAVE_SELINUX
cached_use = -1;
assert(exe);
assert(label);
- if (!mac_selinux_have())
+ if (!mac_selinux_use())
return -EOPNOTSUPP;
r = getcon_raw(&mycon);
assert(label);
#ifdef HAVE_SELINUX
- if (!mac_selinux_have())
+ if (!mac_selinux_use())
return -EOPNOTSUPP;
r = getcon_raw(label);
assert(exe);
assert(label);
- if (!mac_selinux_have())
+ if (!mac_selinux_use())
return -EOPNOTSUPP;
r = getcon_raw(&mycon);
if (!label)
return NULL;
- if (!mac_selinux_have())
+ if (!mac_selinux_use())
return NULL;
return l;
}
+#endif // 0
int strv_extend_n(char ***l, const char *value, size_t n) {
size_t i, j, k;
return -ENOMEM;
}
+#if 0 /// UNNEEDED by elogind
int fputstrv(FILE *f, char **l, const char *separator, bool *space) {
bool b = false;
char **s;
char ***strv_free_free(char ***l);
char **strv_skip(char **l, size_t n);
+#endif // 0
int strv_extend_n(char ***l, const char *value, size_t n);
+#if 0 /// UNNEEDED by elogind
int fputstrv(FILE *f, char **l, const char *separator, bool *space);
#endif // 0