summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2013-09-09run: allow non-absolute paths as commandZbigniew Jędrzejewski-Szmek
2013-09-09path-util.c: small modernizationZbigniew Jędrzejewski-Szmek
2013-09-09systemd-run: properly escape argumentsZbigniew Jędrzejewski-Szmek
Spaces, quotes, and such, were not properly escaped. We should write them like we read them. https://bugs.freedesktop.org/show_bug.cgi?id=67971
2013-09-06systemd-coredump: Log crashes without coredumps on failureAndrew Cook
Make a best-effort attempt to store information about crashes during failure, currently if these are encountered the crash is completely silenced. ideally coredumpctl would show if a coredump is available.
2013-09-06systemd-coredump: Ignore coredumps larger than COREDUMP_MAXAndrew Cook
Currently this check happens when the coredump has been collected in it's entirety and being received by journald. this is not ideal behaviour when the crashing process is consuming significant percentage of physical memory such as a large instance of firefox or a java application.
2013-09-06journald: fix fd leak in journal_file_emptyGeorge McCollister
Before my previous patch, journal_file_empty wasn't be called with the correct filename. Now that it's being called with the correct filename it leaks file descriptors. This patch closes the file descriptors before returning. Signed-off-by: George McCollister <george.mccollister@gmail.com> [Edit harald@redhat.com: make use of _cleanup_close_ instead]
2013-09-06journald: fix vacuuming of archived journalsGeorge McCollister
d_name is modified on line 227 so if the entire journal name is needed again p must be used. Before this change when journal_file_empty was called on archived journals it would always return with -2. Signed-off-by: George McCollister <george.mccollister@gmail.com>
2013-09-04libudev: enumerate - do not try to match against an empty subsystemKay Sievers
2013-09-04libudev: enumerate: fix NULL-deref for subsystem-matchesDavid Herrmann
udev_device_get_subsystem() may return NULL if no subsystem could be figured out by libudev. This might be due to OOM or if the device disconnected between the udev_device_new() call and udev_device_get_subsystem(). Therefore, we need to handle subsystem==NULL safely. Instead of testing for it in each helper, we treat subsystem==NULL as empty subsystem in match_subsystem(). Backtrace of udev_enumerate with an input-device disconnecting in exactly this time-frame: (gdb) bt #0 0x00007ffff569dc24 in strnlen () from /usr/lib/libc.so.6 #1 0x00007ffff56d9e04 in fnmatch@@GLIBC_2.2.5 () from /usr/lib/libc.so.6 #2 0x00007ffff5beb83d in match_subsystem (udev_enumerate=0x7a05f0, subsystem=0x0) at src/libudev/libudev-enumerate.c:727 #3 0x00007ffff5bebb30 in parent_add_child (enumerate=enumerate@entry=0x7a05f0, path=<optimized out>) at src/libudev/libudev-enumerate.c:834 #4 0x00007ffff5bebc3f in parent_crawl_children (enumerate=enumerate@entry=0x7a05f0, path=0x7a56b0 "/sys/devices/<shortened>/input/input97", maxdepth=maxdepth@entry=254) at src/libudev/libudev-enumerate.c:866 #5 0x00007ffff5bebc54 in parent_crawl_children (enumerate=enumerate@entry=0x7a05f0, path=0x79e8c0 "/sys/devices/<shortened>/input", maxdepth=maxdepth@entry=255) at src/libudev/libudev-enumerate.c:868 #6 0x00007ffff5bebc54 in parent_crawl_children (enumerate=enumerate@entry=0x7a05f0, path=path@entry=0x753190 "/sys/devices/<shortened>", maxdepth=maxdepth@entry=256) at src/libudev/libudev-enumerate.c:868 #7 0x00007ffff5bec7df in scan_devices_children (enumerate=0x7a05f0) at src/libudev/libudev-enumerate.c:882 #8 udev_enumerate_scan_devices (udev_enumerate=udev_enumerate@entry=0x7a05f0) at src/libudev/libudev-enumerate.c:919 #9 0x00007ffff5df8777 in <random_caller> () at some/file.c:181
2013-09-04cgtop: fixup the online helpBrandon Philips
The online help shows the keys as uppercase but the code and manpage say lower case. Make the online help follow reality.
2013-09-04libudev: fix memleak when enumerating childsDavid Herrmann
We need to free udev-devices again if they don't match. Funny that no-one noticed it yet since valgrind is quite verbose about it. Fix it and free non-matching devices.
2013-08-30main: drop capabilities of userhelpers before oursHarald Hoyer
First drop the capabilities of the userhelpers before dropping our own, otherwise we might not be allowed to drop the capabilities of the userhelpers. Especially, if we want to drop CAP_SYS_MODULE. Credits: Matteo Sasso
2013-08-28Do not realloc strings, which are already in the hashmap as keysHarald Hoyer
This prevents corruption of the hashmap, because we would free() the keys in the hashmap, if the unit is already in there, with the same cgroup path.
2013-08-28Revert "cgroup.c: check return value of unit_realize_cgroup_now()"Harald Hoyer
This reverts commit 1f11a0cdfe397cc404d61ee679fc12f58c0a885b.
2013-08-28cgroup: only check once when mode is UNIT_CHECKGao feng
If the mode is UNIT_CHECK,it means we only want to check if the paramaters are valid. the first round of cycle already did this check, no need to check again.
2013-08-28device cgroup: don't create a new CGroupDeviceAllow when it already in the listGao feng
If a device node is already in the device_allow list of CGroupContext, we should replace it instead of create a new one and append this new one to the end of device_allow list. change from v1: use streq to replace !strcmp
2013-08-28blcokio bandwidth: add missing set of CGroupBlockIODeviceBandwidth's readGao feng
BlockIOReadBandwidth and BlockIOWriteBandwidth both use config_parse_blockio_bandwidth to set up CGroupBlockIODeviceBandwidth, We should set the read value based on the left values in config files.
2013-08-28logind-session.c: use _cleanup_Zbigniew Jędrzejewski-Szmek
2013-08-28logind: be more verbose on errorsZbigniew Jędrzejewski-Szmek
2013-08-28Disallow invalid UTF-8 configurationZbigniew Jędrzejewski-Szmek
It is best to catch such errors early. If invalid UTF-8 ends up being given to dbus methods, the program will crash: process 20801: arguments to dbus_message_iter_append_basic() were incorrect, assertion "_dbus_check_is_valid_utf8 (*string_p)" failed in file dbus-message.c line 2598.
2013-08-27log to kmsg when "debug" is used on the kernel command lineKay Sievers
2013-08-23"-" prefix for InaccessibleDirectories and ReadOnlyDirectoriesMaciej Wereski
2013-08-23udev: fix printf(3) type specifierShawn Landden
src/udev/udev-rules.c: In function 'add_rule': src/udev/udev-rules.c:1078:33: warning: format '%lu' expects argument of type 'long unsigned int', but argument 8 has type 'int' [-Wformat=] log_error("invalid key/value pair in file %s on line %u," ^
2013-08-23blkio: fix incorrect setting of cpu_sharesGao feng
We should set up blockio_weight not cpu_shares.
2013-08-23nspawn: trivial simplificationZbigniew Jędrzejewski-Szmek
2013-08-23cgroup.c: check return value of unit_realize_cgroup_now()Harald Hoyer
do not recurse further, if unit_realize_cgroup_now() failed
2013-08-22Revert "udevd: simplify sigterm check"Colin Walters
This reverts commit 47e737dc13bf4251ae5a2249ec29b34503ed92e1 - it introduced a use-after-free. The only way the code would get simpler is with a cleanup function, but eh, not worth it for just this one bit. Reviewed by kay on IRC.
2013-08-22Optimize startswith() to macroKay Sievers
I guess it's easier and cleaner anyway to use simple static inline functions instead of defines.
2013-08-22remove hasprefix(), use startswith()Shawn Landden
2013-08-22test: Make testing work on systems without or old systemdHolger Hans Peter Freyther
* Introduce a macro to conditionally execute tests. This avoids skipping the entire test if some parts require systemd * Skip the journal tests when no /etc/machine-id is present * Change test-catalog to load the catalog from the source directory of systemd. * /proc/PID/comm got introduced in v2.6.33 but travis is still using v2.6.32. * Enable make check and make distcheck on the travis build * Use -D"CATALOG_DIR=STR($(abs_top_srcdir)/catalog)" as a STRINGIY would result in the path '/home/ich/source/linux' to be expanded to '/home/ich/source/1' as linux is defined to 1.
2013-08-21logs-show: fix condition for ellipsizing multi-line messagesZbigniew Jędrzejewski-Szmek
falconindy> the ellipsizing seems a bit wrong here.... I got a bit carried away with putting dots everywhere :)
2013-08-20logs-show: show source timestamp in verbose modeZbigniew Jędrzejewski-Szmek
This makes verbose behave like short mode, i.e. try to show the source timestamp, and fall back to journald timestamp only if unavailable or unparsable. I think verbose should be like short, only showing more fields, and showing different timestamps would be confusing.
2013-08-20logs-show: add short-precise mode with us timestampsZbigniew Jędrzejewski-Szmek
Also, always show us timestamps in verbose mode. https://bugzilla.redhat.com/show_bug.cgi?id=991678
2013-08-20Rename F_TYPE_CMP() to F_TYPE_EQUAL()Zbigniew Jędrzejewski-Szmek
2013-08-20udev: when complaining about invalid characters, print them outZbigniew Jędrzejewski-Szmek
systemd-udevd[6260]: invalid key/value pair in file /usr/lib/udev/rules.d/60-ffado.rules on line 46,starting at character 84 ('#')
2013-08-20gpt-auto-generator: do not show error for non-GPT disksZbigniew Jędrzejewski-Szmek
2013-08-20gpt-auto-generator: use _cleanup_ for blkid_free_probeZbigniew Jędrzejewski-Szmek
2013-08-20gpt-auto-generator: include device name in error reportsZbigniew Jędrzejewski-Szmek
2013-08-19journal: fix parsing of facility in syslog messagesZbigniew Jędrzejewski-Szmek
In 49998b383 (journald: do not overwrite syslog facility when parsing priority) journald started ignoring facility part when reading service stderr to convert to syslog messages. In this case it is fine, because only the priority is allowed. But the same codepath is used for syslog messages, where the facility should be used. Split the two codepaths by explicitly specyfing whether the facility should be ignored or not. https://bugzilla.redhat.com/show_bug.cgi?id=988814
2013-08-19libudev-enumerate.c:udev_enumerate_get_list_entry() fixed possible stale pointerHarald Hoyer
If a realloc() happens in syspath_add(), the move_later pointer could point to an invalid memory region. Let move_later store the array index, instead of the pointer to the entry.
2013-08-16build-sys: Add configure check for linux/btrfs.hMichael Marineau
btrfs.h was added to uapi in Linux 3.9. To fix building with older header versions this adds a configure check for the header and re-adds btrfs definitions to missing.h which was removed in bed2e820 along with two other ioctls used by gpt-auto-generator. [ Apparently, btrfs.h was only added recently: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=55e301fd57a6239ec14b91a1cf2e70b3dd135194 let's re-add it for now -- kay ]
2013-08-15typo fixes in man and commentsThomas Hindoe Paaboel Andersen
2013-08-15tests: fix indentationThomas Hindoe Paaboel Andersen
2013-08-15libudev: fix hwdb validation to look for the *new* fileKay Sievers
2013-08-15udevd: simplify sigterm checkKay Sievers
2013-08-15systemd-python: check for oom, give nicer error messagesZbigniew Jędrzejewski-Szmek
2013-08-15systemd-python: fix initialization of _Reader objectsSteven Hiscocks
https://bugzilla.redhat.com/show_bug.cgi?id=995575
2013-08-15sysctl: allow overwriting of values specified in "later" filesKay Sievers
2013-08-15hashmap: remove empty linesKay Sievers
2013-08-14systemd-cryptsetup: makes “discard” a synonym for “allow-discards”Ondrej Balaz
systemd-cryptsetup recognizes option 'allow-discards' in /etc/crypttab to enable TRIM passthrough to underlying encrypted device. In Debian this option was changed to 'discard' to avoid hyphen in option name. (see: #648868 and `man crypttab`). [zj: update crypttab(5) too, making "discard" the default.]