Use exact types for UID/GID as required in dmlite.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 23 Oct 2013 18:07:07 +0000 (20:07 +0200)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Wed, 23 Oct 2013 18:07:07 +0000 (20:07 +0200)
src/VfsAuthn.cpp

index 33656fb..670971a 100644 (file)
@@ -573,8 +573,16 @@ void VfsAuthn::csvLoad(std::string fileName, void *ctx, std::set<std::string>& 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);