summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* tests: override XDG_RUNTIME_DIR where we use the user runtime dirLennart Poettering2017-06-16
| | | | | | | We don#t really support systems where XDG_RUNTIME_DIR is not supported for elogind --user. Hence, let's always set our own XDG_RUNTIME_DIR for tests that involve elogind --user, so that we know it is set, and that it doesn't polute the user's actual runtime dir.
* tree-wide: add new SIGNAL_VALID() macro-like function that validates signal ↵Lennart Poettering2017-06-16
| | | | | | numbers And port all code over to use it.
* core: be more paranoid when mixing umask and fopen()Lennart Poettering2017-06-16
| | | | | Let's be extra careful with the umask when we use simple fopen(), as this creates files with 0777 by default.
* core: rework how transient unit files and property drop-ins workLennart Poettering2017-06-16
| | | | | | | | | | | | | | | With this change the logic for placing transient unit files and drop-ins generated via "systemctl set-property" is reworked. The latter are now placed in the newly introduced "control" unit file directory. The fomer are now placed in the "transient" unit file directory. Note that the properties originally set when a transient unit was created will be written to and stay in the transient unit file directory, while later changes are done via drop-ins. This is preparation for a later "systemctl revert" addition, where existing drop-ins are flushed out, but the original transient definition is restored.
* polkit: don't start polkit agent when running as rootMartin Pitt2017-06-16
| | | | | | | | | On the server side we already bypass the polkit checks if the caller is root (see the sd_bus_query_sender_privilege() call in bus_verify_polkit_async()). So there is no reason to invoke polkit when running systemctl/machinectl/loginctl/timedatectl as root. Fixes #2748
* basic: fallback to fstatat if entry->d_type is DT_UNKNOWNEvgeny Vereshchagin2017-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | * tests-functions: improve FSTYPE-support make clean setup FSTYPE=reiserfs is working fine now :) * basic: fallback to fstatat if entry->d_type is DT_UNKNOWN Fixes localectl on reiserfs: -bash-4.3# mkdir -p /usr/lib/locale -bash-4.3# stat -f /usr/lib/locale/ File: "/usr/lib/locale/" ID: bdb0322715b5366e Namelen: 255 Type: reiserfs Block size: 4096 Blocks: Total: 99835 Free: 60262 Available: 60262 Inodes: Total: 0 Free: 0 -bash-4.3# mkdir /usr/lib/locale/HeyHo -bash-4.3# localectl list-locales --no-pager -bash-4.3# mount -t tmpfs tmpfs /usr/lib/locale -bash-4.3# mkdir /usr/lib/locale/HeyHo -bash-4.3# localectl list-locales --no-pager HeyHo
* test-compress-benchmark: fix argument parsing on 32bitZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | The patch is not minimal, but a function to parse size_t is probably going to come in handy in other places, so I think it's nicer to define a proper parsing function than to open-code the cast.
* bus-util: Fix reading uint32 propertiesMartin Pitt2017-06-16
| | | | | | | | Fix copy&paste bug in map_basic() to use the correct data type for SD_BUS_TYPE_UINT32. Before we were copying the wrong 32 bits into the destination pointer, resulting in complete garbage on big-endian systems. Fixes #2927
* shared: fix a misspelling of "journalctl"Biao Lu2017-06-16
|
* core: update populated event handling in unified hierarchyTejun Heo2017-06-16
| | | | | | | Earlier during the development of unified hierarchy, the populated event was reported through by the dedicated "cgroup.populated" file; however, the interface was updated so that it's reported through the "populated" field of "cgroup.events" file. Update populated event handling logic accordingly.
* Ignore BOM in config filesZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | Fixes #2823. Also remove unnecessary feof check.
* basic/missing: move syscall definitions to basic/missing_syscall.hZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | | | | | | | | | | | We have a bunch of syscall wrapper definitions and it's easier to see that they follow the same pattern if they are not interspersed with other defines. Change the wrappers to be uniform: - if __NR_XXX is not defined, do not bother to call the syscall, and return -1/ENOSYS immediately. - do not check __NR_XXX defines if we detect the symbol as defined, since we don't need them anyway - reindent stuff for readability New file basic/missing_syscall.h is included at the end of missing.h because it might make use of some of the definitions in missing.h.
* loginctl: add --value optionZbigniew Jędrzejewski-Szmek2017-06-16
|
* rules: allow users to access frame buffer devicesZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | | | | For example it allows weston to be started unprivileged. Related discussion: https://bugs.freedesktop.org/show_bug.cgi?id=73782 https://lists.freedesktop.org/archives/wayland-devel/2015-May/022005.html https://bugzilla.redhat.com/show_bug.cgi?id=1226680
* basic/log: remove unused return valueZbigniew Jędrzejewski-Szmek2017-06-16
|
* basic/macros: clang 3.5 doesn't support alloc_sizeZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | The attribute was removed in commit c047507 in the clang repository as it was never properly implemented anyway. Avoid using the attribute with clang because it generates a ton of annoying warnings.
* basic/missing: add copy_file_rangeZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | syscall numbers based on: https://fedora.juszkiewicz.com.pl/syscalls.html
* Added support for 3D printers to uaccess (ID_MAKER_TOOL)Jaroslav Škarvada2017-06-16
| | | | This is to support 3D printers, CNCs, laser cutters, 3D scanners, etc.
* include sys/sysmacros.h in more placesMike Frysinger2017-06-16
| | | | | | Since glibc is moving away from implicitly including sys/sysmacros.h all the time via sys/types.h, include the header directly in more places. This seems to cover most makedev/major/minor usage.
* headers: use __inline__ instead of inlineZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | | | https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gcc/Alternate-Keywords.html#Alternate-Keywords recommends __inline__ over inline in ANSI C compatible headers. Tested with gcc-5.3 and clang-3.7. https://bugzilla.redhat.com/show_bug.cgi?id=1316964
* string-table: split long definitionsZbigniew Jędrzejewski-Szmek2017-06-16
|
* tree-wide: use SET_FLAG() macro to make code more clearAlexander Kuleshov2017-06-16
|
* selinux: always try to load the full selinux dbZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | https://github.com/elogind/elogind/pull/2508#issuecomment-190901170 Maybe fixes https://bugzilla.redhat.com/show_bug.cgi?id=1308771.
* tree-wide: no need to pass excess flags to open()/openat() if O_PATH is passedAlexander Kuleshov2017-06-16
| | | | | | | | | | As described in the documentation: When O_PATH is specified in flags, flag bits other than O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW are ignored. So, we can remove unnecessary flags in a case when O_PATH is passed to the open() or openat().
* Redefine 32bit time_t format to signedZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | | | | | | It seems that it is signed both on i386 and arm. Avoids a stupid gcc warning on arm: src/udev/udevadm-monitor.c: In function ‘print_device’: src/udev/udevadm-monitor.c:44:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘__time_t {aka long int}’ [-Wformat=] printf("%-6s[%"PRI_TIME".%06ld] %-8s %s (%s)\n", ^
* core: avoid compiler warning when compiling with -fexceptionsThomas Haller2017-06-16
| | | | | | | Initialize auto variables with cleanup attribute, otherwise we get a compiler warning with -fexceptions. ./configure CFLAGS='-Wmaybe-uninitialized -fexceptions -O2'
* core: when enabling a generated unit file, return a clean errorLennart Poettering2017-06-16
| | | | | Let's be precise when the user tries to invoke an "enable" operation on a generated unit file.
* basic: mark unused variable as suchThomas Hindoe Paaboel Andersen2017-06-16
|
* tree-wide: minor formatting inconsistency cleanupsVito Caputo2017-06-16
|
* tree-wide: make ++/-- usage consistent WRT spacingVito Caputo2017-06-16
| | | | | | Throughout the tree there's spurious use of spaces separating ++ and -- operators from their respective operands. Make ++ and -- operator consistent with the majority of existing uses; discard the spaces.
* resolved: fix notification iteration logic when transactions are completedLennart Poettering2017-06-16
| | | | | | | | | | | | | | | | | | When a transaction is complete, and we notify its owners, make sure we deal correctly with the requesters removing themselves from the list of owners while we continue iterating. This was previously already dealt with with transactions that require other transactions for DNSSEC purposes, fix this for other possibly transaction owners too now. Since iterating through "Set" objects is not safe regarding removal of entries from it, rework the logic to use two Sets, and move each entry we notified from one set to the other set before we dispatch the notification. This move operation requires no additional memory, and enables us to ensure that we don't notify any object twice. Fixes: #2676
* hashmap: use void* and uint8_t* for generic pointersLennart Poettering2017-06-16
| | | | | | As suggested by CODING_STYLE we should use "void*" as type for generic memory, and uint8_t* for generic bytes. Hence use that instead of "char*", which should really be used only for strings these days.
* util-lib: simplify personality() string matchingLennart Poettering2017-06-16
|
* util-lib: support various ppc archs in personality logicLennart Poettering2017-06-16
|
* util-lib: use the architecture ids from architecture.h for personalitiesLennart Poettering2017-06-16
| | | | We have this ids, hence let's use them universally.
* missing.h: Explicitly check for IFLA_BRPORT_PROXYARPDaniel Mack2017-06-16
| | | | | | | | | | | | | | | RHEL explicitly disables IFLA_BRPORT_PROXYARP by renaming the enum value. In order to support unpatched builds, we have two options: a) redefine the enum value through missing.h and ignore the fact that it is really unsupported, or b) omit that enum value on rtnl_prot_info_bridge_port_types[] As we are not actually using this netlink type anywhere, and because it is only hooked up for the sake of completeness, this patch opts for the former.
* networkd: add basic LLDP transmission supportLennart Poettering2017-06-16
| | | | | | Let's add some minimalistic LLDP sender support. The idea is that this is either on or off, and all fields determined automatically rather than configured explicitly.
* tree-wide: merge pager_open_if_enabled() to the pager_open()Alexander Kuleshov2017-06-16
| | | | | | | | | Many subsystems define own pager_open_if_enabled() function which checks '--no-pager' command line argument and open pager depends on its value. All implementations of pager_open_if_enabled() are the same. Let's merger this function with pager_open() from the shared/pager.c and remove pager_open_if_enabled() from all subsytems to prevent code duplication.
* tree-wide: place #pragma once at the same place everywhereLennart Poettering2017-06-16
| | | | | | Usually, we place the #pragma once before the copyright blurb in header files, but in a few cases we didn't. Move those around, so that we do the same thing everywhere.
* sd-lldp: move ETHERTYPE_LLDP to missing.hLennart Poettering2017-06-16
| | | | | After all, most ETHERTYPE variables are defined in the system headers, hence define these where we defined all other fill-ins for system headers.
* alloc-util: cleanupsAlexander Kuleshov2017-06-16
| | | | | | | | | | | | | | | This patch contains a set of little cleanups for alloc-util.h: 1. The malloc_multiply(), realloc_multiply() and memdup_multiply() functions check allocation related parameters on overflow. Let's move them to the separate size_multiply_overflow() function for simplicity, code duplication prevention and possible reuse in future. 2. use SIZE_MAX from stdlib instead of ((size_t) - 1) to be more clear. 3. The 'a'/'b' variables are renamed to 'size' and 'need' to be more clear.'
* systemctl: fix style to avoid modification of array passed by callerZbigniew Jędrzejewski-Szmek2017-06-16
| | | | Followup for 4524439edb7d.
* time-util: Rename and fix call of deserialize_timestamp_value()Benjamin Robin2017-06-16
| | | | | | The deserialize_timestamp_value() is renamed timestamp_deserialize() to be more consistent with dual_timestamp_deserialize() And add the NULL check back on realtime and monotonic
* build-sys: fix type detectionLennart Poettering2017-06-16
| | | | | | | | | | | | | Before this patch existence of char16_t, char32_t, key_serial_t was checked with AC_CHECK_DECLS() which doesn't actually work for types. Correct this to use AC_CHECK_TYPES() instead. Also, while we are at it, change the check for memfd_create() to use AC_CHECK_DECLS() instead of AC_CHECK_FUNCS(). This is a better choice, since a couple of syscalls are defined by glibc but not exported in the header files (pivot_root() for example), and we hence should probably be more picky with memfd_create() too, which glibc might decide to expose one day, but not necessarily in the headers too.
* logind: use deserialize_timestamp_value()Alexander Kuleshov2017-06-16
| | | | which is introduced in the ebf30a086d commit.
* time-util: introduce deserialize_timestamp_value()Alexander Kuleshov2017-06-16
| | | | | | | | | | | | | The time-util.c provides dual_timestamp_deserialize() function to convert value to usec_t and set it as value of ts->monotonic and ts->realtime. There are some places in code which do the same but only for one clockid_t (realtime or monotonic), when dual_timestamp_deserialize() sets value of both. This patch introduces the deserialize_timestamp_value() which converts a given value to usec_t and write it to a given timestamp.
* systemctl: include -M or -H arguments in the hintZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | | | | | | | | | | | https://github.com/elogind/elogind/issues/2431 Some newlines are added, but the output will still exceed 80 columns in many cases. The fallback for oom conditions is changed from "n/a" to something "<service>", and a similar pattern is used for the new code. This way we have a realistic fallback for oom, which seems nicer than making the whole function return an error code which would then have to be propagated. $ systemctl -M fedora-rawhide restart elogind-networkd.service Job for elogind-networkd.service failed because start of the service was attempted too often. See "systemctl -M fedora-rawhide status elogind-networkd.service" and "journalctl -M fedora-rawhide -xe" for details. To force a start use "systemctl -M fedora-rawhide reset-failed elogind-networkd.service" followed by "systemctl -M fedora-rawhide start elogind-networkd.service" again.
* resolved: drop references to two bus error codes no longer usedLennart Poettering2017-06-16
|
* tree-wide: make more global variables staticLennart Poettering2017-06-16
| | | | let's export as little as we can
* resolve: always align flags to 8th column and print CAA flagsZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | | | | | | | | | | | Left-over unknown flags are printed numerically. Otherwise, it wouldn't be known what bits are remaining without knowning what the known bits are. A test case is added to verify the flag printing code: ============== src/resolve/test-data/fake-caa.pkts ============== google.com. IN CAA 0 issue "symantec.com" google.com. IN CAA 128 issue "symantec.com" -- Flags: critical google.com. IN CAA 129 issue "symantec.com" -- Flags: critical 1 google.com. IN CAA 22 issue "symantec.com" -- Flags: 22