diff options
author | Kay Sievers <kay@vrfy.org> | 2012-04-17 02:20:32 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2012-04-17 02:20:32 +0200 |
commit | 3b49d09a3d34ac462573aa96d66c70e9a60417e4 (patch) | |
tree | 6709782fbffe2395fe81c5b655451fff3206964c /src/libudev | |
parent | 9e13dbae509605dba1bde7e7385086b59acb428e (diff) |
udev: kill udev_selinux_setfscreateconat()
Diffstat (limited to 'src/libudev')
-rw-r--r-- | src/libudev/libudev-private.h | 2 | ||||
-rw-r--r-- | src/libudev/libudev-selinux-private.c | 25 |
2 files changed, 0 insertions, 27 deletions
diff --git a/src/libudev/libudev-private.h b/src/libudev/libudev-private.h index 953f589bff..4bdbb0aa24 100644 --- a/src/libudev/libudev-private.h +++ b/src/libudev/libudev-private.h @@ -180,14 +180,12 @@ static inline void udev_selinux_init(struct udev *udev) {} static inline void udev_selinux_exit(struct udev *udev) {} static inline void udev_selinux_lsetfilecon(struct udev *udev, const char *file, unsigned int mode) {} static inline void udev_selinux_setfscreatecon(struct udev *udev, const char *file, unsigned int mode) {} -static inline void udev_selinux_setfscreateconat(struct udev *udev, int dfd, const char *file, unsigned int mode) {} static inline void udev_selinux_resetfscreatecon(struct udev *udev) {} #else void udev_selinux_init(struct udev *udev); void udev_selinux_exit(struct udev *udev); void udev_selinux_lsetfilecon(struct udev *udev, const char *file, unsigned int mode); void udev_selinux_setfscreatecon(struct udev *udev, const char *file, unsigned int mode); -void udev_selinux_setfscreateconat(struct udev *udev, int dfd, const char *file, unsigned int mode); void udev_selinux_resetfscreatecon(struct udev *udev); #endif diff --git a/src/libudev/libudev-selinux-private.c b/src/libudev/libudev-selinux-private.c index e9e65ad41d..03ca168b05 100644 --- a/src/libudev/libudev-selinux-private.c +++ b/src/libudev/libudev-selinux-private.c @@ -82,28 +82,3 @@ void udev_selinux_resetfscreatecon(struct udev *udev) if (setfscreatecon(selinux_prev_scontext) < 0) err(udev, "setfscreatecon failed: %m\n"); } - -void udev_selinux_setfscreateconat(struct udev *udev, int dfd, const char *file, unsigned int mode) -{ - char filename[UTIL_PATH_SIZE]; - - if (!selinux_enabled) - return; - - /* resolve relative filename */ - if (file[0] != '/') { - char procfd[UTIL_PATH_SIZE]; - char target[UTIL_PATH_SIZE]; - ssize_t len; - - snprintf(procfd, sizeof(procfd), "/proc/%u/fd/%u", getpid(), dfd); - len = readlink(procfd, target, sizeof(target)); - if (len <= 0 || len == sizeof(target)) - return; - target[len] = '\0'; - - util_strscpyl(filename, sizeof(filename), target, "/", file, NULL); - file = filename; - } - udev_selinux_setfscreatecon(udev, file, mode); -} |