chiark / gitweb /
shared: add formats-util.h
[elogind.git] / src / login / logind-acl.c
index b76e16d9062a64a6d3b436c604cca59dba2d1a5e..466225d69c7e84ee2a10300cabaef99f2b04dffe 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <assert.h>
 #include <errno.h>
 #include <string.h>
 #include <errno.h>
 #include <string.h>
-#include <sys/acl.h>
-#include <acl/libacl.h>
 
 #include "util.h"
 
 #include "util.h"
+#include "formats-util.h"
 #include "acl-util.h"
 #include "set.h"
 #include "logind-acl.h"
 #include "acl-util.h"
 #include "set.h"
 #include "logind-acl.h"
@@ -190,7 +188,7 @@ int devnode_acl_all(struct udev *udev,
 
         assert(udev);
 
 
         assert(udev);
 
-        nodes = set_new(string_hash_func, string_compare_func);
+        nodes = set_new(&string_hash_ops);
         if (!nodes)
                 return -ENOMEM;
 
         if (!nodes)
                 return -ENOMEM;
 
@@ -256,8 +254,7 @@ int devnode_acl_all(struct udev *udev,
                 FOREACH_DIRENT(dent, dir, return -errno) {
                         _cleanup_free_ char *unescaped_devname = NULL;
 
                 FOREACH_DIRENT(dent, dir, return -errno) {
                         _cleanup_free_ char *unescaped_devname = NULL;
 
-                        unescaped_devname = cunescape(dent->d_name);
-                        if (!unescaped_devname)
+                        if (cunescape(dent->d_name, UNESCAPE_RELAX, &unescaped_devname) < 0)
                                 return -ENOMEM;
 
                         n = strappend("/dev/", unescaped_devname);
                                 return -ENOMEM;
 
                         n = strappend("/dev/", unescaped_devname);