diff options
Diffstat (limited to 'lib/Utils')
-rw-r--r-- | lib/Utils/parse_release.cpp | 2 | ||||
-rw-r--r-- | lib/Utils/xfuncs.cpp | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/Utils/parse_release.cpp b/lib/Utils/parse_release.cpp index 33d3edb1..b96cab76 100644 --- a/lib/Utils/parse_release.cpp +++ b/lib/Utils/parse_release.cpp @@ -11,6 +11,7 @@ void parse_release(const char *pRelease, string& pProduct, string& pVersion) { pProduct = "Fedora"; pVersion = "rawhide"; + VERB3 log("%s:Version is '%s' and product is '%s'",__func__, pVersion.c_str(), pProduct.c_str()); return; } if (strstr(pRelease, "Fedora")) @@ -35,4 +36,5 @@ void parse_release(const char *pRelease, string& pProduct, string& pVersion) } space++; } + VERB3 log("%s:Version is '%s' and product is '%s'",__func__, pVersion.c_str(), pProduct.c_str()); } diff --git a/lib/Utils/xfuncs.cpp b/lib/Utils/xfuncs.cpp index 97c2f763..4b208a9e 100644 --- a/lib/Utils/xfuncs.cpp +++ b/lib/Utils/xfuncs.cpp @@ -368,3 +368,14 @@ bool string_to_bool(const char *s) return true; return false; } + +bool xgetpwnam(const char* login, uid_t *uid) +{ + struct passwd* pwd = getpwnam(login); + if (pwd == NULL) + return false; + + *uid = pwd->pw_uid; + return true; +} + |