chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
54693d9
)
build-sys: __secure_getenv lost dunder in libc 2.17
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Sun, 16 Sep 2012 22:21:25 +0000
(
00:21
+0200)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Sun, 16 Sep 2012 22:21:25 +0000
(
00:21
+0200)
TODO
patch
|
blob
|
history
configure.ac
patch
|
blob
|
history
src/core/dbus.c
patch
|
blob
|
history
src/libudev/libudev.c
patch
|
blob
|
history
src/shared/dbus-common.c
patch
|
blob
|
history
src/shared/log.c
patch
|
blob
|
history
src/shared/missing.h
patch
|
blob
|
history
diff --git
a/TODO
b/TODO
index fdeb45c4fb74b49a0a8fa733b6626e81893c23e3..b3c335ee35fd4bc31993d95eadb5cb39b1adc86e 100644
(file)
--- a/
TODO
+++ b/
TODO
@@
-538,7
+538,7
@@
Regularly:
* set_put(), hashmap_put() return values check. i.e. == 0 doesn't free()!
* set_put(), hashmap_put() return values check. i.e. == 0 doesn't free()!
-* use
__
secure_getenv() instead of getenv() where appropriate
+* use secure_getenv() instead of getenv() where appropriate
Scheduled for removal (or fixing):
Scheduled for removal (or fixing):
diff --git
a/configure.ac
b/configure.ac
index da550212ebcc9bb31cfdaf9aca863bd5e12dc4bd..b9891369a14ed9c038c3b2ae4a133cd60150ccf8 100644
(file)
--- a/
configure.ac
+++ b/
configure.ac
@@
-173,6
+173,7
@@
LIBS="$save_LIBS"
AC_SUBST(CAP_LIBS)
AC_CHECK_FUNCS([fanotify_init fanotify_mark name_to_handle_at])
AC_SUBST(CAP_LIBS)
AC_CHECK_FUNCS([fanotify_init fanotify_mark name_to_handle_at])
+AC_CHECK_FUNCS([__secure_getenv secure_getenv])
AC_CHECK_DECLS([gettid, pivot_root], [], [], [[#include <sys/types.h>
#include <unistd.h>
#include <sys/mount.h>]])
AC_CHECK_DECLS([gettid, pivot_root], [], [], [[#include <sys/types.h>
#include <unistd.h>
#include <sys/mount.h>]])
diff --git
a/src/core/dbus.c
b/src/core/dbus.c
index 75773aaa49cf2ad338aed62a2f87e6bafb0b4644..f05f610718e5beb50f72482c429a3e7dd6508844 100644
(file)
--- a/
src/core/dbus.c
+++ b/
src/core/dbus.c
@@
-30,6
+30,7
@@
#include "strv.h"
#include "cgroup.h"
#include "mkdir.h"
#include "strv.h"
#include "cgroup.h"
#include "mkdir.h"
+#include "missing.h"
#include "dbus-unit.h"
#include "dbus-job.h"
#include "dbus-manager.h"
#include "dbus-unit.h"
#include "dbus-job.h"
#include "dbus-manager.h"
@@
-955,12
+956,12
@@
static DBusConnection* manager_bus_connect_private(Manager *m, DBusBusType type)
switch (type) {
case DBUS_BUS_SYSTEM:
switch (type) {
case DBUS_BUS_SYSTEM:
- address =
__
secure_getenv("DBUS_SYSTEM_BUS_ADDRESS");
+ address = secure_getenv("DBUS_SYSTEM_BUS_ADDRESS");
if (!address || !address[0])
address = DBUS_SYSTEM_BUS_DEFAULT_ADDRESS;
break;
case DBUS_BUS_SESSION:
if (!address || !address[0])
address = DBUS_SYSTEM_BUS_DEFAULT_ADDRESS;
break;
case DBUS_BUS_SESSION:
- address =
__
secure_getenv("DBUS_SESSION_BUS_ADDRESS");
+ address = secure_getenv("DBUS_SESSION_BUS_ADDRESS");
if (!address || !address[0])
address = DBUS_SESSION_BUS_DEFAULT_ADDRESS;
break;
if (!address || !address[0])
address = DBUS_SESSION_BUS_DEFAULT_ADDRESS;
break;
@@
-1077,7
+1078,7
@@
static int bus_init_private(Manager *m) {
const char *e;
char *p;
const char *e;
char *p;
- e =
__
secure_getenv("XDG_RUNTIME_DIR");
+ e = secure_getenv("XDG_RUNTIME_DIR");
if (!e)
return 0;
if (!e)
return 0;
diff --git
a/src/libudev/libudev.c
b/src/libudev/libudev.c
index 1a74808411b58c1f5f6dd446994641d991b0758f..af36cc44524c9f788f26d803afd4435f20a61400 100644
(file)
--- a/
src/libudev/libudev.c
+++ b/
src/libudev/libudev.c
@@
-21,6
+21,7
@@
#include "libudev.h"
#include "libudev-private.h"
#include "libudev.h"
#include "libudev-private.h"
+#include "missing.h"
/**
* SECTION:libudev
/**
* SECTION:libudev
@@
-191,7
+192,7
@@
_public_ struct udev *udev_new(void)
}
/* environment overrides config */
}
/* environment overrides config */
- env =
__
secure_getenv("UDEV_LOG");
+ env = secure_getenv("UDEV_LOG");
if (env != NULL)
udev_set_log_priority(udev, util_log_priority(env));
if (env != NULL)
udev_set_log_priority(udev, util_log_priority(env));
diff --git
a/src/shared/dbus-common.c
b/src/shared/dbus-common.c
index b8229bd66331d93f0c6d15de1b71d0c3718bf7a4..0c73d6c6a870b04b1419f6fb9614df56f941a2e8 100644
(file)
--- a/
src/shared/dbus-common.c
+++ b/
src/shared/dbus-common.c
@@
-32,6
+32,7
@@
#include "log.h"
#include "dbus-common.h"
#include "util.h"
#include "log.h"
#include "dbus-common.h"
#include "util.h"
+#include "missing.h"
#include "def.h"
#include "strv.h"
#include "def.h"
#include "strv.h"
@@
-121,7
+122,7
@@
int bus_connect(DBusBusType t, DBusConnection **_bus, bool *_private, DBusError
* try via XDG_RUNTIME_DIR first, then
* fallback to normal bus access */
* try via XDG_RUNTIME_DIR first, then
* fallback to normal bus access */
- e =
__
secure_getenv("XDG_RUNTIME_DIR");
+ e = secure_getenv("XDG_RUNTIME_DIR");
if (e) {
char *p;
if (e) {
char *p;
diff --git
a/src/shared/log.c
b/src/shared/log.c
index 847202d7d38eb64592725944c69698112d293b94..96634645bc7c1ebe0e5c6d03686cc888ab7236cd 100644
(file)
--- a/
src/shared/log.c
+++ b/
src/shared/log.c
@@
-30,6
+30,7
@@
#include "log.h"
#include "util.h"
#include "log.h"
#include "util.h"
+#include "missing.h"
#include "macro.h"
#include "socket-util.h"
#include "macro.h"
#include "socket-util.h"
@@
-804,19
+805,19
@@
int log_set_max_level_from_string(const char *e) {
void log_parse_environment(void) {
const char *e;
void log_parse_environment(void) {
const char *e;
- e =
__
secure_getenv("SYSTEMD_LOG_TARGET");
+ e = secure_getenv("SYSTEMD_LOG_TARGET");
if (e && log_set_target_from_string(e) < 0)
log_warning("Failed to parse log target %s. Ignoring.", e);
if (e && log_set_target_from_string(e) < 0)
log_warning("Failed to parse log target %s. Ignoring.", e);
- e =
__
secure_getenv("SYSTEMD_LOG_LEVEL");
+ e = secure_getenv("SYSTEMD_LOG_LEVEL");
if (e && log_set_max_level_from_string(e) < 0)
log_warning("Failed to parse log level %s. Ignoring.", e);
if (e && log_set_max_level_from_string(e) < 0)
log_warning("Failed to parse log level %s. Ignoring.", e);
- e =
__
secure_getenv("SYSTEMD_LOG_COLOR");
+ e = secure_getenv("SYSTEMD_LOG_COLOR");
if (e && log_show_color_from_string(e) < 0)
log_warning("Failed to parse bool %s. Ignoring.", e);
if (e && log_show_color_from_string(e) < 0)
log_warning("Failed to parse bool %s. Ignoring.", e);
- e =
__
secure_getenv("SYSTEMD_LOG_LOCATION");
+ e = secure_getenv("SYSTEMD_LOG_LOCATION");
if (e && log_show_location_from_string(e) < 0)
log_warning("Failed to parse bool %s. Ignoring.", e);
}
if (e && log_show_location_from_string(e) < 0)
log_warning("Failed to parse bool %s. Ignoring.", e);
}
diff --git
a/src/shared/missing.h
b/src/shared/missing.h
index 7fbb9259ebae8151746058c8444f88a66f32480c..c5bb71a504c5a04962c39923c399d781a1085bad 100644
(file)
--- a/
src/shared/missing.h
+++ b/
src/shared/missing.h
@@
-26,6
+26,7
@@
#include <sys/resource.h>
#include <sys/syscall.h>
#include <fcntl.h>
#include <sys/resource.h>
#include <sys/syscall.h>
#include <fcntl.h>
+#include <stdlib.h>
#include <unistd.h>
#include <linux/oom.h>
#include <unistd.h>
#include <linux/oom.h>
@@
-218,7
+219,6
@@
static inline pid_t gettid(void) {
#endif
#ifndef HAVE_NAME_TO_HANDLE_AT
#endif
#ifndef HAVE_NAME_TO_HANDLE_AT
-
struct file_handle {
unsigned int handle_bytes;
int handle_type;
struct file_handle {
unsigned int handle_bytes;
int handle_type;
@@
-229,3
+229,11
@@
static inline int name_to_handle_at(int fd, const char *name, struct file_handle
return syscall(__NR_name_to_handle_at, fd, name, handle, mnt_id, flags);
}
#endif
return syscall(__NR_name_to_handle_at, fd, name, handle, mnt_id, flags);
}
#endif
+
+#ifndef HAVE_SECURE_GETENV
+# ifdef HAVE___SECURE_GETENV
+# define secure_getenv __secure_getenv
+# else
+# error neither secure_getenv nor __secure_getenv are available
+# endif
+#endif