chiark / gitweb /
rename basic.la to shared.la and put selinux deps in shared-selinx.la
authorKay Sievers <kay@vrfy.org>
Tue, 10 Apr 2012 19:54:31 +0000 (21:54 +0200)
committerKay Sievers <kay@vrfy.org>
Tue, 10 Apr 2012 20:43:05 +0000 (22:43 +0200)
Only 34 of 74 tools need libselinux linked, and libselinux is a pain
with its unconditional library constructor.

34 files changed:
Makefile.am
src/ask-password-api.c
src/automount.c
src/cryptsetup/cryptsetup-generator.c
src/dbus.c
src/getty-generator.c
src/install.c
src/journal/coredump.c
src/journal/journald.c
src/locale/localed.c
src/login/logind-dbus.c
src/login/logind-seat.c
src/login/logind-session.c
src/login/logind-user.c
src/login/multi-seat-x.c
src/machine-id-setup.c
src/manager.c
src/mount-setup.c
src/mount.c
src/nspawn.c
src/path-lookup.c
src/path.c
src/random-seed.c
src/rc-local-generator.c
src/shared/cgroup-util.c
src/shared/mkdir.c [new file with mode: 0644]
src/shared/mkdir.h [new file with mode: 0644]
src/shared/socket-util.c
src/shared/util.c
src/shared/util.h
src/shutdown.c
src/socket.c
src/tmpfiles.c
src/tty-ask-password-agent.c

index 151555fd6d1baafa62b621f8dc0143cfa0e67d47..7e9e23175a68ab8675533a3bfc92b4dedf7d7d99 100644 (file)
@@ -548,15 +548,13 @@ EXTRA_DIST += \
 
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
-libsystemd_basic_la_SOURCES = \
+libsystemd_shared_la_SOURCES = \
        src/shared/util.c \
        src/shared/util.h \
        src/shared/virt.c \
        src/shared/virt.h \
-       src/shared/label.c \
-       src/shared/label.h \
        src/shared/hashmap.c \
        src/shared/hashmap.h \
        src/shared/set.c \
@@ -565,8 +563,6 @@ libsystemd_basic_la_SOURCES = \
        src/shared/strv.h \
        src/shared/conf-parser.c \
        src/shared/conf-parser.h \
-       src/shared/socket-util.c \
-       src/shared/socket-util.h \
        src/shared/log.c \
        src/shared/log.h \
        src/shared/ratelimit.h \
@@ -575,19 +571,32 @@ libsystemd_basic_la_SOURCES = \
        src/shared/exit-status.h \
        src/shared/utf8.c \
        src/shared/utf8.h \
-       src/shared/cgroup-util.c \
-       src/shared/cgroup-util.h \
        src/shared/pager.c \
        src/shared/pager.h \
        src/shared/ioprio.h \
        src/shared/list.h \
        src/shared/macro.h
 
-libsystemd_basic_la_CFLAGS = \
+# ------------------------------------------------------------------------------
+noinst_LTLIBRARIES += \
+       libsystemd-shared-selinux.la
+
+libsystemd_shared_selinux_la_SOURCES = \
+       src/shared/cgroup-util.c \
+       src/shared/cgroup-util.h \
+       src/shared/socket-util.c \
+       src/shared/socket-util.h \
+       src/shared/label.c \
+       src/shared/label.h \
+       src/shared/mkdir.c \
+       src/shared/mkdir.h
+
+libsystemd_shared_selinux_la_CFLAGS = \
        $(AM_CFLAGS) \
        $(SELINUX_CFLAGS)
 
-libsystemd_basic_la_LIBADD = \
+libsystemd_shared_selinux_la_LIBADD = \
+       libsystemd-shared.la \
        $(SELINUX_LIBS)
 
 # ------------------------------------------------------------------------------
@@ -776,7 +785,7 @@ libsystemd_core_la_CFLAGS = \
        $(KMOD_CFLAGS)
 
 libsystemd_core_la_LIBADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libsystemd-capability.la \
        libudev.la \
        $(DBUS_LIBS) \
@@ -832,40 +841,40 @@ test_loopback_SOURCES = \
        src/loopback-setup.c
 
 test_loopback_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared-selinux.la
 
 test_hostname_SOURCES = \
        src/test-hostname.c \
        src/hostname-setup.c
 
 test_hostname_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 test_daemon_SOURCES = \
        src/test-daemon.c
 
 test_daemon_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared.la \
        libsystemd-daemon.la
 
 test_cgroup_SOURCES = \
        src/test-cgroup.c
 
 test_cgroup_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared-selinux.la
 
 test_env_replace_SOURCES = \
        src/test-env-replace.c
 
 test_env_replace_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 test_strv_SOURCES = \
        src/test-strv.c \
        src/specifier.c
 
 test_strv_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 test_install_SOURCES = \
        src/test-install.c \
@@ -878,7 +887,7 @@ test_install_CFLAGS = \
        $(DBUS_CFLAGS)
 
 test_install_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared-selinux.la
 
 test_watchdog_SOURCES = \
        src/test-watchdog.c \
@@ -886,7 +895,7 @@ test_watchdog_SOURCES = \
        src/watchdog.h
 
 test_watchdog_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_initctl_SOURCES = \
@@ -898,7 +907,7 @@ systemd_initctl_CFLAGS = \
        $(DBUS_CFLAGS)
 
 systemd_initctl_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared.la \
        libsystemd-daemon.la \
        $(DBUS_LIBS)
 
@@ -914,7 +923,7 @@ systemd_update_utmp_CFLAGS = \
        $(AUDIT_CFLAGS)
 
 systemd_update_utmp_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared.la \
        $(DBUS_LIBS) \
        $(AUDIT_LIBS)
 
@@ -924,7 +933,7 @@ systemd_shutdownd_SOURCES = \
        src/shutdownd.c
 
 systemd_shutdownd_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared.la \
        libsystemd-daemon.la
 
 systemd_shutdown_SOURCES = \
@@ -935,7 +944,7 @@ systemd_shutdown_SOURCES = \
        src/watchdog.h
 
 systemd_shutdown_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libudev.la
 
 # ------------------------------------------------------------------------------
@@ -947,7 +956,7 @@ systemd_modules_load_CFLAGS = \
        $(KMOD_CFLAGS)
 
 systemd_modules_load_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared.la \
        $(KMOD_LIBS)
 
 # ------------------------------------------------------------------------------
@@ -955,7 +964,7 @@ systemd_tmpfiles_SOURCES = \
        src/tmpfiles.c
 
 systemd_tmpfiles_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared-selinux.la
 
 # ------------------------------------------------------------------------------
 systemd_machine_id_setup_SOURCES = \
@@ -963,7 +972,7 @@ systemd_machine_id_setup_SOURCES = \
        src/machine-id-main.c
 
 systemd_machine_id_setup_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libsystemd-id128.la
 
 # ------------------------------------------------------------------------------
@@ -971,7 +980,7 @@ systemd_sysctl_SOURCES = \
        src/sysctl.c
 
 systemd_sysctl_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_fsck_SOURCES = \
@@ -983,7 +992,7 @@ systemd_fsck_CFLAGS = \
        $(DBUS_CFLAGS)
 
 systemd_fsck_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared.la \
        libudev.la \
        $(DBUS_LIBS)
 
@@ -992,14 +1001,14 @@ systemd_timestamp_SOURCES = \
        src/timestamp.c
 
 systemd_timestamp_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_ac_power_SOURCES = \
        src/ac-power.c
 
 systemd_ac_power_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared.la \
        libudev.la
 
 # ------------------------------------------------------------------------------
@@ -1007,7 +1016,7 @@ systemd_detect_virt_SOURCES = \
        src/detect-virt.c
 
 systemd_detect_virt_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_getty_generator_SOURCES = \
@@ -1015,14 +1024,14 @@ systemd_getty_generator_SOURCES = \
        src/unit-name.c
 
 systemd_getty_generator_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared-selinux.la
 
 # ------------------------------------------------------------------------------
 systemd_rc_local_generator_SOURCES = \
        src/rc-local-generator.c
 
 systemd_rc_local_generator_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared-selinux.la
 
 # ------------------------------------------------------------------------------
 systemd_remount_api_vfs_SOURCES = \
@@ -1030,7 +1039,7 @@ systemd_remount_api_vfs_SOURCES = \
        src/mount-setup.c
 
 systemd_remount_api_vfs_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_cgroups_agent_SOURCES = \
@@ -1042,7 +1051,7 @@ systemd_cgroups_agent_CFLAGS = \
        $(DBUS_CFLAGS)
 
 systemd_cgroups_agent_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared.la \
        $(DBUS_LIBS)
 
 # ------------------------------------------------------------------------------
@@ -1062,7 +1071,7 @@ systemctl_CFLAGS = \
        $(DBUS_CFLAGS)
 
 systemctl_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libsystemd-daemon.la \
        libsystemd-journal.la \
        libsystemd-id128.la \
@@ -1074,7 +1083,7 @@ systemd_notify_SOURCES = \
        src/readahead/sd-readahead.c
 
 systemd_notify_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared.la \
        libsystemd-daemon.la
 
 # ------------------------------------------------------------------------------
@@ -1083,14 +1092,14 @@ systemd_ask_password_SOURCES = \
        src/ask-password-api.c
 
 systemd_ask_password_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared-selinux.la
 
 # ------------------------------------------------------------------------------
 systemd_reply_password_SOURCES = \
        src/reply-password.c
 
 systemd_reply_password_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_cgls_SOURCES = \
@@ -1098,14 +1107,14 @@ systemd_cgls_SOURCES = \
        src/cgroup-show.c
 
 systemd_cgls_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared-selinux.la
 
 # ------------------------------------------------------------------------------
 systemd_cgtop_SOURCES = \
        src/cgtop.c
 
 systemd_cgtop_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared-selinux.la
 
 # ------------------------------------------------------------------------------
 systemd_nspawn_SOURCES = \
@@ -1113,7 +1122,7 @@ systemd_nspawn_SOURCES = \
        src/loopback-setup.c
 
 systemd_nspawn_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libsystemd-capability.la \
        libsystemd-daemon.la
 
@@ -1122,7 +1131,7 @@ systemd_stdio_bridge_SOURCES = \
        src/bridge.c
 
 systemd_stdio_bridge_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
 systemd_tty_ask_password_agent_SOURCES = \
@@ -1131,7 +1140,7 @@ systemd_tty_ask_password_agent_SOURCES = \
        src/utmp-wtmp.c
 
 systemd_tty_ask_password_agent_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared-selinux.la
 
 # ------------------------------------------------------------------------------
 libsystemd_daemon_la_SOURCES = \
@@ -1262,17 +1271,18 @@ libudev_private_la_SOURCES =\
        src/udev/libudev-device-private.c \
        src/udev/libudev-queue-private.c
 
-libudev_private_la_CFLAGS = \
-       $(AM_CFLAGS) \
-       -fvisibility=default
-
 if HAVE_SELINUX
 libudev_private_la_SOURCES +=\
        src/udev/libudev-selinux-private.c
+endif
+
+libudev_private_la_CFLAGS = \
+       $(AM_CFLAGS) \
+       $(SELINUX_CFLAGS)
+       -fvisibility=default
 
 libudev_private_la_LIBADD = \
        $(SELINUX_LIBS)
-endif
 
 # ------------------------------------------------------------------------------
 MANPAGES += \
@@ -1369,8 +1379,8 @@ libudev_core_la_CFLAGS = \
 
 libudev_core_la_LIBADD = \
        libudev-private.la \
-       libsystemd-basic.la \
        libsystemd-daemon.la \
+       libsystemd-shared-selinux.la \
        $(BLKID_LIBS) \
        $(KMOD_LIBS)
 
@@ -1406,7 +1416,8 @@ udevadm_SOURCES = \
        src/udev/udevadm-test-builtin.c
 
 udevadm_LDADD = \
-       libudev-core.la
+       libudev-core.la \
+       libsystemd-shared-selinux.la
 
 # ------------------------------------------------------------------------------
 TESTS = \
@@ -1429,7 +1440,7 @@ test_udev_SOURCES = \
 test_udev_LDADD = \
        libudev-core.la \
        libudev-private.la \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 test_udev_DEPENDENCIES = \
        src/udev/test/sys
@@ -1453,7 +1464,7 @@ ata_id_SOURCES = \
 
 ata_id_LDADD = \
        libudev-private.la \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 udevlibexec_PROGRAMS += \
        ata_id
@@ -1464,7 +1475,7 @@ cdrom_id_SOURCES = \
 
 cdrom_id_LDADD = \
        libudev.la \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 udevlibexec_PROGRAMS += \
        cdrom_id
@@ -1491,7 +1502,7 @@ scsi_id_SOURCES =\
 
 scsi_id_LDADD = \
        libudev-private.la \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 udevlibexec_PROGRAMS += \
        scsi_id
@@ -1518,7 +1529,7 @@ accelerometer_SOURCES = \
 
 accelerometer_LDADD = \
        libudev.la -lm \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 udevlibexec_PROGRAMS += \
        accelerometer
@@ -1840,13 +1851,13 @@ libsystemd_id128_la_LDFLAGS = \
        -Wl,--version-script=$(top_srcdir)/src/libsystemd-id128.sym
 
 libsystemd_id128_la_LIBADD = \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 test_id128_SOURCES = \
        src/test-id128.c
 
 test_id128_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libsystemd-id128.la
 
 noinst_PROGRAMS += \
@@ -1899,7 +1910,7 @@ nodist_systemd_journald_SOURCES = \
 systemd_journald_CFLAGS =
 
 systemd_journald_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libsystemd-audit.la \
        libsystemd-daemon.la \
        libsystemd-login.la \
@@ -1926,7 +1937,7 @@ systemd_cat_SOURCES = \
        src/journal/cat.c
 
 systemd_cat_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libsystemd-journal.la
 
 journalctl_SOURCES = \
@@ -1934,7 +1945,7 @@ journalctl_SOURCES = \
        src/logs-show.c
 
 journalctl_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libsystemd-journal.la \
        libsystemd-id128.la
 
@@ -1956,7 +1967,7 @@ test_journal_SOURCES = \
        src/journal/journal-send.c
 
 test_journal_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libsystemd-id128.la
 
 if HAVE_XZ
@@ -1975,7 +1986,7 @@ test_journal_send_SOURCES = \
        src/journal/test-journal-send.c
 
 test_journal_send_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libsystemd-journal.la
 
 libsystemd_journal_la_SOURCES = \
@@ -1994,7 +2005,7 @@ libsystemd_journal_la_LDFLAGS = \
        -Wl,--version-script=$(top_srcdir)/src/journal/libsystemd-journal.sym
 
 libsystemd_journal_la_LIBADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libsystemd-id128.la
 
 if HAVE_XZ
@@ -2030,7 +2041,7 @@ UNINSTALL_EXEC_HOOKS += \
 
 noinst_PROGRAMS += \
        test-journal \
-        test-journal-send
+       test-journal-send
 
 pkginclude_HEADERS += \
        src/systemd/sd-journal.h \
@@ -2096,9 +2107,9 @@ systemd_coredump_SOURCES = \
        src/journal/coredump.c
 
 systemd_coredump_LDADD = \
-       libsystemd-basic.la \
        libsystemd-journal.la \
-       libsystemd-login.la
+       libsystemd-login.la \
+       libsystemd-shared-selinux.la
 
 rootlibexec_PROGRAMS += \
        systemd-coredump
@@ -2119,7 +2130,7 @@ systemd_binfmt_SOURCES = \
        src/binfmt/binfmt.c
 
 systemd_binfmt_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 rootlibexec_PROGRAMS += \
        systemd-binfmt
@@ -2158,7 +2169,7 @@ systemd_vconsole_setup_SOURCES = \
        src/vconsole/vconsole-setup.c
 
 systemd_vconsole_setup_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared.la
 
 rootlibexec_PROGRAMS += \
        systemd-vconsole-setup
@@ -2190,7 +2201,7 @@ systemd_readahead_collect_SOURCES = \
        src/readahead/readahead-common.c
 
 systemd_readahead_collect_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared.la \
        libsystemd-daemon.la \
        libudev.la
 
@@ -2199,7 +2210,7 @@ systemd_readahead_replay_SOURCES = \
        src/readahead/readahead-common.c
 
 systemd_readahead_replay_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared.la \
        libsystemd-daemon.la \
        libudev.la
 
@@ -2242,7 +2253,7 @@ systemd_quotacheck_SOURCES = \
        src/quotacheck.c
 
 systemd_quotacheck_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared.la
 endif
 
 # ------------------------------------------------------------------------------
@@ -2262,7 +2273,7 @@ systemd_random_seed_SOURCES = \
        src/random-seed.c
 
 systemd_random_seed_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared-selinux.la
 
 randomseed-install-data-hook:
        $(MKDIR_P) -m 0755 \
@@ -2299,16 +2310,16 @@ systemd_cryptsetup_CFLAGS = \
        $(LIBCRYPTSETUP_CFLAGS)
 
 systemd_cryptsetup_LDADD = \
-       $(LIBCRYPTSETUP_LIBS) \
+       libsystemd-shared-selinux.la \
        libudev.la \
-       libsystemd-basic.la
+       $(LIBCRYPTSETUP_LIBS)
 
 systemd_cryptsetup_generator_SOURCES = \
        src/cryptsetup/cryptsetup-generator.c \
        src/unit-name.c
 
 systemd_cryptsetup_generator_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared-selinux.la
 
 cryptsetup-install-data-hook:
        $(MKDIR_P) -m 0755 \
@@ -2333,7 +2344,7 @@ systemd_hostnamed_CFLAGS = \
        $(DBUS_CFLAGS)
 
 systemd_hostnamed_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared.la \
        libsystemd-daemon.la \
        $(DBUS_LIBS)
 
@@ -2384,7 +2395,7 @@ systemd_localed_CFLAGS = \
        $(DBUS_CFLAGS)
 
 systemd_localed_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libsystemd-daemon.la \
        $(DBUS_LIBS)
 
@@ -2445,7 +2456,7 @@ systemd_timedated_CFLAGS = \
        $(DBUS_CFLAGS)
 
 systemd_timedated_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared.la \
        libsystemd-daemon.la \
        $(DBUS_LIBS)
 
@@ -2508,7 +2519,7 @@ systemd_logind_CFLAGS = \
        $(DBUS_CFLAGS)
 
 systemd_logind_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libsystemd-audit.la \
        libsystemd-daemon.la \
        libudev.la \
@@ -2526,7 +2537,7 @@ systemd_user_sessions_SOURCES = \
        src/login/user-sessions.c
 
 systemd_user_sessions_LDADD = \
-       libsystemd-basic.la
+       libsystemd-shared-selinux.la
 
 rootlibexec_PROGRAMS += \
        systemd-logind \
@@ -2543,7 +2554,7 @@ loginctl_CFLAGS = \
        $(DBUS_CFLAGS)
 
 loginctl_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libudev.la \
        $(DBUS_LIBS)
 
@@ -2554,8 +2565,8 @@ test_login_SOURCES = \
        src/login/test-login.c
 
 test_login_LDADD = \
-       libsystemd-basic.la \
-       libsystemd-login.la
+       libsystemd-login.la \
+       libsystemd-shared-selinux.la
 
 noinst_PROGRAMS += \
        test-login
@@ -2573,7 +2584,7 @@ libsystemd_login_la_LDFLAGS = \
        -Wl,--version-script=$(top_srcdir)/src/login/libsystemd-login.sym
 
 libsystemd_login_la_LIBADD = \
-       libsystemd-basic.la
+       libsystemd-shared-selinux.la
 
 if HAVE_PAM
 pam_systemd_la_SOURCES = \
@@ -2594,7 +2605,7 @@ pam_systemd_la_LDFLAGS = \
        -export-symbols-regex '^pam_sm_.*'
 
 pam_systemd_la_LIBADD = \
-       libsystemd-basic.la \
+       libsystemd-shared.la \
        libsystemd-daemon.la \
        $(PAM_LIBS) \
        $(DBUS_LIBS)
@@ -2666,7 +2677,7 @@ systemd_multi_seat_x_SOURCES = \
        src/login/multi-seat-x.c
 
 systemd_multi_seat_x_LDADD = \
-       libsystemd-basic.la \
+       libsystemd-shared-selinux.la \
        libudev.la
 
 rootlibexec_PROGRAMS += \
index ce2f3cbe777fa0cc81420f9e662e35fea486de96..4b50d28d309264bf4121e43dce58d9b439dc5e7f 100644 (file)
@@ -32,6 +32,7 @@
 #include <sys/signalfd.h>
 
 #include "util.h"
+#include "mkdir.h"
 #include "strv.h"
 
 #include "ask-password-api.h"
index cf2fb60cdf7196339652a5fdf6a8b55503aff135..6857a6fd76f5aee450255dbbdc2ed67560a148ad 100644 (file)
@@ -38,6 +38,7 @@
 #include "bus-errors.h"
 #include "special.h"
 #include "label.h"
+#include "mkdir.h"
 
 static const UnitActiveState state_translation_table[_AUTOMOUNT_STATE_MAX] = {
         [AUTOMOUNT_DEAD] = UNIT_INACTIVE,
index ba59b49b014380ccb107fe885e69418981c636bd..5e92fb9af8047be4ea9bd8154f5a68f48f33f5e1 100644 (file)
@@ -26,6 +26,7 @@
 #include "log.h"
 #include "util.h"
 #include "unit-name.h"
+#include "mkdir.h"
 
 const char *arg_dest = "/tmp";
 
index 8e6e9fd520d4a838baa6474facf8e198cb2d9d7c..ddf91f225a305d2369dad72e2d2c72ddb8655284 100644 (file)
@@ -29,6 +29,7 @@
 #include "log.h"
 #include "strv.h"
 #include "cgroup.h"
+#include "mkdir.h"
 #include "dbus-unit.h"
 #include "dbus-job.h"
 #include "dbus-manager.h"
index 7fac43a0baf02bcd065ad4e59457c3887e17cf54..dc979e9e8e36421375090613c59982980d1da956 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "log.h"
 #include "util.h"
+#include "mkdir.h"
 #include "unit-name.h"
 #include "virt.h"
 
index 92561168059422f40ca15af0784056ec5b9177a4..45018043c27a4cbf09b4d640aad2a12703e24a1a 100644 (file)
@@ -26,6 +26,7 @@
 #include <fnmatch.h>
 
 #include "util.h"
+#include "mkdir.h"
 #include "hashmap.h"
 #include "set.h"
 #include "path-lookup.h"
index 7dea66e6fdd74bd4e396943cbb266a4efe587c1b..5ecdef37a74696440820b00affa953a4940bcce6 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "log.h"
 #include "util.h"
+#include "mkdir.h"
 #include "special.h"
 
 #define COREDUMP_MAX (24*1024*1024)
index 442d2eb5ae58c890edd62a66322d8ca80b283197..073bb890aba6a69068514d16fea58b8d514f1fd0 100644 (file)
@@ -35,6 +35,7 @@
 #include <systemd/sd-messages.h>
 #include <systemd/sd-daemon.h>
 
+#include "mkdir.h"
 #include "hashmap.h"
 #include "journal-file.h"
 #include "socket-util.h"
index e9f9f86878e74ff49cf5be6d8b1bb8cd2136bbe4..e6aaa5cab3bb721a6df4ded143ca88b9a6accf11 100644 (file)
@@ -26,6 +26,7 @@
 #include <unistd.h>
 
 #include "util.h"
+#include "mkdir.h"
 #include "strv.h"
 #include "dbus-common.h"
 #include "polkit.h"
index ea6b89faa14dbf4a6b09ecf3aa146e6c946a60ff..1c6dc979edee659a08666d6aa45b20cf98395c73 100644 (file)
@@ -27,6 +27,7 @@
 #include "logind.h"
 #include "dbus-common.h"
 #include "strv.h"
+#include "mkdir.h"
 #include "polkit.h"
 #include "special.h"
 
index be37c1cc2e52c81c757225fb5b4379a32e6d3602..906ede6cda3f8e82feb18d32fd71f1213c96f6c7 100644 (file)
@@ -30,6 +30,7 @@
 #include "logind-seat.h"
 #include "logind-acl.h"
 #include "util.h"
+#include "mkdir.h"
 
 Seat *seat_new(Manager *m, const char *id) {
         Seat *s;
index 4e0af8656b6a570d95c0fcee501945409a1ecb13..641678210fecb6c6578c0f25f04a74c7f92155c5 100644 (file)
@@ -28,6 +28,7 @@
 #include "logind-session.h"
 #include "strv.h"
 #include "util.h"
+#include "mkdir.h"
 #include "cgroup-util.h"
 
 #define IDLE_THRESHOLD_USEC (5*USEC_PER_MINUTE)
index 717f0e20a2c26adcfe8ac91e19d629a449600ba6..92ba2c2208cf369d5d1199e9c30bf60b742408cc 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "logind-user.h"
 #include "util.h"
+#include "mkdir.h"
 #include "cgroup-util.h"
 #include "hashmap.h"
 #include "strv.h"
index 7133e026dc2df356c32bf63faefbeca4c26c3ae9..96554462a809db665eb8eb519c4acb490fb063bf 100644 (file)
@@ -25,6 +25,7 @@
 #include <libudev.h>
 
 #include "util.h"
+#include "mkdir.h"
 
 int main(int argc, char *argv[]) {
 
index 0f97433804e5fa6d7cec6baa259956ec396f6988..0ee3cd7ae1ef447359d78d1f6e0e10b20b033e1e 100644 (file)
@@ -32,6 +32,7 @@
 #include "machine-id-setup.h"
 #include "macro.h"
 #include "util.h"
+#include "mkdir.h"
 #include "log.h"
 #include "virt.h"
 
index be47766a734d39de237265f3b9a1181ce179ebe1..971990b0379f3cfacffefb50ca628545a661b9f7 100644 (file)
@@ -49,6 +49,7 @@
 #include "strv.h"
 #include "log.h"
 #include "util.h"
+#include "mkdir.h"
 #include "ratelimit.h"
 #include "cgroup.h"
 #include "mount-setup.h"
index aaffb655eea77408ada01b04e81830934db95b44..7d6cdf6cb4a820b39985a4b5128649cc09a3c466 100644 (file)
@@ -36,6 +36,7 @@
 #include "label.h"
 #include "set.h"
 #include "strv.h"
+#include "mkdir.h"
 
 #ifndef TTY_GID
 #define TTY_GID 5
index ed0f819c7ba71090449541b5f8cf904ce6eb6efe..7dbeaf9cf0b8bf45d290397432b9ddeadef7d58b 100644 (file)
@@ -31,6 +31,7 @@
 #include "load-dropin.h"
 #include "log.h"
 #include "strv.h"
+#include "mkdir.h"
 #include "mount-setup.h"
 #include "unit-name.h"
 #include "dbus-mount.h"
index 66910bc6843a647ec3b64b6e70d8088e10a860fc..9e21c5e8b567340bd31f2d0f3cb0f8a1b697e6de 100644 (file)
@@ -43,6 +43,7 @@
 
 #include "log.h"
 #include "util.h"
+#include "mkdir.h"
 #include "audit.h"
 #include "missing.h"
 #include "cgroup-util.h"
index 5464cedbbd04657bb2cefd9dc3dc30623d57376d..d33ebc71be81cef97e0b6dcedd8ce9c801c363a6 100644 (file)
@@ -26,6 +26,7 @@
 #include <errno.h>
 
 #include "util.h"
+#include "mkdir.h"
 #include "strv.h"
 
 #include "path-lookup.h"
index e97cd0981097a51255fd70055f824a9d32e10c58..1d50885ed44d508e6b8f285a27e78f261f7dccbf 100644 (file)
@@ -28,6 +28,7 @@
 #include "unit.h"
 #include "unit-name.h"
 #include "path.h"
+#include "mkdir.h"
 #include "dbus-path.h"
 #include "special.h"
 #include "bus-errors.h"
index 8b43bacadc67580f8657b1dc67b4ace6cf7effb1..c1022c719fbd77f20a3523147d8f957de966b2e0 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "log.h"
 #include "util.h"
+#include "mkdir.h"
 
 #define POOL_SIZE_MIN 512
 
index 56785cf40261f5a831ab8087114304b5126a7a18..108827d6990eba680656a8c679638177ee43891a 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "log.h"
 #include "util.h"
+#include "mkdir.h"
 
 #if defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_MAGEIA)
 #define SCRIPT_PATH "/etc/rc.d/rc.local"
index 904d30095226a6f027f1d527634cb4e9cc311b24..5647624e8de369f2e6631e79025ceed3bd41411c 100644 (file)
@@ -34,6 +34,7 @@
 #include "set.h"
 #include "macro.h"
 #include "util.h"
+#include "mkdir.h"
 
 int cg_enumerate_processes(const char *controller, const char *path, FILE **_f) {
         char *fs;
diff --git a/src/shared/mkdir.c b/src/shared/mkdir.c
new file mode 100644 (file)
index 0000000..e668cc2
--- /dev/null
@@ -0,0 +1,99 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
+  This file is part of systemd.
+
+  Copyright 2010 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+#include <assert.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "mkdir.h"
+#include "label.h"
+#include "util.h"
+#include "log.h"
+
+int safe_mkdir(const char *path, mode_t mode, uid_t uid, gid_t gid) {
+        struct stat st;
+
+        if (label_mkdir(path, mode) >= 0)
+                if (chmod_and_chown(path, mode, uid, gid) < 0)
+                        return -errno;
+
+        if (lstat(path, &st) < 0)
+                return -errno;
+
+        if ((st.st_mode & 0777) != mode ||
+            st.st_uid != uid ||
+            st.st_gid != gid ||
+            !S_ISDIR(st.st_mode)) {
+                errno = EEXIST;
+                return -errno;
+        }
+
+        return 0;
+}
+
+int mkdir_parents(const char *path, mode_t mode) {
+        const char *p, *e;
+
+        assert(path);
+
+        /* Creates every parent directory in the path except the last
+         * component. */
+
+        p = path + strspn(path, "/");
+        for (;;) {
+                int r;
+                char *t;
+
+                e = p + strcspn(p, "/");
+                p = e + strspn(e, "/");
+
+                /* Is this the last component? If so, then we're
+                 * done */
+                if (*p == 0)
+                        return 0;
+
+                if (!(t = strndup(path, e - path)))
+                        return -ENOMEM;
+
+                r = label_mkdir(t, mode);
+                free(t);
+
+                if (r < 0 && errno != EEXIST)
+                        return -errno;
+        }
+}
+
+int mkdir_p(const char *path, mode_t mode) {
+        int r;
+
+        /* Like mkdir -p */
+
+        if ((r = mkdir_parents(path, mode)) < 0)
+                return r;
+
+        if (label_mkdir(path, mode) < 0 && errno != EEXIST)
+                return -errno;
+
+        return 0;
+}
diff --git a/src/shared/mkdir.h b/src/shared/mkdir.h
new file mode 100644 (file)
index 0000000..c006e7c
--- /dev/null
@@ -0,0 +1,28 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+#ifndef foomkdirhfoo
+#define foomkdirhfoo
+
+/***
+  This file is part of systemd.
+
+  Copyright 2010 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+***/
+
+int safe_mkdir(const char *path, mode_t mode, uid_t uid, gid_t gid);
+int mkdir_parents(const char *path, mode_t mode);
+int mkdir_p(const char *path, mode_t mode);
+#endif
index acc4d33372badb098b8f7713e7608537b083c6f1..554f8ac965a705e5ddfd887fa53b4565eaea4b10 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "macro.h"
 #include "util.h"
+#include "mkdir.h"
 #include "socket-util.h"
 #include "missing.h"
 #include "label.h"
index 563853fad611337947878bee1e002566b0bb167a..fef58d5f30b1a4ee432ad51c25a30ab175098e1e 100644 (file)
@@ -1591,74 +1591,6 @@ char *file_in_same_dir(const char *path, const char *filename) {
         return r;
 }
 
-int safe_mkdir(const char *path, mode_t mode, uid_t uid, gid_t gid) {
-        struct stat st;
-
-        if (label_mkdir(path, mode) >= 0)
-                if (chmod_and_chown(path, mode, uid, gid) < 0)
-                        return -errno;
-
-        if (lstat(path, &st) < 0)
-                return -errno;
-
-        if ((st.st_mode & 0777) != mode ||
-            st.st_uid != uid ||
-            st.st_gid != gid ||
-            !S_ISDIR(st.st_mode)) {
-                errno = EEXIST;
-                return -errno;
-        }
-
-        return 0;
-}
-
-
-int mkdir_parents(const char *path, mode_t mode) {
-        const char *p, *e;
-
-        assert(path);
-
-        /* Creates every parent directory in the path except the last
-         * component. */
-
-        p = path + strspn(path, "/");
-        for (;;) {
-                int r;
-                char *t;
-
-                e = p + strcspn(p, "/");
-                p = e + strspn(e, "/");
-
-                /* Is this the last component? If so, then we're
-                 * done */
-                if (*p == 0)
-                        return 0;
-
-                if (!(t = strndup(path, e - path)))
-                        return -ENOMEM;
-
-                r = label_mkdir(t, mode);
-                free(t);
-
-                if (r < 0 && errno != EEXIST)
-                        return -errno;
-        }
-}
-
-int mkdir_p(const char *path, mode_t mode) {
-        int r;
-
-        /* Like mkdir -p */
-
-        if ((r = mkdir_parents(path, mode)) < 0)
-                return r;
-
-        if (label_mkdir(path, mode) < 0 && errno != EEXIST)
-                return -errno;
-
-        return 0;
-}
-
 int rmdir_parents(const char *path, const char *stop) {
         size_t l;
         int r = 0;
index e96d56dd2aa8f8b70b17fad18f48a21a914d9242..a45f54d661e3c0bc3c51a0c1865dca53df49c31a 100644 (file)
@@ -242,9 +242,6 @@ char *delete_chars(char *s, const char *bad);
 char *truncate_nl(char *s);
 
 char *file_in_same_dir(const char *path, const char *filename);
-int safe_mkdir(const char *path, mode_t mode, uid_t uid, gid_t gid);
-int mkdir_parents(const char *path, mode_t mode);
-int mkdir_p(const char *path, mode_t mode);
 
 int parent_of_path(const char *path, char **parent);
 
index 9f65b1dab0b78aeed203717b75ba3852cc3ceb1e..b0c680a030cbc2d2f5fd4d94185fe49b6bbcefd4 100644 (file)
@@ -41,6 +41,7 @@
 #include "log.h"
 #include "umount.h"
 #include "util.h"
+#include "mkdir.h"
 #include "virt.h"
 #include "watchdog.h"
 
index bb75d960ab5fd2555406f2ea99c2cebe09df976d..5b24b3422b8e9a2de77344e4d14131c17d980798 100644 (file)
@@ -36,6 +36,7 @@
 #include "load-dropin.h"
 #include "load-fragment.h"
 #include "strv.h"
+#include "mkdir.h"
 #include "unit-name.h"
 #include "dbus-socket.h"
 #include "missing.h"
index 873bf233fd36e84d85c0d9fab163c2f0330c4519..5e85e37411b55ea22a4f83d4a37a7aaa5858f345 100644 (file)
@@ -41,6 +41,7 @@
 
 #include "log.h"
 #include "util.h"
+#include "mkdir.h"
 #include "strv.h"
 #include "label.h"
 #include "set.h"
index 13481b29e950f337c726cce28dd184aba1acde93..c928b5f454853ba8ead87355d30dfce066f021b9 100644 (file)
@@ -33,6 +33,7 @@
 #include <fcntl.h>
 
 #include "util.h"
+#include "mkdir.h"
 #include "conf-parser.h"
 #include "utmp-wtmp.h"
 #include "socket-util.h"