summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac5
-rw-r--r--src/lib/elm_cnp.c5
-rw-r--r--src/lib/elm_config.c6
-rw-r--r--src/lib/elm_url.c4
4 files changed, 17 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 7f14077d9..b7fcec9e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -226,6 +226,11 @@ if test "x$want_quicklaunch" != "xno"; then
226fi 226fi
227AM_CONDITIONAL([BUILD_QUICKLAUNCH], [test "x$have_fork" = "xyes" && test "x$have_dlopen" = "xyes"]) 227AM_CONDITIONAL([BUILD_QUICKLAUNCH], [test "x$have_fork" = "xyes" && test "x$have_dlopen" = "xyes"])
228 228
229AC_CHECK_FUNCS([\
230geteuid \
231getuid \
232])
233
229AC_SUBST(dlopen_libs) 234AC_SUBST(dlopen_libs)
230AC_SUBST(lt_enable_auto_import) 235AC_SUBST(lt_enable_auto_import)
231AC_SUBST(ELM_UNIX_DEF) 236AC_SUBST(ELM_UNIX_DEF)
diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index 0d8deabbb..97628973c 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -3514,7 +3514,10 @@ _tempfile_new(int size)
3514 3514
3515 info = calloc(1, sizeof(Tmp_Info)); 3515 info = calloc(1, sizeof(Tmp_Info));
3516 if (!info) return NULL; 3516 if (!info) return NULL;
3517 if (getuid() == getuid()) tmppath = getenv("TMP"); 3517#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
3518 if (getuid() == geteuid())
3519#endif
3520 tmppath = getenv("TMP");
3518 if (!tmppath) tmppath = P_tmpdir; 3521 if (!tmppath) tmppath = P_tmpdir;
3519 len = snprintf(NULL, 0, "%s/%sXXXXXX", tmppath, "elmcnpitem-"); 3522 len = snprintf(NULL, 0, "%s/%sXXXXXX", tmppath, "elmcnpitem-");
3520 if (len < 0) goto on_error; 3523 if (len < 0) goto on_error;
diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index 502eef939..344e3e1e5 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -518,7 +518,9 @@ _elm_config_user_dir_snprintf(char *dst,
518 (dst, size, '/', home, strlen(home), 518 (dst, size, '/', home, strlen(home),
519 ELEMENTARY_BASE_DIR, sizeof(ELEMENTARY_BASE_DIR) - 1); 519 ELEMENTARY_BASE_DIR, sizeof(ELEMENTARY_BASE_DIR) - 1);
520#else 520#else
521 if (getuid() == getuid()) 521#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
522 if (getuid() == geteuid())
523#endif
522 { 524 {
523#ifdef DOXDG 525#ifdef DOXDG
524 home = getenv("XDG_CONFIG_HOME"); 526 home = getenv("XDG_CONFIG_HOME");
@@ -545,6 +547,7 @@ _elm_config_user_dir_snprintf(char *dst,
545#endif 547#endif
546 } 548 }
547 } 549 }
550#if !defined(HAVE_GETUID) || !defined(HAVE_GETEUID)
548 else 551 else
549 { 552 {
550 struct passwd *pw = getpwent(); 553 struct passwd *pw = getpwent();
@@ -561,6 +564,7 @@ _elm_config_user_dir_snprintf(char *dst,
561 ELEMENTARY_BASE_DIR, sizeof(ELEMENTARY_BASE_DIR) - 1); 564 ELEMENTARY_BASE_DIR, sizeof(ELEMENTARY_BASE_DIR) - 1);
562#endif 565#endif
563 } 566 }
567#endif
564#endif 568#endif
565 569
566 off = user_dir_len + 1; 570 off = user_dir_len + 1;
diff --git a/src/lib/elm_url.c b/src/lib/elm_url.c
index c4bbc52ba..2f25ed2dc 100644
--- a/src/lib/elm_url.c
+++ b/src/lib/elm_url.c
@@ -98,7 +98,9 @@ elm_url_download(const char *url, Elm_Url_Done done_cb, Elm_Url_Cancel cancel_cb
98 target = ecore_con_url_new(url); 98 target = ecore_con_url_new(url);
99 if (!target) goto on_error; 99 if (!target) goto on_error;
100 100
101 if (getuid() == getuid()) 101#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
102 if (getuid() == geteuid())
103#endif
102 { 104 {
103 if (getenv("http_proxy")) ecore_con_url_proxy_set(target, getenv("http_proxy")); 105 if (getenv("http_proxy")) ecore_con_url_proxy_set(target, getenv("http_proxy"));
104 if (getenv("https_proxy")) ecore_con_url_proxy_set(target, getenv("https_proxy")); 106 if (getenv("https_proxy")) ecore_con_url_proxy_set(target, getenv("https_proxy"));