chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
selinux: fix missing includes
[elogind.git]
/
udev_db.c
diff --git
a/udev_db.c
b/udev_db.c
index 518ace9a5d9822c5e1f7bfb6e9bc70adcbae1f80..1feab7d63f961c995748af74cc45733f82e13cd7 100644
(file)
--- a/
udev_db.c
+++ b/
udev_db.c
@@
-31,6
+31,7
@@
#include <sys/types.h>
#include "udev.h"
#include <sys/types.h>
#include "udev.h"
+#include "udev_selinux.h"
static size_t devpath_to_db_path(const char *devpath, char *filename, size_t len)
static size_t devpath_to_db_path(const char *devpath, char *filename, size_t len)
@@
-144,8
+145,12
@@
int udev_db_add_device(struct udevice *udev)
*/
if (list_empty(&udev->symlink_list) && list_empty(&udev->env_list) &&
!udev->partitions && !udev->ignore_remove) {
*/
if (list_empty(&udev->symlink_list) && list_empty(&udev->env_list) &&
!udev->partitions && !udev->ignore_remove) {
+ int ret;
dbg("nothing interesting to store, create symlink");
dbg("nothing interesting to store, create symlink");
- if (symlink(udev->name, filename) != 0) {
+ selinux_setfscreatecon(filename, NULL, S_IFLNK);
+ ret = symlink(udev->name, filename);
+ selinux_resetfscreatecon();
+ if (ret != 0) {
err("unable to create db link '%s': %s", filename, strerror(errno));
return -1;
}
err("unable to create db link '%s': %s", filename, strerror(errno));
return -1;
}