util: file_is_priv_sticky() is used internally in util.c only nowadays, make it static
This commit is contained in:
parent
25e14499c4
commit
b5e1fad5b1
|
@ -2941,6 +2941,19 @@ int rm_rf_children(int fd, bool only_dirs, bool honour_sticky, struct stat *root
|
|||
return rm_rf_children_dangerous(fd, only_dirs, honour_sticky, root_dev);
|
||||
}
|
||||
|
||||
static int file_is_priv_sticky(const char *p) {
|
||||
struct stat st;
|
||||
|
||||
assert(p);
|
||||
|
||||
if (lstat(p, &st) < 0)
|
||||
return -errno;
|
||||
|
||||
return
|
||||
(st.st_uid == 0 || st.st_uid == getuid()) &&
|
||||
(st.st_mode & S_ISVTX);
|
||||
}
|
||||
|
||||
static int rm_rf_internal(const char *path, bool only_dirs, bool delete_root, bool honour_sticky, bool dangerous) {
|
||||
int fd, r;
|
||||
struct statfs s;
|
||||
|
@ -4829,19 +4842,6 @@ int block_get_whole_disk(dev_t d, dev_t *ret) {
|
|||
return -ENOENT;
|
||||
}
|
||||
|
||||
int file_is_priv_sticky(const char *p) {
|
||||
struct stat st;
|
||||
|
||||
assert(p);
|
||||
|
||||
if (lstat(p, &st) < 0)
|
||||
return -errno;
|
||||
|
||||
return
|
||||
(st.st_uid == 0 || st.st_uid == getuid()) &&
|
||||
(st.st_mode & S_ISVTX);
|
||||
}
|
||||
|
||||
static const char *const ioprio_class_table[] = {
|
||||
[IOPRIO_CLASS_NONE] = "none",
|
||||
[IOPRIO_CLASS_RT] = "realtime",
|
||||
|
|
|
@ -582,8 +582,6 @@ static inline bool _pure_ in_charset(const char *s, const char* charset) {
|
|||
|
||||
int block_get_whole_disk(dev_t d, dev_t *ret);
|
||||
|
||||
int file_is_priv_sticky(const char *p);
|
||||
|
||||
#define NULSTR_FOREACH(i, l) \
|
||||
for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1)
|
||||
|
||||
|
|
Loading…
Reference in New Issue