chiark / gitweb /
util: file_is_priv_sticky() is used internally in util.c only nowadays, make it static
authorLennart Poettering <lennart@poettering.net>
Fri, 7 Nov 2014 00:19:14 +0000 (01:19 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 7 Nov 2014 00:19:56 +0000 (01:19 +0100)
src/shared/util.c
src/shared/util.h

index ba86d206150cc92e0b43954d12dfb6d21404e1e6..3eb8a0f44210ff3935f5176eb79c915480ccf106 100644 (file)
@@ -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",
index 4997225d832872e4a2146d1f65ecc5b62e3be9b0..24480be682c3f51d8f83a7586a8102b52ed2ce51 100644 (file)
@@ -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)