summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am108
-rw-r--r--configure.ac6
-rw-r--r--po/zh_TW.po2
-rw-r--r--src/core/ima-setup.c39
4 files changed, 43 insertions, 112 deletions
diff --git a/Makefile.am b/Makefile.am
index 78acefb91e..de42a2ffb5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -905,6 +905,8 @@ libbasic_la_CFLAGS = \
libbasic_la_LIBADD = \
$(SELINUX_LIBS) \
$(CAP_LIBS) \
+ -ldl \
+ -lrt \
-lm
# -----------------------------------------------------------------------------
@@ -1012,21 +1014,16 @@ endif
libshared_la_CFLAGS = \
$(AM_CFLAGS) \
- $(SELINUX_CFLAGS) \
- $(CAP_CFLAGS) \
$(ACL_CFLAGS) \
- $(SECCOMP_CFLAGS) \
- -pthread
+ $(LIBIDN_CFLAGS) \
+ $(SECCOMP_CFLAGS)
libshared_la_LIBADD = \
libsystemd-internal.la \
libsystemd-journal-internal.la \
- $(SELINUX_LIBS) \
- $(CAP_LIBS) \
$(ACL_LIBS) \
$(LIBIDN_LIBS) \
- $(SECCOMP_LIBS) \
- -lm
+ $(SECCOMP_LIBS)
# -----------------------------------------------------------------------------
if HAVE_LIBIPTC
@@ -1190,8 +1187,7 @@ libcore_la_CFLAGS = \
$(AUDIT_CFLAGS) \
$(KMOD_CFLAGS) \
$(APPARMOR_CFLAGS) \
- $(MOUNT_CFLAGS) \
- -pthread
+ $(MOUNT_CFLAGS)
libcore_la_LIBADD = \
libudev-internal.la \
@@ -1321,8 +1317,7 @@ systemd_SOURCES = \
src/core/main.c
systemd_LDADD = \
- libcore.la \
- $(RT_LIBS)
+ libcore.la
dist_pkgsysconf_DATA += \
src/core/system.conf \
@@ -1525,8 +1520,7 @@ test_engine_CFLAGS = \
$(SECCOMP_CFLAGS)
test_engine_LDADD = \
- libcore.la \
- $(RT_LIBS)
+ libcore.la
test_job_type_SOURCES = \
src/test/test-job-type.c
@@ -1536,8 +1530,7 @@ test_job_type_CFLAGS = \
$(SECCOMP_CFLAGS)
test_job_type_LDADD = \
- libcore.la \
- $(RT_LIBS)
+ libcore.la
test_ns_SOURCES = \
src/test/test-ns.c
@@ -1566,8 +1559,7 @@ test_dns_domain_SOURCES = \
test_dns_domain_LDADD = \
libsystemd-network.la \
- libshared.la \
- $(LIBIDN_LIBS)
+ libshared.la
if ENABLE_EFI
manual_tests += \
@@ -1588,8 +1580,7 @@ test_unit_name_CFLAGS = \
$(SECCOMP_CFLAGS)
test_unit_name_LDADD = \
- libcore.la \
- $(RT_LIBS)
+ libcore.la
test_unit_file_SOURCES = \
src/test/test-unit-file.c
@@ -1599,8 +1590,7 @@ test_unit_file_CFLAGS = \
$(SECCOMP_CFLAGS)
test_unit_file_LDADD = \
- libcore.la \
- $(RT_LIBS)
+ libcore.la
test_utf8_SOURCES = \
src/test/test-utf8.c
@@ -1684,7 +1674,6 @@ test_path_lookup_SOURCES = \
src/test/test-path-lookup.c
test_path_lookup_LDADD = \
- -lm \
libshared.la
test_uid_range_SOURCES = \
@@ -1813,8 +1802,7 @@ test_tables_LDADD = \
libsystemd-journal-internal.la \
libjournal-core.la \
libcore.la \
- libudev-core.la \
- $(RT_LIBS)
+ libudev-core.la
test_prioq_SOURCES = \
src/test/test-prioq.c
@@ -1850,8 +1838,7 @@ test_ipcrm_SOURCES = \
src/test/test-ipcrm.c
test_ipcrm_LDADD = \
- libshared.la \
- -lrt
+ libshared.la
test_btrfs_SOURCES = \
src/test/test-btrfs.c
@@ -1943,8 +1930,7 @@ test_cgroup_mask_CFLAGS = \
$(SECCOMP_CFLAGS)
test_cgroup_mask_LDADD = \
- libcore.la \
- $(RT_LIBS)
+ libcore.la
test_cgroup_util_SOURCES = \
src/test/test-cgroup-util.c
@@ -2023,8 +2009,7 @@ test_sched_prio_CFLAGS = \
$(SECCOMP_CFLAGS)
test_sched_prio_LDADD = \
- libcore.la \
- $(RT_LIBS)
+ libcore.la
test_conf_files_SOURCES = \
src/test/test-conf-files.c
@@ -2095,8 +2080,7 @@ systemd_analyze_CFLAGS = \
$(SECCOMP_CFLAGS)
systemd_analyze_LDADD = \
- libcore.la \
- $(RT_LIBS)
+ libcore.la
# ------------------------------------------------------------------------------
systemd_initctl_SOURCES = \
@@ -2792,20 +2776,12 @@ libbus_proxy_core_la_SOURCES = \
src/bus-proxyd/synthesize.c \
src/bus-proxyd/synthesize.h
-libbus_proxy_core_la_CFLAGS = \
- $(AM_CFLAGS) \
- -pthread
-
libbus_proxy_core_la_LIBADD = \
libshared.la
systemd_bus_proxyd_SOURCES = \
src/bus-proxyd/bus-proxyd.c
-systemd_bus_proxyd_CFLAGS = \
- $(AM_CFLAGS) \
- -pthread
-
systemd_bus_proxyd_LDADD = \
libbus-proxy-core.la \
libshared.la
@@ -2942,22 +2918,13 @@ libsystemd_internal_la_SOURCES = \
nodist_libsystemd_internal_la_SOURCES = \
src/libsystemd/libsystemd.sym
-libsystemd_internal_la_CFLAGS = \
- $(AM_CFLAGS) \
- -pthread
-
libsystemd_internal_la_LIBADD = \
- libbasic.la \
- $(RT_LIBS)
+ libbasic.la
libsystemd_resolve_la_SOURCES = \
src/libsystemd/sd-resolve/sd-resolve.c \
src/libsystemd/sd-resolve/resolve-util.h
-libsystemd_resolve_la_CFLAGS = \
- $(AM_CFLAGS) \
- -pthread
-
libsystemd_resolve_la_LIBADD = \
-lresolv
@@ -3075,10 +3042,6 @@ test_bus_signature_LDADD = \
test_bus_chat_SOURCES = \
src/libsystemd/sd-bus/test-bus-chat.c
-test_bus_chat_CFLAGS = \
- $(AM_CFLAGS) \
- -pthread
-
test_bus_chat_LDADD = \
libshared.la
@@ -3095,20 +3058,12 @@ test_bus_cleanup_LDADD = \
test_bus_server_SOURCES = \
src/libsystemd/sd-bus/test-bus-server.c
-test_bus_server_CFLAGS = \
- $(AM_CFLAGS) \
- -pthread
-
test_bus_server_LDADD = \
libshared.la
test_bus_objects_SOURCES = \
src/libsystemd/sd-bus/test-bus-objects.c
-test_bus_objects_CFLAGS = \
- $(AM_CFLAGS) \
- -pthread
-
test_bus_objects_LDADD = \
libshared.la
@@ -3196,10 +3151,6 @@ test_resolve_LDADD = \
libsystemd-resolve.la \
libshared.la
-test_resolve_CFLAGS = \
- $(AM_CFLAGS) \
- -pthread
-
busctl_SOURCES = \
src/libsystemd/sd-bus/busctl.c \
src/libsystemd/sd-bus/busctl-introspect.c \
@@ -3286,8 +3237,7 @@ test_dhcp_client_SOURCES = \
test_dhcp_client_LDADD = \
libsystemd-network.la \
libudev-internal.la \
- libshared.la \
- $(LIBIDN_LIBS)
+ libshared.la
test_dhcp_server_SOURCES = \
src/libsystemd-network/test-dhcp-server.c
@@ -3802,8 +3752,7 @@ test_libudev_SOURCES = \
test_libudev_LDADD = \
libudev-internal.la \
- libshared.la \
- $(ACL_LIBS)
+ libshared.la
test_udev_SOURCES = \
src/test/test-udev.c
@@ -3811,9 +3760,7 @@ test_udev_SOURCES = \
test_udev_LDADD = \
libudev-core.la \
$(BLKID_LIBS) \
- $(KMOD_LIBS) \
- $(SELINUX_LIBS) \
- $(ACL_LIBS)
+ $(KMOD_LIBS)
check_DATA += \
test/sys
@@ -4940,7 +4887,6 @@ libnss_myhostname_la_LDFLAGS = \
libnss_myhostname_la_LIBADD = \
libshared.la
-#libsystemd-network.la
lib_LTLIBRARIES += \
libnss_myhostname.la
@@ -5271,8 +5217,7 @@ gperf_txt_sources += \
systemd_resolved_LDADD = \
libsystemd-network.la \
- libshared.la \
- $(LIBIDN_LIBS)
+ libshared.la
rootlibexec_PROGRAMS += \
systemd-resolved
@@ -5341,8 +5286,7 @@ nodist_systemd_resolve_host_SOURCES = \
src/resolve/dns_type-to-name.h
systemd_resolve_host_LDADD = \
- libshared.la \
- $(LIBIDN_LIBS)
+ libshared.la
rootlibexec_PROGRAMS += \
systemd-resolve-host
@@ -5361,8 +5305,7 @@ systemd_networkd_SOURCES = \
src/network/networkd.c
systemd_networkd_LDADD = \
- libnetworkd-core.la \
- $(LIBIDN_LIBS)
+ libnetworkd-core.la
if HAVE_LIBIPTC
systemd_networkd_LDADD += \
@@ -5458,8 +5401,7 @@ test_network_SOURCES = \
src/network/test-network.c
test_network_LDADD = \
- libnetworkd-core.la \
- $(LIBIDN_LIBS)
+ libnetworkd-core.la
if HAVE_LIBIPTC
test_network_LDADD += \
diff --git a/configure.ac b/configure.ac
index 344bfe1e21..fcdccb1030 100644
--- a/configure.ac
+++ b/configure.ac
@@ -301,12 +301,6 @@ AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not
CAP_LIBS="$LIBS"
AC_SUBST(CAP_LIBS)
-LIBS=
-AC_SEARCH_LIBS([mq_open], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
-RT_LIBS="$LIBS"
-AC_SUBST(RT_LIBS)
-LIBS="$save_LIBS"
-
AC_CHECK_FUNCS([memfd_create])
AC_CHECK_FUNCS([__secure_getenv secure_getenv])
AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, getrandom, renameat2, kcmp, LO_FLAGS_PARTSCAN],
diff --git a/po/zh_TW.po b/po/zh_TW.po
index f96d484912..77be569d1a 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -9,7 +9,7 @@ msgstr ""
"POT-Creation-Date: 2015-06-10 11:41+0000\n"
"PO-Revision-Date: 2015-06-11 12:44+0800\n"
"Last-Translator: Jeff Huang <s8321414@gmail.com>\n"
-"Language-Team: Chinese Traditional <https://groups.google.com/forum/#!forum/chinese-l10n>\n"
+"Language-Team: chinese-l10n <chinese-l10n@googlegroups.com>\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
diff --git a/src/core/ima-setup.c b/src/core/ima-setup.c
index 4d8b638115..42a3e97459 100644
--- a/src/core/ima-setup.c
+++ b/src/core/ima-setup.c
@@ -23,9 +23,6 @@
#include <unistd.h>
#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
#include "ima-setup.h"
#include "util.h"
@@ -36,20 +33,19 @@
#define IMA_POLICY_PATH "/etc/ima/ima-policy"
int ima_setup(void) {
- int r = 0;
-
#ifdef HAVE_IMA
- _cleanup_close_ int policyfd = -1, imafd = -1;
- struct stat st;
- char *policy;
+ _cleanup_fclose_ FILE *input = NULL;
+ _cleanup_close_ int imafd = -1;
+ unsigned lineno = 0;
+ char line[page_size()];
if (access(IMA_SECFS_DIR, F_OK) < 0) {
log_debug("IMA support is disabled in the kernel, ignoring.");
return 0;
}
- policyfd = open(IMA_POLICY_PATH, O_RDONLY|O_CLOEXEC);
- if (policyfd < 0) {
+ input = fopen(IMA_POLICY_PATH, "re");
+ if (!input) {
log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_WARNING, errno,
"Failed to open the IMA custom policy file "IMA_POLICY_PATH", ignoring: %m");
return 0;
@@ -66,20 +62,19 @@ int ima_setup(void) {
return 0;
}
- if (fstat(policyfd, &st) < 0)
- return log_error_errno(errno, "Failed to fstat "IMA_POLICY_PATH": %m");
+ FOREACH_LINE(line, input,
+ return log_error_errno(errno, "Failed to read the IMA custom policy file "IMA_POLICY_PATH": %m")) {
+ size_t len;
- policy = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, policyfd, 0);
- if (policy == MAP_FAILED)
- return log_error_errno(errno, "Failed to mmap "IMA_POLICY_PATH": %m");
+ len = strlen(line);
+ lineno++;
- r = loop_write(imafd, policy, (size_t) st.st_size, false);
- if (r < 0)
- log_error_errno(r, "Failed to load the IMA custom policy file "IMA_POLICY_PATH": %m");
- else
- log_info("Successfully loaded the IMA custom policy "IMA_POLICY_PATH".");
+ if (len > 0 && write(imafd, line, len) < 0)
+ return log_error_errno(errno, "Failed to load the IMA custom policy file "IMA_POLICY_PATH"%u: %m",
+ lineno);
+ }
- munmap(policy, st.st_size);
+ log_info("Successfully loaded the IMA custom policy "IMA_POLICY_PATH".");
#endif /* HAVE_IMA */
- return r;
+ return 0;
}