Commit Graph

10525 Commits

Author SHA1 Message Date
Gabriel de Perthuis
c93ec252df blkid: Warn when rejecting a superblock with a bad csum
Bump libblkid requirement from 2.20 to 2.24.
util-linux 2.25 is actually required since fdbbad981cc5da8bb4ed7e9b6646e7a114745ec5

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17 14:37:25 -05:00
Lennart Poettering
411ec4713b udev-builtin-btrfs: properly initialize ioctl struct to zeroes
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17 14:32:39 -05:00
Thomas Hindoe Paaboel Andersen
fdb139feed use correct format types
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17 14:28:47 -05:00
Marc Schmitzer
c01838a8db hwdb: add Lenovo 3000 N200 special key
https://bugs.freedesktop.org/show_bug.cgi?id=87377

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17 14:23:47 -05:00
Peter Hutterer
cef254435c hwdb: Logitech MX1000, another Lenovo USB mouse
Provided by Benjamin Bellec

https://bugs.freedesktop.org/show_bug.cgi?id=87343

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17 14:22:46 -05:00
Peter Hutterer
4255a0267f hwdb: more an entry for the MS Sculpt Ergonomic
Note that the MS receivers likely work like the Logitech ones, i.e. all
devices connected show up with the same vid/pid/name. Full evidence remains to
be gathered.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17 14:22:04 -05:00
Daniel Mack
6701bca683 hwdb: fix ordering
We sort by default DPI, not the first one in the list.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17 14:21:26 -05:00
Daniel Mack
1e40ba9756 hwdb: Logitech G400s
Provided by Peter Hutterer:

  https://bugs.freedesktop.org/show_bug.cgi?id=87332

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17 14:20:46 -05:00
Harald Hoyer
0c0e1571b8 hwdb: Logitech MX 518
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17 14:19:39 -05:00
Zbigniew Jędrzejewski-Szmek
b0c9fe1f49 hwdb: add more mice
https://bugs.freedesktop.org/show_bug.cgi?id=87271

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17 14:18:56 -05:00
Zbigniew Jędrzejewski-Szmek
b3943faca5 hwdb: sort mice by brand,type,dpi,frequency
This way entries from the same brand with the same dpi and frequency
can be coalesced. It is also visually easier to find the right DPI
than order hexadecimal identifiers.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17 14:17:58 -05:00
Marcel Holtmann
260e4b3a87 hwdb: Update database of Bluetooth company identifiers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-17 14:14:49 -05:00
Lennart Poettering
11d61581aa core: unify how we iterate over inotify events
Let's add some syntactic sugar for iterating through inotify events, and
use it everywhere.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-11 13:45:16 -05:00
Torstein Husebø
96ed47b845 treewide: correct spacing near eol in code comments
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-11 13:33:10 -05:00
Torstein Husebø
9dca886fc2 hwdb: fix typo
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-11 11:18:25 -05:00
Lennart Poettering
94991570b1 hwdb: add two more mice to the DPI database
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-11 11:17:24 -05:00
Lennart Poettering
3f67592ea1 hwdb: add another Logitech mouse (M-BZ96C)
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-11 11:16:38 -05:00
Lennart Poettering
c1a53aba66 hwdb: add DPI data for M325 mouse
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-11 11:16:04 -05:00
Lennart Poettering
aa7b989905 hwdb: update PCI, USB, OUI databases
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-11 11:15:20 -05:00
Peter Hutterer
16e3cb106e hwdb: add more mouse DPI entries
Plus a note for Logitech devices using the unified receiver: these devices
include their wireless PID in the name, the usb PID/VID is the same for all.
In kernel 3.19 the actual model number will be the name, but the patches are
still a bit in flux at this point. In the future each device will need two
entries for pre+3.19 and 3.19.

https://bugs.freedesktop.org/show_bug.cgi?id=87037
https://bugs.freedesktop.org/show_bug.cgi?id=87072
https://bugs.freedesktop.org/show_bug.cgi?id=87162

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-11 11:14:53 -05:00
Lennart Poettering
f31810b038 smack-util: remove warning when building without SMACK support
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-04 17:38:11 -05:00
Michal Sekletar
a2e46b539b selinux: figure out selinux context applied on exec() before closing all fds
We need original socket_fd around otherwise mac_selinux_get_child_mls_label
fails with -EINVAL return code. Also don't call setexeccon twice but rather pass
context value of SELinuxContext option as an extra argument.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-04 17:37:10 -05:00
Thomas Hindoe Paaboel Andersen
a0d05ead08 util: don't shadow variable
environ is already defined in unistd.h

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-04 17:31:07 -05:00
Maurizio Lombardi
5bdf5509a0 udevd: SAS: use SAS addr + PHY id in by-path whenever possible.
This patch changes the naming scheme for sas disks. The original names used
disk's sas address and lun, the new scheme uses sas address of the
nearest expander (if available) and a phy id of the used connection.
If no expander is used, the phy id of hba phy is used.
Note that names that refer to RAID or other abstract devices are
unchanged.

Name in raid configuration:
hba_pci_address-sas-raid_sas_address-lunY-partZ

Name in expander bare disk configuration:
hba_pci_address-sas-expander_sas_address-phyX-lunY-partZ

Name format without expanders:
hba_pci_address-sas-phyX-lunY-partZ

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-04 17:02:20 -05:00
Lennart Poettering
1914270962 libudev: set errno properly in all error conditions of udev_device_new_from_syspath()
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-04 16:44:56 -05:00
Marcel Holtmann
f8dfb6283d hwdb: Update database of Bluetooth company identifiers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-04 16:39:18 -05:00
Lennart Poettering
7057e3da01 udev: strings in C are NUL-terminated anyway, no need to add a second NUL...
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01 19:47:08 -05:00
Tom Gundersen
27c0fc5c98 udev: rules - ignore the lack of trailing newline
Also accept '\r' as newline character.

This dropps warnings of the type:

  invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules
  on line 26, starting at character 25 ('')

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01 19:46:05 -05:00
Tom Gundersen
b3a572ddf5 udev: rules - print the first invalid character
The current code would print the character following the first invalid
character.

Given an udev rules-file without a trailing newline we would otherwise print
garbage:

  invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules
  on line 26, starting at character 25 ('m')

This is now changed to print

  invalid key/value pair in file /usr/lib/udev/rules.d/40-usb-media-players.rules
  on line 26, starting at character 25 ('')

(still not very good as printing \0 just gives the empty string)

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01 19:43:58 -05:00
Tom Gundersen
5cb9807847 udev: rules - modernise add_rule a bit
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01 19:42:39 -05:00
Peter Hutterer
ed19623f62 udevadm hwdb: discard extra leading whitespaces in hwdb
Currently a property in the form of
  FOO=bar
is stored as " FOO=bar", i.e. the property name contains a leading space.
That's quite hard to spot.

This patch discards all extra whitespaces but the first one which is required
by libudev's hwdb_add_property.

[zj: modify the check a bit]

https://bugs.freedesktop.org/show_bug.cgi?id=82311

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01 19:40:18 -05:00
Ross Lagerwall
c0d8d523a6 cgroup-util: Don't send SIGCONT after SIGKILL
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01 19:37:06 -05:00
Lennart Poettering
4e7269063d treewide: introduce UID_INVALID (and friends) as macro for (uid_t) -1
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01 19:31:53 -05:00
Michal Schmidt
f460aa149c treewide: another round of simplifications
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno
+ return simplifications".

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01 13:13:40 -05:00
Michal Schmidt
761b969283 treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful
value, so we might as well use log_*_errno to have ERRNO= logged.

Using:
find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/'

Plus some whitespace, linewrap, and indent adjustments.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-12-01 07:39:05 -05:00
Michal Schmidt
ed7c6787bd treewide: drop unnecessary trailing \n in log_*() calls
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-30 14:45:49 -05:00
Jakub Filak
af2ae57346 util: add function getting proc environ
On the contrary of env, the added function returns all characters
cescaped, because it improves reproducibility.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28 12:42:51 -05:00
Lennart Poettering
e6511db5d5 util: skip incomplete ucred information in getpeersec()
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28 12:38:00 -05:00
Michal Schmidt
805a4489ec treewide: more log_*_errno() conversions
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28 11:42:30 -05:00
Michal Schmidt
b06aadd220 treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28 11:30:06 -05:00
Michal Schmidt
146b012e50 treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all
low-level logging calls and intrdouce log_error_errno() as log calls
that take error numbers", use sed to convert the simple cases to use
the new macros:

find . -name '*.[ch]' | xargs sed -r -i -e \
's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/'

Multi-line log_*() invocations are not covered.
And we also should add log_unit_*_errno().

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28 11:16:51 -05:00
Lennart Poettering
e72e57a66f log: rearrange log function naming
- Rename log_meta() → log_internal(), to follow naming scheme of most
  other log functions that are usually invoked through macros, but never
  directly.

- Rename log_info_object() to log_object_info(), simply because the
  object should be before any other parameters, to follow OO-style
  programming style.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28 10:26:48 -05:00
Lennart Poettering
107530eaa3 log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers
This change has two benefits:

- The format string %m will now resolve to the specified error (or to
  errno if the specified error is 0. This allows getting rid of a ton of
  strerror() invocations, a function that is not thread-safe.

- The specified error can be passed to the journal in the ERRNO= field.

Now of course, we just need somebody to convert all cases of this:

        log_error("Something happened: %s", strerror(-r));

into thus:

        log_error_errno(-r, "Something happened: %m");

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28 10:13:40 -05:00
Zbigniew Jędrzejewski-Szmek
62d9908a84 udevadm trigger: allow matching by device name
This makes udevadm trigger mirror udevadm info, except that multiple
device names can be specified. Instructions in 60-keyboard.hwdb should
now actually work.

udevadm(8) is updated, but it could use a bit more polishing.

https://bugs.freedesktop.org/show_bug.cgi?id=82311

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28 08:54:14 -05:00
Zbigniew Jędrzejewski-Szmek
c0f2fad6a5 udevadm: split out find_device helper
The idea is to unify the way that devices can be specified.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28 08:44:21 -05:00
Peter Hutterer
3481b5b976 hwdb: add a new db for the DPI/frequency settings of mice
Pointer acceleration for relative input devices (mice, trackballs, etc.)
applies to the deltas of the device. Alas, those deltas have no physical
reference point - a delta of 10 may be caused by a large movement of a
low-dpi mouse or by a minute movement of a high-dpi mouse.
Which makes pointer acceleration a bit useless and high-dpi devices
essentially unusable.

In an ideal world, we could read the DPI from the device directly and work
with that. In the world we actually live in, we need to compile this list
manually. This patch introduces the database, with the usual match formats
and a single property to be set on a device: MOUSE_DPI

That is either a single value for most mice, or a list of values for mice
that can change resolution at runtime. The exact format is detailed in the
hwdb file.

Note that we're explicitly overshooting the requirements we have for
libinput atm. Frequency could be detected in software and we don't
actually use the list of multiple resolutions (because we can't detect
when they change anyway). However, we might as well collect those values
from the get-go, adding/modifying what will eventually amount to hundreds
of entries is a bit cumbersome.

Note: we rely on the input_id builtin to tag us as mouse first, ordering
of the rules is important.

(David: fixed up typos and moved hwdb file into ./hwdb/)

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-28 08:12:30 -05:00
Peter Hutterer
c317efd55c hwdb: fix a typo
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-27 16:50:49 -05:00
WaLyong Cho
70a41ab585 smack: introduce new SmackProcessLabel option
In service file, if the file has some of special SMACK label in
ExecStart= and systemd has no permission for the special SMACK label
then permission error will occurred. To resolve this, systemd should
be able to set its SMACK label to something accessible of ExecStart=.
So introduce new SmackProcessLabel. If label is specified with
SmackProcessLabel= then the child systemd will set its label to
that. To successfully execute the ExecStart=, accessible label should
be specified with SmackProcessLabel=.
Additionally, by SMACK policy, if the file in ExecStart= has no
SMACK64EXEC then the executed process will have given label by
SmackProcessLabel=. But if the file has SMACK64EXEC then the
SMACK64EXEC label will be overridden.

[zj: reword man page]

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-27 12:34:36 -05:00
Lennart Poettering
2694f4de06 man: add emacs header to get correct indention in nxml-mode for the manpage XML files that use 2ch indenting
In the long run we really should figure out if we want to stick with 8ch
or 2ch indenting, and not continue with half-and-half. For now, just
make emacs aware of the files that use 2ch indenting.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-27 08:29:53 -05:00
Lennart Poettering
0ddc209efd set: make set_consume() actually free the allocated string if the string already is in the set
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2014-11-20 06:43:53 -05:00