summaryrefslogtreecommitdiff
path: root/src/shared
AgeCommit message (Collapse)Author
2014-03-16Use strlen even for constant stringsJosh Triplett
GCC optimizes strlen("string constant") to a constant, even with -O0. Thus, replace patterns like sizeof("string constant")-1 with strlen("string constant") where possible, for clarity. In particular, for expressions intended to add up the lengths of components going into a string, this often makes it clearer that the expression counts the trailing '\0' exactly once, by putting the +1 for the '\0' at the end of the expression, rather than hidden in a sizeof in the middle of the expression.
2014-03-14timedated: use builtins for integer log and expZbigniew Jędrzejewski-Szmek
2014-03-14utmp-wtmp: allow overriding username on wallSebastian Thorarensen
utmp_wall() now takes an optional argument 'username_override' which allows the caller to override the username shown on wall messages. journald will use this to inform users that its wall messages comes from 'systemd-journald'.
2014-03-14util: add hexdump() call to create pretty hexdumps of dataLennart Poettering
This is very useful when debugging sd-bus to look at messages.
2014-03-14gpt: introduce root partition type GUIDs for ARM 32bit + ARM 64bitLennart Poettering
2014-03-14shared: add root argument to search_and_fopenMichael Marineau
This adds the same root argument to search_and_fopen that conf_files_list already has. Tools that use those two functions as a pair can now be easily modified to load configuration files from an alternate root filesystem tree.
2014-03-14logind: automatically remove SysV + POSIX IPC objects when the users owning ↵Lennart Poettering
them fully log out
2014-03-13systemctl: suppress duplicate newline if there's not log output in ↵Lennart Poettering
"systemctl status"
2014-03-13gpt-auto-generator: honour read-only and no-auto flag from GPT dataLennart Poettering
Similar to the read-only and no-automount flags of Microsoft Basic Data Partitions, introduce our own flags. We map them to the same flag bits as Microsoft's, to keep things simple.
2014-03-12macro: make sure we can use IN_SET() also with complex function calls as ↵Lennart Poettering
first argument
2014-03-12util: Make in_charset a static inline in util.hJosh Triplett
With in_charset now reduced to a one-liner (plus asserts), make it a static inline.
2014-03-12util: Rewrite in_charset to use strspnJosh Triplett
This simplifies in_charset down to a one-liner, and allows for possible optimizations of strspn in libc.
2014-03-11systemctl: for switch-root check, if we switch to a systemd initHarald Hoyer
If "systemctl switch-root" is called with a specific "INIT" or /proc/cmdline contains "init=", then systemd would not serialize itsself. Let systemctl check, if the new init is in the standard systemd installation path and if so, clear the INIT parameter, to let systemd serialize itsself.
2014-03-11util: add files_same() helper functionHarald Hoyer
files_same() returns 1, if the files are the same 0, if the files have different inode/dev numbers errno, for any stat error
2014-03-11nspawn: when resoliving UIDs/GIDs for "-u", do so in forked off ↵Lennart Poettering
/usr/bin/getent instead of in-process When the container runs a different native architecture than the host we shouldn't attempt to load the container's NSS modules with the host's libc. Instead, resolve UID/GID by invoking /usr/bin/getent in the container. The tool should be fairly universally available and allows us to do resolving of the UID/GID with the container's libc in a parsable format. https://bugs.freedesktop.org/show_bug.cgi?id=75733
2014-03-10nspawn: add --image= switch to boot GPT disk images that follow the ↵Lennart Poettering
Discoverable Partitions Specification
2014-03-07Make tables for DEFINE_STRING_TABLE_LOOKUP consistentDaniel Mack
Bring some arrays that are used for DEFINE_STRING_TABLE_LOOKUP() in the same order than the enums they reference. Also, pass the corresponding _MAX value to the array initalizer where appropriate.
2014-03-07gpt-auto-generator: automatically find the root disk of the systemLennart Poettering
When run in an initrd and no root= argument is set (or is set to root=gpt-auto) we will automatically look for the root partition on the same disk the EFI ESP is located on. Since we look for swap, /home and /srv on the disk the root partition is located on, we hence have a fully discoverable chain: Firmware discovers the EFI ESP partition → the initrd discovers the root partition → the host OS discovers swap, /home, and /srv. Note that this requires an EFI boot loader that sets the LoaderDevicePartUUID EFI variable, such as Gummiboot.
2014-03-07udev-builtin-blkid: when we find a GPT partition marked as root disk on the ↵Lennart Poettering
same disk as the ESP, expose a property on the udev device This is preparation for a logic to automatically discover the root partition to boot from if no partition has been configured explicitly. This makes use of our newly defined GPT type GUIDs for our root disks: #define GPT_ROOT_X86 SD_ID128_MAKE(44,47,95,40,f2,97,41,b2,9a,f7,d1,31,d5,f0,45,8a) #define GPT_ROOT_X86_64 SD_ID128_MAKE(4f,68,bc,e3,e8,cd,4d,b1,96,e7,fb,ca,f9,84,b7,09) We define differen GUIDs for different architectures to allow images which finde the right root partition for the appropriate arch.
2014-03-07fstab-generator: merge /proc/cmdline parsing loops into oneLennart Poettering
2014-03-06strv: set _printf_ on strv_extendfThomas Hindoe Paaboel Andersen
2014-03-06util: move more intellegince into parse_proc_cmdline()Lennart Poettering
Already split variable assignments before invoking the callback. And drop "rd." settings if we are not in an initrd.
2014-03-06unit-name: modernizationsLennart Poettering
2014-03-06util: add timeout to generator executionLennart Poettering
2014-03-06generators: rework mount generatorsLennart Poettering
- Add support for finding and mounting /srv based on GPT data, similar to how we already handly /home. - Share the fsck logic between GPT, EFI and fstab generators - Make sure we never run the EFI generator inside containers - Drop DefaultDependencies=no from EFI mount units - Other fixes
2014-03-05systemd-run: make sure --nice=, --uid=, --gid=, --setenv= also work in ↵Lennart Poettering
--scope mode
2014-03-05strv: add new STR_IN_SET() macro that operates similar to IN_SET() but for ↵Lennart Poettering
strings
2014-03-05missing: if RLIMIT_RTTIME is not defined by the libc, then we need a new ↵Lennart Poettering
define for the max number of rlimits, too
2014-03-04architecture: Add crisUmut Tezduyar Lindskog
2014-03-04logind: make $XDG_RUNTIME_DIR a per-user tmpfsLennart Poettering
This way each user allocates from his own pool, with its own size limit. This puts the size limit by default to 10% of the physical RAM size but makes it configurable in logind.conf.
2014-03-04Do not print invalid UTF-8 in error messagesZbigniew Jędrzejewski-Szmek
Inexplicably, 550a40ec ('core: do not print invalid utf-8 in error messages') only fixed two paths. Convert all of them now.
2014-03-04Introduce strv_consume which takes ownershipZbigniew Jędrzejewski-Szmek
This mirrors set_consume and makes the common use a bit nicer.
2014-03-03conf-parser: minor optimization in config_parse_string()Lennart Poettering
2014-03-03conf-parser: drop special casing in config_parse_path()Lennart Poettering
The code checked for two lvalues that aren't even using config_parse_path(), so let's drop these checks and make the function completely generic again.
2014-03-03conf-parser: config_parse_path_strv() is not generic, so let's move it into ↵Lennart Poettering
load-fragment.c The parse code actually checked for specific lvalue names, which is really wrong for supposedly generic parsers...
2014-03-03core: move config_parse_set_status() into load-fragment.cLennart Poettering
Let's keep specific config parsers close to where they are needed. Only the really generic ones should be defined in conf-parser.[ch].
2014-03-03core: move ShowStatus type into the coreLennart Poettering
Let's make the scope of the show-status stuff a bit smaller, and make it private to the core, rather than shared API in shared/.
2014-03-03conf-parse: rename config_parse_level() to config_parse_log_level()Lennart Poettering
"level" is a bit too generic, let's clarify what kind of level we are referring to here.
2014-03-03core: introduce new RuntimeDirectory= and RuntimeDirectoryMode= unit settingsLennart Poettering
As discussed on the ML these are useful to manage runtime directories below /run for services.
2014-03-02Disallow sizes with increasing unit sizeZbigniew Jędrzejewski-Szmek
Things like 3B4T, 4B50B, 400 100 (meaning 4*1024**4+3, 54, and 500, respectively) are now disallowed. It is necessary to say 4T3B, 54B, 500 instead. I think this was confusing and error prone. As a special form, 400B 100 is allowed, i.e. "B" suffix is treated as different from "", although they mean the same thing.
2014-03-02Allow fractional parts in disk sizesZbigniew Jędrzejewski-Szmek
It seems natural to be able to say SystemMaxUsage=1.5G. https://bugzilla.redhat.com/show_bug.cgi?id=1047568
2014-02-28architecture: Add tilegxHenrik Grindal Bakken
Add Tilera's TILE-GX processor family support.
2014-02-27logs-show: fix corrupt output with empty messagesUoti Urpala
If a message had zero length, journalctl would print no newline, and two output lines would be concatenated. Fix. The problem was introduced in commit 31f7bf199452 ("logs-show: print multiline messages"). Affected short and verbose output modes. Before fix: Feb 09 21:16:17 glyph dhclient[1323]: Feb 09 21:16:17 glyph NetworkManager[788]: <info> (enp4s2): DHCPv4 state changed nbi -> preinit after: Feb 09 21:16:17 glyph dhclient[1323]: Feb 09 21:16:17 glyph NetworkManager[788]: <info> (enp4s2): DHCPv4 state changed nbi -> preinit
2014-02-25Use /var/run/dbus/system_bus_socket for the D-Bus socketZbigniew Jędrzejewski-Szmek
2014-02-26core: add new RestrictAddressFamilies= switchLennart Poettering
This new unit settings allows restricting which address families are available to processes. This is an effective way to minimize the attack surface of services, by turning off entire network stacks for them. This is based on seccomp, and does not work on x86-32, since seccomp cannot filter socketcall() syscalls on that platform.
2014-02-25login: fix pos-array allocationDavid Herrmann
GREEDY_REALLOC takes a pointer to the real size, not the array-width as argument. Therefore, our array is currently way to small to keep the seat positions. Introduce GREEDY_REALLOC0_T() as typed version of GREEDY_REALLOC and store the array-width instead of array-size.
2014-02-24Remove dead lines in various placesZbigniew Jędrzejewski-Szmek
As pointed-out by clang -Wunreachable-code. No behaviour changes.
2014-02-24architecture: apparently there is LE ppc nowLennart Poettering
2014-02-24smack: rework security labeling for multiple frameworksŁukasz Stelmach
2014-02-24smack: relabel directories and files created by systemdŁukasz Stelmach
Systemd creates directories in /dev. These directories will get the label of systemd, which is the label of the System domain, which is not accessable to everyone. Relabel the directories, files and symlinks created so that they can be generally used. Based on a patch by Casey Schaufler <casey@schaufler-ca.com>.