diff options
author | Kay Sievers <kay@vrfy.org> | 2012-07-05 17:33:24 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2012-07-05 17:33:24 +0200 |
commit | 47ef94ac5f39db6c5c18be10afe32397a0a8d5cc (patch) | |
tree | 2a6872d28ae5d6c7f4b7a73a9765dccace762e03 | |
parent | daa9cf546ce7265645ced9592dd54c6b2fc04302 (diff) |
udev: add some O_CLOEXEC
-rw-r--r-- | src/libudev/libudev-queue-private.c | 2 | ||||
-rw-r--r-- | src/udev/cdrom_id/cdrom_id.c | 2 | ||||
-rw-r--r-- | src/udev/keymap/keymap.c | 6 | ||||
-rw-r--r-- | src/udev/scsi_id/scsi_id.c | 2 | ||||
-rw-r--r-- | src/udev/udev-event.c | 2 | ||||
-rw-r--r-- | src/udev/udev-rules.c | 8 | ||||
-rw-r--r-- | src/udev/udevd.c | 8 |
7 files changed, 15 insertions, 15 deletions
diff --git a/src/libudev/libudev-queue-private.c b/src/libudev/libudev-queue-private.c index 3df99bef3..367395d98 100644 --- a/src/libudev/libudev-queue-private.c +++ b/src/libudev/libudev-queue-private.c @@ -214,3 +214,3 @@ static int rebuild_queue_file(struct udev_queue_export *udev_queue_export) /* create new queue file */ - new_queue_file = fopen("/run/udev/queue.tmp", "w+"); + new_queue_file = fopen("/run/udev/queue.tmp", "w+e"); if (new_queue_file == NULL) diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c index a199dd7dd..74c5165e2 100644 --- a/src/udev/cdrom_id/cdrom_id.c +++ b/src/udev/cdrom_id/cdrom_id.c @@ -127,3 +127,3 @@ static bool is_mounted(const char *device) - fp = fopen("/proc/self/mountinfo", "r"); + fp = fopen("/proc/self/mountinfo", "re"); if (fp == NULL) diff --git a/src/udev/keymap/keymap.c b/src/udev/keymap/keymap.c index a2e43f92c..051aa4255 100644 --- a/src/udev/keymap/keymap.c +++ b/src/udev/keymap/keymap.c @@ -412,3 +412,3 @@ int main(int argc, char **argv) /* Keymap file argument is a path */ - FILE *f = fopen(filearg, "r"); + FILE *f = fopen(filearg, "re"); if (f) @@ -423,3 +423,3 @@ int main(int argc, char **argv) snprintf(keymap_path, sizeof(keymap_path), "%s%s", SYSCONFDIR "/udev/keymaps/", filearg); - f = fopen(keymap_path, "r"); + f = fopen(keymap_path, "re"); if (f) { @@ -428,3 +428,3 @@ int main(int argc, char **argv) snprintf(keymap_path, sizeof(keymap_path), "%s%s", UDEVLIBEXECDIR "/keymaps/", filearg); - f = fopen(keymap_path, "r"); + f = fopen(keymap_path, "re"); if (f) diff --git a/src/udev/scsi_id/scsi_id.c b/src/udev/scsi_id/scsi_id.c index dd8517ba9..6fc41e94f 100644 --- a/src/udev/scsi_id/scsi_id.c +++ b/src/udev/scsi_id/scsi_id.c @@ -182,3 +182,3 @@ static int get_file_options(struct udev *udev, - fd = fopen(config_file, "r"); + fd = fopen(config_file, "re"); if (fd == NULL) { diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index e6f405b74..aff14878a 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -752,3 +752,3 @@ static void rename_netif_kernel_log(struct ifreq ifr) - klog = open("/dev/kmsg", O_WRONLY); + klog = open("/dev/kmsg", O_WRONLY|O_CLOEXEC); if (klog < 0) diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index b5b54dd04..c571c8287 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -747,3 +747,3 @@ static int import_file_into_properties(struct udev_device *dev, const char *file - f = fopen(filename, "r"); + f = fopen(filename, "re"); if (f == NULL) @@ -1647,3 +1647,3 @@ static int parse_file(struct udev_rules *rules, const char *filename) - f = fopen(filename, "r"); + f = fopen(filename, "re"); if (f == NULL) @@ -2324,3 +2324,3 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event - f = fopen("/proc/cmdline", "r"); + f = fopen("/proc/cmdline", "re"); if (f != NULL) { @@ -2609,3 +2609,3 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event rule->rule.filename_line); - f = fopen(attr, "w"); + f = fopen(attr, "we"); if (f != NULL) { diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 393e2a920..176e4e293 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -809,3 +809,3 @@ static void static_dev_create_from_modules(struct udev *udev) util_strscpyl(modules, sizeof(modules), ROOTPREFIX "/lib/modules/", kernel.release, "/modules.devname", NULL); - f = fopen(modules, "r"); + f = fopen(modules, "re"); if (f == NULL) @@ -873,3 +873,3 @@ static int mem_size_mb(void) - f = fopen("/proc/meminfo", "r"); + f = fopen("/proc/meminfo", "re"); if (f == NULL) @@ -909,3 +909,3 @@ static int convert_db(struct udev *udev) - f = fopen("/dev/kmsg", "w"); + f = fopen("/dev/kmsg", "we"); if (f != NULL) { @@ -1266,3 +1266,3 @@ int main(int argc, char *argv[]) - f = fopen("/dev/kmsg", "w"); + f = fopen("/dev/kmsg", "we"); if (f != NULL) { |