b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
ee48dbd55f544d9ee4a17497b5757be7e854c869 |
|
12-Jan-2016 |
Nils Carlson <pyssling@ludd.ltu.se> |
core: Add machine-id setting
Allow for overriding all other machine-ids which may be present on
the system using a kernel command line systemd.machine_id or
--machine-id= option.
This is especially useful for network booted systems where the
machine-id needs to be static, or for containers where a specific
machine-id is wanted. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
affb60b1ef0cb48388d23360c6f3b043c50f6b8c |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out umask-related code to umask-util.h |
8fcde01280adcbd07e8205b91ac52b06305b6208 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split stat()/statfs()/stavfs() related calls into stat-util.[ch] |
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move a number of fs operations into fs-util.[ch] |
4349cd7c1d153c4ffa23cf1cff1644e0afa9bcf0 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move mount related utility calls to mount-util.[ch] |
e4e73a632524c382139034d4271f53b6089ab4cb |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out hex/dec/oct encoding/decoding into its own file |
c004493cdefc1f43a3956ca529e8070f8d70be56 |
|
26-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out IO related calls to io-util.[ch] |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over. |
07630cea1f3a845c09309f197ac7c4f11edd3b62 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.
This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.
Also touches a few unrelated include files. |
618234a5258768359cb1086b152c5f08aaf89754 |
|
30-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
basic: split out cpu set specific APIs into cpu-set-util.[ch] |
75f86906c52735c98dc0aa7e24b773edb42ee814 |
|
07-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
basic: rework virtualization detection API
Introduce a proper enum, and don't pass around string ids anymore. This
simplifies things quite a bit, and makes virtualization detection more
similar to architecture detection. |
671c34195896e89f935d842b13f52a748bd8a5b4 |
|
17-Aug-2015 |
Richard Maw <richard.maw@codethink.co.uk> |
namespace helpers: Allow entering a UID namespace
To be able to use `systemd-run` or `machinectl login` on a container
that is in a private user namespace, the sub-process must have entered
the user namespace before connecting to the container's D-Bus, otherwise
the UID and GID in the peer credentials are garbage.
So we extend namespace_open and namespace_enter to support UID namespaces,
and we enter the UID namespace in bus_container_connect_{socket,kernel}.
namespace_open will degrade to a no-op if user namespaces are not enabled
in the kernel.
Special handling is required for the setns call in namespace_enter with
a user namespace, since transitioning to your own namespace is forbidden,
as it would result in re-entering your user namespace as root.
Arguably it may be valid to check this at the call site, rather than
inside namespace_enter, but it is less code to do it inside, and if the
intention of calling namespace_enter is to *be* in the target namespace,
rather than to transition to the target namespace, it is a reasonable
approach.
The check for whether the user namespace is the same must happen before
entering namespaces, as we may not be able to access /proc during the
intermediate transition stage.
We can't instead attempt to enter the user namespace and then ignore
the failure from it being the same namespace, since the error code is
not distinct, and we can't compare namespaces while mid-transition. |
4c1fc3e404d648c70bd2f50ac50aeac6ece8872e |
|
07-Jul-2015 |
Daniel Mack <daniel@zonque.org> |
fileio: consolidate write_string_file*()
Merge write_string_file(), write_string_file_no_create() and
write_string_file_atomic() into write_string_file() and provide a flags mask
that allows combinations of atomic writing, newline appending and automatic
file creation. Change all users accordingly. |
e26d6ce517a49c246141ed20528614823c2f5799 |
|
29-May-2015 |
Martin Pitt <martin.pitt@ubuntu.com> |
path-util: Change path_is_mount_point() symlink arg from bool to flags
This makes path_is_mount_point() consistent with fd_is_mount_point() wrt.
flags. |
0b452006de98294d1690f045f6ea2f7f6630ec3b |
|
10-Apr-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
shared: add process-util.[ch] |
c6878637502b1717a110a9a7e8bba32a8583fcdf |
|
06-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
util: rework rm_rf() logic
- Move to its own file rm-rf.c
- Change parameters into a single flags parameter
- Remove "honour sticky" logic, it's unused these days |
c6ac7e4b98828b3b9ea5bd510cf8cc3c25dc2e58 |
|
10-Mar-2015 |
Lennart Poettering <lennart@poettering.net> |
machine-id-setup: simplifications |
a6dcc7e5924f9c27d3e9c6560a448b02ec28b65f |
|
10-Mar-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Introduce loop_read_exact helper
Usually when using loop_read(), we want to read the full buffer.
Add a helper that mirrors loop_write(), and returns 0 when full buffer
was read, and an error otherwise.
Use -ENODATA for the short read, to distinguish it from a read error. |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use. |
63c372cb9df3bee01e3bf8cd7f96f336bddda846 |
|
03-Feb-2015 |
Lennart Poettering <lennart@poettering.net> |
util: rework strappenda(), and rename it strjoina()
After all it is now much more like strjoin() than strappend(). At the
same time, add support for NULL sentinels, even if they are normally not
necessary. |
f131770b1465fbf423881f16ba85523a05f846fe |
|
31-Dec-2014 |
Veres Lajos <vlajos@gmail.com> |
tree-wide: spelling fixes
https://github.com/vlajos/misspell_fixer
https://github.com/torstehu/systemd/commit/b6fdeb618cf2f3ce1645b3315f15f482710c7ffa
Thanks to Torstein Husebo <torstein@huseboe.net>. |
553acb7b6b8d4f16a4747b1f978e8b7888fbfb2c |
|
10-Dec-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
treewide: sanitize loop_write
loop_write() didn't follow the usual systemd rules and returned status
partially in errno and required extensive checks from callers. Some of
the callers dealt with this properly, but many did not, treating
partial writes as successful. Simplify things by conforming to usual rules. |
979ef53a268d6f54a309fc5c6015df5d4accbbd5 |
|
03-Dec-2014 |
Didier Roche <didrocks@ubuntu.com> |
machine-id-setup: add a machine_id_commit call to commit on disk a transient machine-id
If /etc was read only at boot time with an empty /etc/machine-id, the latter
will be mounted as a tmpfs and get reset at each boot. If the system becomes rw
later, this functionality enables to commit in a race-free manner the
transient machine-id to disk. |
3543f8218b732132dff6d0dccb2ce357e4154801 |
|
03-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
machine-id-setup: casting const away is ugly, let's not do it if there's no reason to |
9496e375f7274e7d0f61f8e9d6a001b9f2dc579b |
|
03-Dec-2014 |
Didier Roche <didrocks@ubuntu.com> |
machine-id-setup: Factorize some machine-id-setup functions to be reused |
4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: another round of simplifications
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno
+ return simplifications". |
56f64d95763a799ba4475daf44d8e9f72a1bd474 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
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. |
23bbb0de4e3f85d9704a5c12a5afa2dfa0159e41 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: more log_*_errno + return simplifications |
da927ba997d68401563b927f92e6e40e021a8e5c |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values. |
0a1beeb64207eaa88ab9236787b1cbc2f704ae14 |
|
28-Nov-2014 |
Michal Schmidt <mschmidt@redhat.com> |
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(). |
86fb9ca7ae49790880d4b3ce523988b01b13d9ae |
|
01-Nov-2014 |
Jan Synacek <jsynacek@redhat.com> |
core: improve error message when machine id is missing |
5dd6d0f8ff1681fff9369e0aa2532979954dbfde |
|
20-Aug-2014 |
Lennart Poettering <lennart@poettering.net> |
machine-id-setup: don't try to read UUID from VM/container manager if we operate on a root directory that's not /
This should make sure no UUID from the host systemd-machine-id-setup is
running on leaks onto a disk image that is provisioned with the tool. |
73f860db9893deab6aebceb53dd7d0deb662e832 |
|
31-Jul-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Always prefer our headers to system headers
In practice this shouldn't make much difference, but
sometimes our headers might be newer, and we want to
test them. |
3577de7ac39c54821e1d1d946db65e109dfb94b2 |
|
24-Jun-2014 |
Kay Sievers <kay@vrfy.org> |
nspawn: create essential base directories at system bootup
This allows us to bootup a rootfs with a /usr directory only. |
489388fbc0be89e2b978258d277b5ff2da573174 |
|
17-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
machine-id-setup: allow passing NULL as function argument, for simplicity |
34f750b7251936965045754e0f337cd5495ea25b |
|
10-Jun-2014 |
Lennart Poettering <lennart@poettering.net> |
machine-id-setup: fix array size of parameters
Not that it really would have any effect on the generated code, but
let's not confuse people... |
0b36bbc42d3a408531517a02acaf56105b863d55 |
|
28-Apr-2014 |
Lennart Poettering <lennart@poettering.net> |
machine-id: only look into KVM uuid when we are not running in a
container |
03e334a1c7dc8c20c38902aa039440763acc9b17 |
|
18-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
util: replace close_nointr_nofail() by a more useful safe_close()
safe_close() automatically becomes a NOP when a negative fd is passed,
and returns -1 unconditionally. This makes it easy to write lines like
this:
fd = safe_close(fd);
Which will close an fd if it is open, and reset the fd variable
correctly.
By making use of this new scheme we can drop a > 200 lines of code that
was required to test for non-negative fds or to reset the closed fd
variable afterwards. |
fe970a8a30d611d454cb40025cfc32e29efa34e6 |
|
14-Mar-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
machine-id-setup: use path_kill_slashes and modernizations |
92f2f92edcad46ce4098ee26504edca0a1dad68e |
|
14-Mar-2014 |
Greg KH <gregkh@linuxfoundation.org> |
machine-id: add --root option to operate on an alternate fs tree
This makes it possible to initialize the /etc/machine-id file on an
arbitrary filesystem hierarchy. This helps systems that wish to run
this at image creation time in a subdirectory, or from initramfs before
pivot-root is called.
[tomegun: converted to using _cleanup_free_ macros] |
df28bc0836ad6a79cb537ad0b463819738088f3e |
|
21-Oct-2013 |
Kay Sievers <kay@vrfy.org> |
build-sys: use -Og instead of -O0 to catch warnings
$ touch src/core/dbus.c; make CFLAGS=-O0
make --no-print-directory all-recursive
Making all in .
CC src/core/libsystemd_core_la-dbus.lo
CCLD libsystemd-core.la
$ touch src/core/dbus.c; make CFLAGS=-Og
make --no-print-directory all-recursive
Making all in .
CC src/core/libsystemd_core_la-dbus.lo
src/core/dbus.c: In function 'init_registered_system_bus':
src/core/dbus.c:798:18: warning: 'id' may be used uninitialized in this function [-Wmaybe-uninitialized]
dbus_free(id);
^
CCLD libsystemd-core.la
-Og Optimize debugging experience. -Og enables optimizations that do
not interfere with debugging. It should be the optimization level of
choice for the standard edit-compile-debug cycle, offering a
reasonable level of optimization while maintaining fast compilation
and a good debugging experience. |
aa96c6cb44a6eeccc506ae055aae2519a7f914e1 |
|
30-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
id128: when taking user input for a 128bit ID, validate syntax
Also, always accept both our simple hexdump syntax and UUID syntax. |
4b73a0c0612d26d49791f389e92f85d6444c36af |
|
08-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
machine-id: fix missing initialization |
5c0d398dfc4d79df2209515d28cafd9dc129838e |
|
04-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
util: add a bit of syntactic sugar to run short code fragments with a different umask |
574d5f2dfc25226afc718aa5ba1a145fe5cad221 |
|
03-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
util: rename write_one_line_file() to write_string_file()
You can write much more than just one line with this call (and we
frequently do), so let's correct the naming. |
10d18763ec6f31ded1535f810be765f7fab2d97d |
|
31-Mar-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
nspawn, machine-id-setup: warn if read-only mount call fails
They are not crucial, but they shouldn't fail. |
a5c32cff1f56afe6f0c6c70d91a88a7a8238b2d7 |
|
14-Feb-2013 |
Harald Hoyer <harald@redhat.com> |
honor SELinux labels, when creating and writing config files
Also split out some fileio functions to fileio.c and provide a SELinux
aware pendant in fileio-label.c
see https://bugzilla.redhat.com/show_bug.cgi?id=881577 |
aed5a525777be452c8a451793cf9c16990ac5515 |
|
13-Aug-2012 |
Lennart Poettering <lennart@poettering.net> |
machine-id: properly mount transient machine ID read-only |
8e47b1d2ebefc4ca02c681eba87bb290c5af02d2 |
|
22-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
machine-id: fix spelling |
ab94af9201496ea3aa59bbf2a01eb750fbd1c08a |
|
22-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
util: unify getenv() logic for other PID |
08e1fb68d78b4adf26cce8387fc428b9e370bcf4 |
|
12-Apr-2012 |
Lennart Poettering <lennart@poettering.net> |
build-sys: move *-setup out of shared to avoid selinux being pulled in |