From 8ad6cfa33d6a37605599be5673c4acecc7eca5af Mon Sep 17 00:00:00 2001 From: gramanas Date: Sun, 28 Oct 2018 11:41:49 +0200 Subject: Add root attribute in list, finish manpage --- src/ckutil.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/ckutil.c') diff --git a/src/ckutil.c b/src/ckutil.c index f292e8e..06d12da 100644 --- a/src/ckutil.c +++ b/src/ckutil.c @@ -180,3 +180,16 @@ int util_own_grp_copy(const char *dest, const char *original) { } return 0; } + +int util_is_link_owned_by_root(const char *link) { + if (!link) { + return 0; + } + struct stat buf; + if (!lstat(link, &buf)) { + if (buf.st_uid == (uid_t)0) { + return 1; + } + } + return 0; +} -- cgit v1.2.3