Commit graph

11421 commits

Author SHA1 Message Date
Lennart Poettering 461bd8e47c update TODO 2013-04-18 22:19:33 +02:00
Harald Hoyer 8d768d9962 cryptsetup: ask for password, if key file cannot be accessed
If the key file cannot be accessed, we can at least ask for the
password.
2013-04-18 22:17:13 +02:00
Josh Triplett 4befe2eba0 systemd-logind: Fix linking by reordering libraries in LDADD
libsystemd-audit needs functions from libsystemd-shared, so
libsystemd-audit needs to appear first.  Otherwise:

  CCLD   systemd-logind
./.libs/libsystemd-audit.a(audit.o): In function `audit_session_from_pid':
/home/josh/src/systemd/src/shared/audit.c:50: undefined reference to `detect_container'
2013-04-18 20:33:26 +02:00
Kay Sievers b030d1f864 bus: test - add hack to receive messages 2013-04-18 19:05:10 +02:00
Kay Sievers a2cef833cf bus: catch up with kernel changes 2013-04-18 18:54:17 +02:00
Henrik Grindal Bakken cee22bd3cb buildsys: Add --disable-tests to avoid building tests
This patch adds --disable-tests to configure.  It is based on a patch
posted by Thierry Reding in 2010.  The motivation for adding it is that
some tests fail link-time when cross-compiling.

The patch adds a new Makefile variable -- manual_tests -- and uses
that instead of noinst_PROGRAMS.  However, if ENABLE_TESTS is true,
the former is added to the latter.  It also renames noinst_tests to
simply tests.
2013-04-18 17:15:59 +02:00
Harald Hoyer 4826f0b7b5 Revert f_type fixups
This reverts commit a858b64ddd.
This reverts commit aea275c431.
This reverts commit fc6e6d245e.
This reverts commit c4073a27c5.
This reverts commit cddf148028.
This reverts commit 8c68a70170.

The constants are now casted to __SWORD_TYPE, which should resolve the
compiler warnings about signed vs unsigned.

After talking to Kay, we concluded:

This should be fixed in the kernel, not worked around in userspace tools.

Architectures cannot use int and expect magic constants lager than INT_MAX
to work correctly. The kernel header needs to be fixed.

Even coreutils cannot handle it:
  #define RAMFS_MAGIC  0x858458f6
  # stat -f -c%t /
  ffffffff858458f6

  #define BTRFS_SUPER_MAGIC 0x9123683E
  # stat -f -c%t /mnt
  ffffffff9123683e

Although I found the perfect working macro to fix the thing :)

        __extension__ ({                                                \
                        bool _ret = false;                              \
                        switch(f) { case c: _ret=true; };               \
                        ( _ret );                                       \
                })
2013-04-18 15:01:55 +02:00
Harald Hoyer a858b64ddd macro.h: let F_TYPE_CMP() macro fail to compile, if second parameter is not const
If the magic parameter is not a const, then the macro does not work, so
better fail to compile, than be surprised afterwards.
2013-04-18 12:05:41 +02:00
Harald Hoyer 98f59e59e0 fileio.c: do not parse comments after non-whitespace chars
systemd does not want to understand comments after the first
non-whitespace char occured.

key=foo #comment  will result into key == "foo #comment"
key="foo" #comment  will result into key == "foo#comment"
"key= #comment" will result into key == "#comment"
"key #comment" is an invalid line
2013-04-18 11:29:00 +02:00
Harald Hoyer bef8951800 sd-login.c: fixup for d70964d0
p pointer is not _cleanup_free_
2013-04-18 10:16:17 +02:00
Harald Hoyer 7fd1b19bc9 move _cleanup_ attribute in front of the type
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
2013-04-18 09:11:22 +02:00
Harald Hoyer d70964d0f6 login/sd-login.c: make use of _cleanup_free_ and friends 2013-04-18 08:39:07 +02:00
Harald Hoyer aea275c431 rename CMP_F_TYPE to F_TYPE_CMP 2013-04-18 08:06:55 +02:00
Harald Hoyer fc6e6d245e Add ugly CMP_F_TYPE() macro
On some architectures (like s390x) the kernel has the type int for
f_type, but long in userspace.
Assigning the 32 bit magic constants from linux/magic.h to the 31 bit
signed f_type in the kernel, causes f_type to be negative for some
constants.
glibc extends the int to long for those architecures in 64 bit mode, so
the negative int becomes a negative long, which cannot be simply
compared to the original magic constant, because the compiler would
automatically cast the constant to long.
To workaround this issue, we also compare to the (int)MAGIC value in a
macro. Of course, we could do #ifdef with the architecure, but it has to
be maintained, and the magic constants are 32 bit anyway.

Someday, when the int is unsigned or long for all architectures, we can
remove this macro again. Until then, keep it as simple as it can be.
2013-04-18 07:34:25 +02:00
Harald Hoyer 5521d69856 core/execute: only clean the environment, if we have one 2013-04-18 07:16:01 +02:00
Lennart Poettering 14787e6499 build-sys: add sd_journal_add_conjunction() to symbol versioning file 2013-04-18 03:12:06 +02:00
Lennart Poettering 3dc8396ba9 man: document the new sd_journal_add_conjunction() call 2013-04-18 03:11:44 +02:00
Lennart Poettering 248f077586 update TODO 2013-04-18 02:54:58 +02:00
Simon Peeters 449101fce2 Move bus_error to dbus-common and remove bus_error_message_or_strerror
bus_error and bus_error_message_or_strerror dit almost exactly the same,
so use only one of them and place it in dbus-common.
2013-04-18 02:54:58 +02:00
Harald Hoyer 951657bd0a cryptsetup-generator: add support for rd.luks.key=
Also clarify rd.luks.uuid and luks.uuid in the manual.

https://bugzilla.redhat.com/show_bug.cgi?id=905683
2013-04-18 02:45:01 +02:00
Lennart Poettering 8b95c91638 man: document that timeout=0 is the default for entries in crypttab 2013-04-18 02:21:01 +02:00
Harald Hoyer 49714341c3 cryptsetup: set the timeout to 0 by default
cryptsetup itself has no timeout as default from the beginning. So the
default timeout has been "0" from the beginning.

https://bugzilla.redhat.com/show_bug.cgi?id=949702
2013-04-18 02:19:46 +02:00
Lennart Poettering 099a804b11 execute: always add in EXECUTABLE= field when we log something about execution 2013-04-18 02:18:33 +02:00
Lennart Poettering a5e4972c89 systemctl: drop usage of "internally loaded modules"
I wouldn't know what "internally" is supposed to mean hear, and we use
this terminology in this context nowhere else, so let's drop this.
2013-04-18 02:10:44 +02:00
Lennart Poettering b7253ecda5 readahead: let readahead run for a little longer
Especially slower systems need more than 10s for starting the session,
so let's bump this to 30s.
2013-04-17 22:24:07 +02:00
Lennart Poettering ab8e074ce2 update TODO 2013-04-17 22:24:07 +02:00
Harald Hoyer c4073a27c5 fixup for cddf148028
Instead of making a type up, just use __SWORD_TYPE, after reading
statfs(2).

Too bad, this does not fix s390x because __SWORD_TYPE is (long int) and
the kernel uses (int) to fill in the field!!!!!!
2013-04-17 19:00:50 +02:00
Auke Kok 9e6d4c613d bootchart: Fix errno usage. 2013-04-17 09:49:33 -07:00
Lennart Poettering b454b11220 update TODO 2013-04-17 18:48:32 +02:00
Lennart Poettering c556fe792d bus: replace aligned_alloc() with memalign() everywhere
aligned_alloc() is C11 and not available everywhere. Also it would
require us to align the size value. So let's just invoke memalign()
instead, which is universally available and doesn't have any alignment
restrictions on the size parameter.
2013-04-17 18:48:31 +02:00
Henrik Grindal Bakken 05b9b83ad3 core: Remove unnecessary typedef
ExecContext isn't used in this header file, and everything seems to
build just fine without this typedef.  The typedef doesn't really belong
here, and at least my gcc-4.4.6 gives an error on type redefined.
2013-04-17 18:27:46 +02:00
Harald Hoyer cddf148028 fixup 8c68a7017 and cast to (unsigned long) 2013-04-17 18:23:17 +02:00
Harald Hoyer 8c68a70170 fixed statfs.f_type signed vs unsigned comparisons
statfs.f_type is signed but the filesystem magics are unsigned.
Casting the magics to signed will not make the signed.

Problem seen on big-endian 64bit s390x with __fsword_t 8 bytes.

Casting statfs.f_type to unsigned on the other hand will get us what we
need.

https://bugzilla.redhat.com/show_bug.cgi?id=953217
2013-04-17 18:14:25 +02:00
Zbigniew Jędrzejewski-Szmek 90cf049bfe shell-completion: use -a to see "empty" properties 2013-04-17 10:53:18 -04:00
Lennart Poettering 4a449ed73d update TODO 2013-04-17 16:19:05 +02:00
Harald Hoyer 755123030a TODO: add s.th. like "systemctl set-log-level debug" 2013-04-17 15:41:18 +02:00
Harald Hoyer ebc05a09ad core/execute: report invalid environment variables from files
Because "export key=val" is not supported by systemd, an error is logged
where the invalid assignment is coming from.

Introduce strv_env_clean_log() to log invalid environment assignments,
where logging is possible and allowed.

parse_env_file_internal() is modified to allow WHITESPACE in keys, to
report the issues later on.
2013-04-17 15:31:45 +02:00
Harald Hoyer d2a514b838 Revert "man/systemd.xml: change the signal names to kill systemd"
This reverts commit 432c30d25f.

Suggestion was to fix bash instead. :-/
2013-04-17 14:58:08 +02:00
Harald Hoyer 4b6756a88d systemctl:enable_sysv_units() more _cleanup_free_ 2013-04-17 12:03:20 +02:00
Harald Hoyer db53720916 fileio:parse_env_file_internal() fix environment file parsing
parse_env_file_internal() could not parse the following lines correctly:

export key="val"
key="val"#comment
2013-04-17 11:06:25 +02:00
Harald Hoyer 03bb799e0b core/execute.c: debug log final execve() with argv[]
https://bugzilla.redhat.com/show_bug.cgi?id=772073
2013-04-17 09:54:24 +02:00
Harald Hoyer 432c30d25f man/systemd.xml: change the signal names to kill systemd
Using the signal name to put systemd in debug mode with bash results in:
 $ kill -s SIGRTMIN+22 1
 bash: kill: SIGRTMIN+22: invalid signal specification

whereas this works:
 $ kill -s SIGRTMAX-8 1

/usr/bin/kill understands both signal names, so just change them to the
bash names.
2013-04-17 09:44:59 +02:00
Harald Hoyer 87698625aa systemctl: clarify usage of "--all" versus list-unit-files
Novice users might think, that
 $ systemctl --all
is equal to
 $ systemctl list-unit-files

https://bugzilla.redhat.com/show_bug.cgi?id=748512
2013-04-17 09:23:09 +02:00
Harald Hoyer b9e405246e journalctl: specify "--unit=" and "--user-unit" multiple times
Previously only one "--unit=" or "--user-unit" could be specified.
With this patch, journalcrtl can show multiple units.

$ journalctl -u systemd-udevd.service -u sshd.service -u crond.service -b
-- Logs begin at Sa 2013-03-23 11:08:45 CET, end at Fr 2013-04-12
09:10:22 CEST. --
Apr 12 08:41:37 lenovo systemd[1]: Started udev Kernel Device Manager.
Apr 12 08:41:37 lenovo systemd[1]: Stopped udev Kernel Device Manager.
Apr 12 08:41:38 lenovo systemd[1]: Started udev Kernel Device Manager.
Apr 12 08:41:38 lenovo crond[291]: (CRON) INFO (Syslog will be used
		instead of sendmail.)
Apr 12 08:41:38 lenovo crond[291]: (CRON) INFO (running with inotify
		support)
Apr 12 08:41:39 lenovo systemd[1]: Starting OpenSSH server daemon...
Apr 12 08:41:39 lenovo systemd[1]: Started OpenSSH server daemon.
Apr 12 08:41:39 lenovo sshd[355]: Server listening on 0.0.0.0 port 22.
Apr 12 08:41:39 lenovo sshd[355]: Server listening on :: port 22.
Apr 12 08:41:39 lenovo mtp-probe[373]: checking bus 1, device 8:
"/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5.6/1-1.5.6.2/1-1.5.6.2.1"
2013-04-17 09:15:23 +02:00
Harald Hoyer cd34b3c667 journal: add one more level on top with AND
When using "-p" and "-b" in combination with "-u", the output is not
what you would expect. The reason is the sd_journal_add_disjunction()
call in add_matches_for_unit() and add_matches_for_user_unit(), which
adds two ORs without taking the other conditions to every OR.

Adding another level on top with AND and sd_journal_add_conjunction()
solves the problem.

Output before:

$ journalctl -o short-monotonic -ab -p 0 -u sshd.service

-- Reboot --
[    3.216305] lenovo systemd[1]: Starting OpenSSH server daemon...
-- Reboot --
[    3.168666] lenovo systemd[1]: Starting OpenSSH server daemon...
[    3.169639] lenovo systemd[1]: Started OpenSSH server daemon.
[36285.635389] lenovo systemd[1]: Stopped OpenSSH server daemon.
-- Reboot --
[   10.838657] lenovo systemd[1]: Starting OpenSSH server daemon...
[   10.913698] lenovo systemd[1]: Started OpenSSH server daemon.
[ 6881.035183] lenovo systemd[1]: Stopped OpenSSH server daemon.
-- Reboot --
[    6.636228] lenovo systemd[1]: Starting OpenSSH server daemon...
[    6.662573] lenovo systemd[1]: Started OpenSSH server daemon.
[    6.681148] lenovo sshd[397]: Server listening on 0.0.0.0 port 22.
[    6.681379] lenovo sshd[397]: Server listening on :: port 22.

As we see, the output is from _every_ boot and priority 0 is not taken
into account.

Output after patch:

$ journalctl -o short-monotonic -ab -p 0 -u sshd.service
-- Logs begin at Sun 2013-02-24 20:54:44 CET, end at Tue 2013-03-19 14:58:21 CET. --

Increasing the priority:

$ journalctl -o short-monotonic -ab -p 6 -u sshd.service
-- Logs begin at Sun 2013-02-24 20:54:44 CET, end at Tue 2013-03-19 14:59:12 CET. --
[    6.636228] lenovo systemd[1]: Starting OpenSSH server daemon...
[    6.662573] lenovo systemd[1]: Started OpenSSH server daemon.
[    6.681148] lenovo sshd[397]: Server listening on 0.0.0.0 port 22.
[    6.681379] lenovo sshd[397]: Server listening on :: port 22.
2013-04-17 09:15:23 +02:00
Harald Hoyer 003ac9d031 core/device.c: fix possible segfault
https://bugs.freedesktop.org/show_bug.cgi?id=63189

better fail than segfault

systemd[1]: Failed to load device unit: Invalid argument
systemd[1]: Failed to process udev device event: Invalid argument
2013-04-17 09:05:37 +02:00
Harald Hoyer aa21e2bf21 TODO: remove fixed systemctl property bug 2013-04-17 08:48:07 +02:00
Harald Hoyer 7e7d4da229 timedated: fixed NTP enabled: n/a 2013-04-17 08:28:41 +02:00
Martin Jansa ac714a78fd configure: use AC_CHECK_TOOL for objcopy, strings and gperf
* using AC_PATH_TOOL does not allow to override it from shell environment
  which is useful when cross-compiling
* with external toolchain I have different HOST_PREFIX and HOST_SYS
  AC_PATH_TOOL is using HOST_SYS as prefix and fails to find objcopy
  which is available only as ${TARGET_PREFIX}-objcopy then it tries
  objcopy without prefix which is found on host, but that objcopy
  does not work for !host (e.g. arm when building on x86) libs
2013-04-17 00:41:16 -04:00
Mantas Mikulėnas ced2d10a28 fileio: also escape $ and ` when writing out env vars
These are also considered special by sh and bash.
2013-04-17 00:32:02 -04:00