forked from enlightenment/efl
Eina vpath: remove support of ~username vpath on Windows
On Windows, one must be in kernel mode to obtain informations of other users Reviewed-by: Carsten Haitzler (Rasterman) <rasterman.com> Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9339
This commit is contained in:
parent
f331d1c6cc
commit
89db9df2d2
|
@ -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);
|
||||
|
|
|
@ -81,6 +81,8 @@
|
|||
*
|
||||
* @since 1.21
|
||||
*
|
||||
* @note on Windows, vpath like ~bob/foo is not supported.
|
||||
*
|
||||
*/
|
||||
typedef const char * Eina_Vpath;
|
||||
|
||||
|
|
Loading…
Reference in New Issue