chiark / gitweb /
Makefile: remove exec_prefix and srcdir
[elogind.git] / udev_libc_wrapper.c
index 1852141c9378c7baa9b389013ed838a90a2d9871..fe38993cd729be146090b76b15b439db966ef64f 100644 (file)
@@ -102,7 +102,7 @@ uid_t lookup_user(const char *user)
 
        pw = getpwnam(user);
        if (pw == NULL)
-               dbg("specified user unknown '%s'", user);
+               info("specified user unknown '%s'", user);
        else
                uid = pw->pw_uid;
 
@@ -116,7 +116,7 @@ gid_t lookup_group(const char *group)
 
        gr = getgrnam(group);
        if (gr == NULL)
-               dbg("specified group unknown '%s'", group);
+               info("specified group unknown '%s'", group);
        else
                gid = gr->gr_gid;
 
@@ -144,7 +144,7 @@ static unsigned long get_id_by_name(const char *uname, const char *dbfile)
        char *tail;
 
        if (file_map(dbfile, &buf, &bufsize) != 0) {
-               dbg("can't open '%s' as db file", dbfile);
+               err("can't open '%s' as db file: %s", dbfile, strerror(errno));
                return 0;
        }
        dbg("search '%s' in '%s'", uname, dbfile);
@@ -159,7 +159,8 @@ static unsigned long get_id_by_name(const char *uname, const char *dbfile)
                if (count >= sizeof(line))
                        continue;
 
-               strlcpy(line, bufline, count);
+               memcpy(line, bufline, count-1);
+               line[count-1] = '\0';
                pos = line;
 
                /* get name */