From 49ef1dc45bbbb736d6f3d7dd446ea4797139da87 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Wed, 23 Oct 2013 20:07:07 +0200 Subject: [PATCH] Use exact types for UID/GID as required in dmlite. --- src/VfsAuthn.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/VfsAuthn.cpp b/src/VfsAuthn.cpp index 8ee6f45..d74c09f 100644 --- a/src/VfsAuthn.cpp +++ b/src/VfsAuthn.cpp @@ -575,8 +575,16 @@ void VfsAuthn::csvLoad(std::string fileName, void *ctx, std::set& k ptr = s = strdup(line.c_str()); value = strsep(&ptr, "\t"); for (i = 0; i < keys.size() && value; i++) { - if (value[0] != '\0') - values[keys[i]] = std::string(value); + if (value[0] != '\0') { + // exact types required for UID/GID + if (keys[i] == "uid") { + values[keys[i]] = (uid_t)atoi(value); + } else if (keys[i] == "gid") { + values[keys[i]] = (gid_t)atoi(value); + } else { + values[keys[i]] = std::string(value); + } + } value = strsep(&ptr, "\t"); } free(s); -- 1.8.2.3