From: František Dvořák Date: Wed, 23 Oct 2013 18:07:07 +0000 (+0200) Subject: Use exact types for UID/GID as required in dmlite. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=a64ac3f3e77900aa64d101267667bd38974edb6c;p=dmlite-plugins-vfs-old.git Use exact types for UID/GID as required in dmlite. --- diff --git a/src/VfsAuthn.cpp b/src/VfsAuthn.cpp index 33656fb..670971a 100644 --- a/src/VfsAuthn.cpp +++ b/src/VfsAuthn.cpp @@ -573,8 +573,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);