summaryrefslogtreecommitdiff
path: root/libudev/libudev-device.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2009-06-28 02:21:58 +0200
committerKay Sievers <kay.sievers@vrfy.org>2009-06-28 02:21:58 +0200
commitb25a94549ce37cd7654f6f44b66944375919db58 (patch)
tree79ed16fcd6b09cc0bbb5b5dea5b388dbf903b658 /libudev/libudev-device.c
parentb53c3a21b9992915f89624f60e85fe50b7aad4ad (diff)
do not exports properties starting with a '.'
Private variables can be marked like: ENV{.FOO}="bar"
Diffstat (limited to 'libudev/libudev-device.c')
-rw-r--r--libudev/libudev-device.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c
index 669c51e35b..951f78aa5c 100644
--- a/libudev/libudev-device.c
+++ b/libudev/libudev-device.c
@@ -1211,14 +1211,20 @@ static int update_envp_monitor_buf(struct udev_device *udev_device)
s = udev_device->monitor_buf;
l = MONITOR_BUF_SIZE;
udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) {
+ const char *key;
+
+ key = udev_list_entry_get_name(list_entry);
+ /* skip private variables */
+ if (key[0] == '.')
+ continue;
+
/* add string to envp array */
udev_device->envp[i++] = s;
if (i+1 >= ENVP_SIZE)
return -EINVAL;
/* add property string to monitor buffer */
- l = util_strpcpyl(&s, l, udev_list_entry_get_name(list_entry), "=",
- udev_list_entry_get_value(list_entry), NULL);
+ l = util_strpcpyl(&s, l, key, "=", udev_list_entry_get_value(list_entry), NULL);
if (l == 0)
return -EINVAL;
s++;