Am 01.06.2017 um 00:34 schrieb Michael Biebl:

> https://github.com/systemd/systemd/blob/master/src/hwdb/hwdb.c#L673
> This computes the path to the cache file:
> hwdb_bin = strjoin(arg_root, "/", arg_hwdb_bin_dir, "/hwdb.bin");
> 
> The result is //lib/udev/hwdb.bin, note the double //

Fwiw, we could stick a
path_kill_slashes(hwdb_bin);
after the strjoin like in the attached patch.

But...

> Afaics, this looks like a libselinux bug to me. It should properly deal
> with paths that have double //.

I think this still applies. libselinux/the selinux policy should deal
with that fact that a path with double slashes is passed on.

Regards,
Michael
-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c
index a9539c812..e52e13b06 100644
--- a/src/hwdb/hwdb.c
+++ b/src/hwdb/hwdb.c
@@ -31,6 +31,7 @@
 #include "hwdb-util.h"
 #include "label.h"
 #include "mkdir.h"
+#include "path-util.h"
 #include "selinux-util.h"
 #include "strbuf.h"
 #include "string-util.h"
@@ -673,6 +674,7 @@ static int hwdb_update(int argc, char *argv[], void *userdata) {
         hwdb_bin = strjoin(arg_root, "/", arg_hwdb_bin_dir, "/hwdb.bin");
         if (!hwdb_bin)
                 return -ENOMEM;
+        path_kill_slashes(hwdb_bin);
 
         mkdir_parents_label(hwdb_bin, 0755);
         r = trie_store(trie, hwdb_bin);

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Pkg-systemd-maintainers mailing list
Pkg-systemd-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-systemd-maintainers

Reply via email to