summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2019-07-18 04:05:50 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-18 08:29:56 +0200
commitcad6b4ed40e008d42ae62a7257f2f58ee056794d (patch)
tree7e4ef4d7dd665280cbaa1838f8c49089919be71e
parentd902989b74cba94053b57daaa528d05b277ed3dd (diff)
downloadefl-devs/bu5hm4n/buildtest.tar.gz
Eina vpath: remove support of ~username vpath on Windowsdevs/bu5hm4n/buildtest
On Windows, one must be in kernel mode to obtain informations of other users Differential Revision: https://phab.enlightenment.org/D9339
-rw-r--r--src/lib/eina/eina_vpath.c13
-rw-r--r--src/lib/eina/eina_vpath.h4
2 files changed, 10 insertions, 7 deletions
diff --git a/src/lib/eina/eina_vpath.c b/src/lib/eina/eina_vpath.c
index 0717e928e0..c06ee5abe8 100644
--- a/src/lib/eina/eina_vpath.c
+++ b/src/lib/eina/eina_vpath.c
@@ -195,11 +195,11 @@ eina_vpath_shutdown(void)
return EINA_TRUE;
}
+#ifdef HAVE_GETPWENT
static Eina_Bool
_fetch_user_homedir(char **str, const char *name, const char *error)
{
*str = NULL;
-#ifdef HAVE_GETPWENT
struct passwd *pwent;
pwent = getpwnam(name);
@@ -211,12 +211,8 @@ _fetch_user_homedir(char **str, const char *name, const char *error)
*str = pwent->pw_dir;
return EINA_TRUE;
-#else
- ERR("User fetching is disabled on this system\nThe string was: %s", error);
- return EINA_FALSE;
- (void) name;
-#endif
}
+#endif
static int
_eina_vpath_resolve(const char *path, char *str, size_t size)
@@ -232,6 +228,10 @@ _eina_vpath_resolve(const char *path, char *str, size_t size)
}
// ~username/ <- homedir of user "username"
else
+#ifndef HAVE_GETPWENT
+ ERR("User fetching is disabled on this system\nThe string was: %s", path);
+ return 0;
+#else
{
const char *p;
char *name;
@@ -248,6 +248,7 @@ _eina_vpath_resolve(const char *path, char *str, size_t size)
return 0;
path = p;
}
+#endif
if (home)
{
return snprintf(str, size, "%s%s", home, path);
diff --git a/src/lib/eina/eina_vpath.h b/src/lib/eina/eina_vpath.h
index 77c1e35afe..10b7c1edf2 100644
--- a/src/lib/eina/eina_vpath.h
+++ b/src/lib/eina/eina_vpath.h
@@ -81,12 +81,14 @@
*
* @since 1.21
*
+ * @note on Windows, vpath like ~bob/foo is not supported.
+ *
*/
typedef const char * Eina_Vpath;
/**
* Translate a virtual path into a normal path.
- *
+ *
* The return string is a string allocated by malloc and should be freed with
* free() when no longer needed.
*