1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 08:26:52 +03:00
Commit Graph

10245 Commits

Author SHA1 Message Date
Lennart Poettering
9b5d6bd909 test-env-replace: better user assert_se() everywhere
For test tools it's better to use assert_se() rather than assert(),
since the former is not optimized away, even if -DNDEBUG is used. That
means the test program now retains its usefulness even if -DNDEBUG is
used.

This also adds in some OOM checks, to be extra anal...
2013-02-11 03:55:07 +01:00
Lennart Poettering
4d1a690438 env: considerably beef up environment cleaning logic
Now, actually check if the environment variable names and values used
are valid, before accepting them. With this in place are at some places
more rigid than POSIX, and less rigid at others. For example, this code
allows lower-case environment variables (which POSIX suggests not to
use), but it will not allow non-UTF8 variable values.

All in all this should be a good middle ground of what to allow and what
not to allow as environment variables.

(This also splits out all environment related calls into env-util.[ch])
2013-02-11 03:54:50 +01:00
Thomas Hindoe Paaboel Andersen
c62c294fd5 tests: add tests of strxcpyx
also fix a bad indentation in test-strbug.c
2013-02-10 23:06:16 +01:00
Michael Biebl
89ca69941d man: typo fix in systemd.socket 2013-02-09 14:09:05 +01:00
Lennart Poettering
efd3cf4326 update TODO 2013-02-09 02:47:42 +01:00
Lennart Poettering
a25d4d0e3c vconsole-setup: don't set the kbd mode to unicode if is is currently in raw/off mode
Let's not confuse X11
2013-02-09 02:40:57 +01:00
Lennart Poettering
c65eb83653 shutdown: issue a sync() as soon as shutdown.target is queued 2013-02-09 02:20:42 +01:00
Thomas Hindoe Paaboel Andersen
97b5f60818 tests: add test of strbuf 2013-02-09 01:40:52 +01:00
Lennart Poettering
2d96536dd7 logind: rename "seat-master" tag to "master-of-seat"
We currently enforce that seats are to be named in the form of
"seatXXX", i.e. need to begin with the 4 characters "seat". Thus,
"seat-master" would qualify as a seat name. As seat names are frequently
used as tags on devices, the "seat-master" tag might hence confuse
logind if the user decides to name a seat "seat-master".

Hence, avoid any ambuigity: let's rename the "seat-master" tag to
"master-of-seat".
2013-02-09 01:25:55 +01:00
Lennart Poettering
eb124a97fb update TODO 2013-02-09 01:17:36 +01:00
Lennart Poettering
79cd774324 man: fix prototype of sd_get_uids() 2013-02-08 23:31:37 +01:00
Lennart Poettering
990ffbe5cf update TODO 2013-02-08 23:31:37 +01:00
Kay Sievers
3d85f7e02a build-sys: link libudev against the internal sd-daemon lib, not the source file 2013-02-08 13:25:26 +01:00
Kay Sievers
3e49f2ecb5 udev: udevadm hwdb - add --root=
https://bugs.freedesktop.org/show_bug.cgi?id=60398
2013-02-08 12:00:05 +01:00
Kay Sievers
e02caf30ac shared: conf-files - use root parameter and convert to auto-cleanup 2013-02-08 11:52:10 +01:00
Kay Sievers
7850b3b837 shared: conf-files - add root parameter 2013-02-08 10:23:04 +01:00
Zbigniew Jędrzejewski-Szmek
0b9cc004a4 systemd: fix uninitialized memory access in selinux
==6129== Syscall param socketcall.getsockopt(optlen) points to uninitialised byte(s)
==6129== at 0x312D0F325A: getsockopt (syscall-template.S:81)
==6129== by 0x4615E6: get_audit_data (selinux-access.c:268)
==6129== by 0x461A81: selinux_access_check (selinux-access.c:394)
==6129== by 0x453B23: bus_manager_message_handler (dbus-manager.c:1395)
==6129== by 0x313581D9C4: _dbus_object_tree_dispatch_and_unlock (dbus-object-tree.c:862)
==6129== by 0x313580FC1F: dbus_connection_dispatch (dbus-connection.c:4672)
==6129== by 0x44CD4C: bus_dispatch (dbus.c:528)
==6129== by 0x41292F: manager_loop (manager.c:1573)
==6129== by 0x40CD8E: main (main.c:1735)
==6129== Address 0x7fefff2c0 is on thread 1's stack
2013-02-07 21:13:19 -05:00
Thomas Hindoe Paaboel Andersen
940bd4738b tests: add more tests
Adds tests of:
 strv_env_delete
 strv_env_unset
 strv_env_set
2013-02-08 00:25:37 +01:00
Zbigniew Jędrzejewski-Szmek
9d6cbf7871 build-sys: fix build without -Wl,--gc-sections
In 8d81eb8e the new library was added for libudev, use it for
libsystemd-journal too.
2013-02-07 16:26:09 -05:00
Kay Sievers
beb23689e3 udev: remove HWDB_BIN 2013-02-07 21:54:49 +01:00
Thomas Hindoe Paaboel Andersen
1f28b2deb4 test-env-replace: assert results instead of printing them
Also code cleanup and split into functions in preparation for more tests
to come.
2013-02-07 21:14:36 +01:00
Kay Sievers
8d81eb8e24 build-sys: at least for now, never link libudev against systemd's shared libraries 2013-02-07 14:35:20 +01:00
David Strauss
78c55e2155 build-sys: add libsystemd-id128 as libudev dependency
After d848b9cbfa 'Move generic specifier functions to shared' libudev
depends (through) libsystemd-shared.la on libsystemd-id128.so.  The
problem only appears when the linker does not support --gc-sections
and manifests itself as the inability to resolve sd_id128_get_machine
and other libsystemd-id128 functions, which aren't really used.
2013-02-07 01:28:16 -05:00
Zbigniew Jędrzejewski-Szmek
42007a09f3 build-sys: restore man/index.html as link to systemd.index.html
It got lost in the transformation to XML generation.
2013-02-07 01:16:30 -05:00
Zbigniew Jędrzejewski-Szmek
15cd601be0 man: fix return value for sd_journal_flush_matches
https://bugs.freedesktop.org/show_bug.cgi?id=60133
2013-02-07 01:02:34 -05:00
Zbigniew Jędrzejewski-Szmek
53057ef93b man: document COREDUMP_UNIT and COREDUMP_USER_UNIT
Also fix formatting for kernel related fields, enabling them
to show up in the directives index.
2013-02-07 01:02:34 -05:00
Mirco Tischler
b7f7c68570 coredump: make use of the cleanup macros 2013-02-07 01:02:34 -05:00
Mirco Tischler
a4b88c1ecb logs-show: show messages for all unit types in systemctl status
I can't find a reason why we shouldn't try to output messages for other
unit types than .service, .socket, .mount and .swap as well. It's probably
a leftover from before we started logging UNIT= from inside PID 1.
2013-02-07 01:02:34 -05:00
Mirco Tischler
f904546894 journal: log user units for coredumps and show them in systemctl status 2013-02-07 01:02:34 -05:00
Eelco Dolstra
d2f1f23ad2 nss-myhostname: copy first result to preallocated buffer
Fixes a segfault in nscd when using nss-myhostname.

Nscd expects that an NSS module's gethostbyname4_r function returns
its first result in the pre-allocated gaih_addrtuple denoted by **pat.
(See nscd/aicache.c in the Glibc sources.)  However, nss-myhostname
doesn't fill in **pat but allocates the first result in ‘buffer’, then
sets *pat.  So nscd crashes (e.g. when running ‘getent ahosts
my-machine’).

Hard to tell if this is a bug in nscd, since there doesn't seem to be
a proper API spec for gethostbyname4_r.  But in any case, this patch
fixes the crash by copying the first result to **pat.
2013-02-07 01:02:33 -05:00
Zbigniew Jędrzejewski-Szmek
13219b7f74 man: describe unit load path in systemd.unit(5)
In other cases where multiple directories are searched for unit files,
the list of directories is described in the man page describing the
format. I think this makes sense too in case of systemd directories,
since the systemd(1) manpage already has an overview of many different
topics.
2013-02-07 01:00:10 -05:00
Zbigniew Jędrzejewski-Szmek
c78ab91132 build-sys: substitute strings in systemd.unit(5)
Makefile.am is updated to deal with .xml.in sources.  Nothing in the
output is really changed yet, this is just preparation.
2013-02-06 23:16:17 -05:00
Zbigniew Jędrzejewski-Szmek
7ad94c716d systemd: raise level of message about lookup paths
This can be pretty important for the user, and is not trivial
to figure out in all cases.

Also show failing path in error messages.
2013-02-06 23:16:17 -05:00
Zbigniew Jędrzejewski-Szmek
0783951b93 shared: remove now unused function 2013-02-06 23:16:17 -05:00
Zbigniew Jędrzejewski-Szmek
874310b7b6 systemd: do not remove empty paths from unit lookup path
The ability to start a new unit with 'systemctl start ...' should not
depend on whether there are other units in the directory. Previously,
an additional 'systemctl daemon-reload' would be necessary to tell
systemd to update the list of unit lookup paths.
2013-02-06 23:16:16 -05:00
Zbigniew Jędrzejewski-Szmek
56ba3c78ae build-sys: create Makefile-man.am automatically
man rules were repeating the same information in too many places,
which was error prone. Those rules can be easily generated from .xml
files. For efficiency and because python is not a required dependency,
Makefile-man.am is only regenerated when requested with

  make update-man-list

If no metadata in man/*.xml changed, this file should not change. So
only when a new man page or a new alias is added, this file should
show up in 'git diff'. The change should then be committed.

If the support for building from git without python was dropped, we
could drop Makefile-man.am from version control. This would also
increase the partial build time (since more stuff would be rebuild
whenever sources in man/*.xml would be modified), so it would probably
wouldn't be worth it.
2013-02-06 23:16:16 -05:00
Zbigniew Jędrzejewski-Szmek
823eb4e64e build-sys: split man alias rules into separate file
There shouldn't be any functional change. This is an 'automake include',
so the generated Makefile is the same (apart from ordering).
2013-02-06 23:16:16 -05:00
Zbigniew Jędrzejewski-Szmek
63ed840e59 build-sys: replace one last mkdir hook with list item
Previously, errors would be ignored. Now they are not. But I don't see
how we could fail to create the directory, so I don't think that it
matters.
2013-02-06 23:16:03 -05:00
Zbigniew Jędrzejewski-Szmek
0a4c519bd3 man: see also dracut(7) in bootup(7) 2013-02-06 23:15:31 -05:00
Zbigniew Jędrzejewski-Szmek
c5e33bf834 tests: skip tests if manager cannot be created
When running without a user session, tests fail.
2013-02-06 19:29:33 -05:00
Thomas Hindoe Paaboel Andersen
10ddd913f0 tests: move strv_parse_nulstr to test-strv, and actually test it
The test was originally added with this commit message:
"ask-password: supported plymouth cached passwords"
2013-02-07 00:38:16 +01:00
Thomas Hindoe Paaboel Andersen
7c2d80944a strv: add strv_print
Clearer, and spares the temp variable.
2013-02-07 00:38:09 +01:00
Zbigniew Jędrzejewski-Szmek
fa3cd7394c tests: run manager in session mode
False positives pop up otherwise.

FAIL: test-unit-name (exit: 134)
================================

Failed to open /dev/tty0: Permission denied
Failed to create root cgroup hierarchy: Permission denied
Assertion 'manager_new(SYSTEMD_SYSTEM, &m) == 0' failed at src/test/test-unit-name.c:125, function test_unit_printf(). Aborting.
2013-02-06 17:06:26 -05:00
Thomas Hindoe Paaboel Andersen
539ad707db test: add a few tests and tidy up
adds test of:
strv_find
strv_find_prefix
strv_overlap
strv_sort
streq_ptr
first_word

Splits tests of util.c into own file to avoid clutter as we add more.

Removed a few prints and uses _cleanup_free_ to make the tests more focused.
2013-02-06 21:15:23 +01:00
Umut Tezduyar
4f19b1df41 man: remove boot up runlevel support
As of 3cdebc217c support for
distro specific boot up runlevels has been dropped.
2013-02-04 22:39:56 +01:00
Lennart Poettering
398a745c73 update TODO 2013-02-04 22:27:32 +01:00
Lennart Poettering
f8aeee1f1f update TODO 2013-02-04 20:46:17 +01:00
Kay Sievers
f2f1861383 hwdb: update 2013-02-04 18:55:10 +01:00
Kay Sievers
2f8d077ece TODO: update 2013-02-04 18:54:58 +01:00
Michal Schmidt
18cf1a1be5 cryptsetup: accept both "read-only" and "readonly" spellings
Mukund Sivaraman pointed out that cryptsetup(5) mentions the "read-only"
option, while the code understands "readonly".

We could just fix the manpage, but for consistency in naming of
multi-word options it would be prettier to have "read-only". So let's
accept both spellings.

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=903463
2013-01-31 19:57:56 +01:00