summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-10-25smack: rework SMACK label fixing code to follow more closely the semantics ↵Lennart Poettering
of the matching selinux code Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25smack: never follow symlinks when relabellingLennart Poettering
previously mac_smack_apply(path, NULL) would operate on the symlink itself while mac_smack_apply(path, "foo") would follow the symlink. Let's clean this up an always operate on the symlink, which appears to be the safer option. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25smack: rework smack APIs a bitLennart Poettering
a) always return negative errno error codes b) always become a noop if smack is off c) always take a NULL label as a request to remove it Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25mac: rename all calls that apply a label mac_{selinux|smack}_apply_xyz(), ↵Lennart Poettering
and all that reset it to defaults mac_{selinux|smack}_fix() Let's clean up the naming schemes a bit and use the same one for SMACK and for SELINUX. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25selinux: make use of cleanup gcc magicLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25hashmap: introduce hashmap_reserve()Michal Schmidt
With the current hashmap implementation that uses chaining, placing a reservation can serve two purposes: - To optimize putting of entries if the number of entries to put is known. The reservation allocates buckets, so later resizing can be avoided. - To avoid having very long bucket chains after using hashmap_move(_one). In an alternative hashmap implementation it will serve an additional purpose: - To guarantee a subsequent hashmap_move(_one) will not fail with -ENOMEM (this never happens in the current implementation). Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25hashmap: return more information from resize_buckets()Michal Schmidt
Return 0 if no resize was needed, 1 if successfully resized and negative on error. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25shared: split mempool implementation from hashmapsMichal Schmidt
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25time: don't do comparison twiceLennart Poettering
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25mac: also rename use_{smack,selinux,apparmor}() calls so that they share the ↵Lennart Poettering
new mac_{smack,selinux,apparmor}_xyz() convention Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25src/udev/udevd.c: rename apis in static_dev_create_from_modules() alsoAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25mac: rename apis with mac_{selinux/smack}_ prefixWaLyong Cho
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25src/shared/util.h: import realloc_multiply() from upstreamAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25label: rearrange mandatory access control(MAC) apisWaLyong Cho
move label apis to selinux-util.ch or smack-util.ch appropriately. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25shared/log: add log_trace as compile-time optional debuggingZbigniew Jędrzejewski-Szmek
Repetetive messages can be annoying when running with SYSTEMD_LOG_LEVEL=debug, but they are sometimes very useful when debugging problems. Add log_trace which is like log_debug but becomes a noop unless LOG_TRACE is defined during compilation. This makes it easy to enable very verbose logging for a subset of programs when compiling from source. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25man: make udev.event-timeout more visibleZbigniew Jędrzejewski-Szmek
Evidently some people had trouble finding it in the documentation. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-25hwdb: Add mapping for special keys on compaq ku 0133 keyboardsHans de Goede
The compaq ku 0133 keyboard has 8 special keys at the top: http://lackof.org/taggart/hacking/keyboard/cpqwireless.jpg 3 of these use standard HID usage codes from the consumer page, the 5 others use part of the reserved 0x07 - 0x1f range. This commit adds mapping for this keyboard for these reserved codes, making the other 5 keys work. Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-22strv: add an additional overflow check when enlarging strv()sLennart Poettering
https://bugs.freedesktop.org/show_bug.cgi?id=76745 This also adds: strv: use realloc_multiply() to check for multiplication overflow by Michal Schmidt <mschmidt@redhat.com> This could overflow on 32bit, where size_t is the same as unsigned. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-13src/shared/util.c: remove unneeded error check, following upstreamAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-13src/shared/util.c: final cosmetic changeAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-13src/shared/util.c: more cosmetic changesAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-13src/shared/util.c: cosmetic changes to more easily follow upstreamAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-07keymap: Fix touchpad toggle key on Asus laptopsMartin Pitt
https://launchpad.net/bugs/1377352 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-07keymap: Fix touchpad toggle on Toshiba Satellite P75-A7200Martin Pitt
Just like everywhere else we use KEY_F21 instead of KEY_TOUCHPAD_TOGGLE for X friendliness. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-10-02hwdb: Update database of Bluetooth company identifiersMarcel Holtmann
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-30udev/hwdb: New Entry for Dell XPS12 9Q33 keyboardStefan Brüns
https://bugs.freedesktop.org/show_bug.cgi?id=84437 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-30Do not format USEC_INFINITY as NULLZbigniew Jędrzejewski-Szmek
systemctl would print 'CPUQuotaPerSecUSec=(null)' for no limit. This does not look right. Since USEC_INFINITY is one of the valid values, format_timespan() could return NULL, and we should wrap every use of it in strna() or similar. But most callers didn't do that, and it seems more robust to return a string ("infinity") that makes sense most of the time, even if in some places the result will not be grammatically correct. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-24test: udev - restrict nemuric uid's to existing onesTom Gundersen
We now verify the existence of uid's before applying them to devicenodes, so change the test accordingly. We assume that both uid/gid 1 and 2 exist on the test system. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18src: minor code cleanupAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18udevd: don't fail if /run/udev existsTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18udev: fix typosTom Gundersen
Spotted by Andreas Henriksson. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18udev: ctrl - log if setting SO_PASSCRED failsTom Gundersen
No functional change. Found by Coverity. Fixes CID #1237533. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18src/udev/udev-node.c: replace our error handling with upstreamsAnthony G. Basile
eudev has had this error handling for a while. upstream finally added it with the following commit 543afdc63c02a5af3cf6bd2a264162f23474346a by Tom Gundersen <teg@jklm.no>. Both methods are equivalent, but we adopt upstreams for easier maintenance. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18udevadm: hwdb - check return value of fseeko()Tom Gundersen
Fonud by Coverity. Fixes CID #996255. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18udevd: check return of various functionsTom Gundersen
One reported by Coverity. Fixes CID #996252. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18udevd: parse_argv - warn if argumens are invalidTom Gundersen
Found by Coverity. Fixes CID #1238780. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18udev: fix path for database names on 'change' eventRobert Milasan
If a device does not have a major/minor number attached, we use different database names than if it does. On "change" events, we didn't copy the devnum over, therefore, we used different paths than on 'add' or 'remove' events (where devnum was properly copied). Fix this by always copying the devnum into the udev-device. (David: added commit-log from email) Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18libudev: monitor - warn if we fail to request SO_PASSCREDTom Gundersen
The function still succeeds, so there is no functional change. This fixes CID #996288. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-18src/shared: import upstream code needed for recent commitsAnthony G. Basile
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-17udev: util - use log_level_from_string()Tom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-17udev: event - modernize spawn_exec()Tom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-17udev: event - explicitly don't read() from invalid fdTom Gundersen
This fixes CID #1237641. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-17udev: event - modernize spawn_read()Tom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-17udev: rules - close empty fileTom Gundersen
If the file is found to be empty, we exit early without closing the file first. Found by coverity. Fixes CID #1237759. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-17udev: rules - add missing whitespace to log messageTom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-17udevd: use safe_ato*() in place of strto*()Tom Gundersen
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-17libudev: util - drop util_delete_path()Tom Gundersen
Use rmdir_parents() from src/shared instead. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-17libudev: drop util_lookup_{user,group}Tom Gundersen
Use shared versions instead. Difference is with overwriting of repeated user/group name, and lack of logging. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-17udev: apply permissions to static nodes before signallying READYTom Gundersen
Processes expecting static nodes to have the right permissions may order themselves after systemd-udevd.service, make sure that actually guarantees what is expected. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-09-17udev: only print after final log level has been determinedTom Gundersen
This delays label_init(), and drops the (duplicate) printing of version information. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>