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. |
b3267152783d5784c45010615045d4e8ee459da2 |
|
13-Jan-2016 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
tree-wide: check if errno is greater than zero (2)
Compare errno with zero in a way that tells gcc that
(if the condition is true) errno is positive. |
4afd3348c7506dd1d36305b7bcb9feb8952b9d6b |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
GLIB has recently started to officially support the gcc cleanup
attribute in its public API, hence let's do the same for our APIs.
With this patch we'll define an xyz_unrefp() call for each public
xyz_unref() call, to make it easy to use inside a
__attribute__((cleanup())) expression. Then, all code is ported over to
make use of this.
The new calls are also documented in the man pages, with examples how to
use them (well, I only added docs where the _unref() call itself already
had docs, and the examples, only cover sd_bus_unrefp() and
sd_event_unrefp()).
This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we
tend to call our destructors these days.
Note that this defines no public macro that wraps gcc's attribute and
makes it easier to use. While I think it's our duty in the library to
make our stuff easy to use, I figure it's not our duty to make gcc's own
features easy to use on its own. Most likely, client code which wants to
make use of this should define its own:
#define _cleanup_(function) __attribute__((cleanup(function)))
Or similar, to make the gcc feature easier to use.
Making this logic public has the benefit that we can remove three header
files whose only purpose was to define these functions internally.
See #2008. |
6ad623a3f77e087e308f334525fd4046811f2a9a |
|
03-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
parse-util: introduce parse_ifindex() and make use of it everywhere
We have enough places where we parse an ifindex, hence introduce a
proper parsing function for it, that verifies all parameters. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
f4f15635ec05293ffcc83a5b39f624bbabbd8fd0 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move a number of fs operations into fs-util.[ch] |
a09561746f15b84da9471b5c4be74e53d19e4f3f |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: introduce dirent-util.[ch] for directory entry calls
Also, move a couple of more path-related functions to path-util.c. |
bb15fafe9cd815fe5bf9eae84c08aead2eb98fd7 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util: move filename_is_valid() and path_is_safe() to path-util.[ch] |
6bedfcbb2970e06a4d3280c8fb62083d252ede73 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch] |
2583fbea8e762d2e915582af60560f884d5093f5 |
|
26-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
socket-util: move remaining socket-related calls from util.[ch] to socket-util.[ch] |
b1d4f8e154bf61b5de1b27461ef8e9c8c5e838a1 |
|
26-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out user/group/uid/gid calls into user-util.[ch] |
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. |
4f5dd3943bef8a04be7e3b838b822bb9a7ad6cb3 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util: split out escaping code into escape.[ch]
This really deserves its own file, given how much code this is now. |
4211d5bd135ae4c43bd2012ae5f327b1cc1596c0 |
|
08-Sep-2015 |
David Herrmann <dh.herrmann@gmail.com> |
sd-login: fix sd_seat_get_active() to return ENODATA
This seems to be an oversight from:
707b66c66381c899d7ef640e158ffdd5bcff4deb
We have to return ENODATA instead of ENOENT if a requested entry is
non-present. Also fix the call-site in udev to check for these errors. |
f5aaf575626022313b07d505699fa1af25d248ac |
|
05-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-login: add new sd_pid_get_cgroup() API
This adds a new sd_pid_get_cgroup() call to sd-login which may be used
to query the control path of a process. This is useful for programs when
making use of delegation units, in order to figure out which subtree has
been delegated.
In light of the unified control group hierarchy this is finally safe to
do, hence let's add a proper API for it, to make it easier to use this. |
707b66c66381c899d7ef640e158ffdd5bcff4deb |
|
04-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-login: rework error handling
Makre sure we always return sensible errors for the various, following
the same rules, and document them in a comment in sd-login.c. Also,
update all relevant man pages accordingly. |
a1f686daf55636f9446a4c017f2488a35595395e |
|
04-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
util: add new uid_is_valid() call
This simply factors out the uid validation checks from parse_uid() and
uses them everywhere. This simply verifies that the passed UID is
neither 64bit -1 nor 32bit -1. |
fc60d8153caebaeea8461e5c3ea1efe404d989d5 |
|
01-Sep-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-login: improve error handling
let's return ENXIO whenever we don't know something rather than ENOENT.
ENOENT suggests this was really about a file or directory, while ENXIO
is a more generic "not found" indicator. |
b9a8d250810d4803bc9bf6b36932b528cb991d1e |
|
24-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
machined: validate machine names at more places
When enumerating machines from /run, and when accepting machine names
for operations, be more strict and always validate.
Note that these checks are strictly speaking unnecessary, since
enumeration happens only on the trusted /run... |
25300b5a1fcf54674a69d0f4ab08925be00b0227 |
|
24-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
util: make machine_name_is_valid() a macro and move it to hostname-util.h
As it turns out machine_name_is_valid() does the exact same thing as
hostname_is_valid() these days, as it just invoked that and checked the
name length was < 64. However, hostname_is_valid() checks the length
against HOST_NAME_MAX anyway (which is 64 on Linux), hence any
additional check is redundant.
We hence replace machine_name_is_valid() by a macro that simply maps it
to hostname_is_valid() but sets the allow_trailing_dot parameter to
false. We also move this this call to hostname-util.h, to the same place
as the hostname_is_valid() declaration. |
8ac43fee1a2890d62edfe29282f66780bc1b634f |
|
14-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: generate EBADF when we get invalid fds
This is a follow-up to #907, and makes the same change for all our other
public APIs. |
a095315b3c31f7a419baceac82c26c3c5ac0cd12 |
|
11-Jun-2015 |
Kay Sievers <kay@vrfy.org> |
build-sys: split internal basic/ library from shared/
basic/ can be used by everything
cannot use anything outside of basic/
libsystemd/ can use basic/
cannot use shared/
shared/ can use libsystemd/ |
329ac4bc5429cd86c4ac76b13e7e2784f3982760 |
|
30-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
sd-bus,sd-login: add api for querying the slice within the the user systemd instance of a process
units are organized in slice trees, not only for the system instance,
but also for user systemd instances, expose this properly. |
6482f6269c87d2249e52e889a63adbdd50f2d691 |
|
10-Apr-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
shared: add formats-util.h |
527b7a421ff3927d4f3f170b1b143452e88ae1dc |
|
07-Apr-2015 |
Lennart Poettering <lennart@poettering.net> |
util: rework cunescape(), improve error handling
Change cunescape() to return a normal error code, so that we can
distuingish OOM errors from parse errors.
This also adds a flags parameter to control whether "relaxed" or normal
parsing shall be done. If set no parse failures are generated, and the
only reason why cunescape() can fail is OOM. |
a7f7d1bde43fc825c49afea3f946f5b4b3d563e0 |
|
27-Mar-2015 |
Harald Hoyer <harald@redhat.com> |
fix gcc warnings about uninitialized variables
like:
src/shared/install.c: In function ‘unit_file_lookup_state’:
src/shared/install.c:1861:16: warning: ‘r’ may be used uninitialized in
this function [-Wmaybe-uninitialized]
return r < 0 ? r : state;
^
src/shared/install.c:1796:13: note: ‘r’ was declared here
int r;
^ |
0a6f50c0afdfc434b492493bd9efab20cbee8623 |
|
12-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
include <poll.h> instead of <sys/poll.h>
include-what-you-use automatically does this and it makes finding
unnecessary harder to spot. The only content of poll.h is a include
of sys/poll.h so should be harmless. |
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. |
c72d5456e2d6a6c8cefbfc16a542ae03a769397f |
|
22-Sep-2014 |
David Herrmann <dh.herrmann@gmail.com> |
login: add public sd_session_get_desktop() API
The desktop brand is stored as DESKTOP variable for sessions. It can be
set arbitrarily by the session owner and identifies the desktop
environment that is running on that session. |
a2a5291b3f5ab6ed4c92f51d0fd10a03047380d8 |
|
31-Jul-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Reject invalid quoted strings
String which ended in an unfinished quote were accepted, potentially
with bad memory accesses.
Reject anything which ends in a unfished quote, or contains
non-whitespace characters right after the closing quote.
_FOREACH_WORD now returns the invalid character in *state. But this return
value is not checked anywhere yet.
Also, make 'word' and 'state' variables const pointers, and rename 'w'
to 'word' in various places. Things are easier to read if the same name
is used consistently.
mbiebl_> am I correct that something like this doesn't work
mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-passwd "Unlock EncFS"'
mbiebl_> systemd seems to strip of the quotes
mbiebl_> systemctl status shows
mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-password Unlock EncFS $RootDir $MountPoint
mbiebl_> which is pretty weird |
634af5665fda8776d22624d947c8de830e30a874 |
|
17-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-login: always use "indices" as plural of "index"
So far both "indexes" and "indices" was used. Let's clean this up, and
stick to indices, since it appears to be used more frequently. |
cabb0bc6b1a4ec57e108dc99364687d7c4f9670f |
|
11-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
nss-mymachines: add new NSS module for automatically resolving addresses of all local containers |
620a687cd2b27e93e289e057aad0e57f30651bf9 |
|
03-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-login: use the same code for verfiying machine names everywhere |
a077b666cb883213fd85be21b518c2de54cb70b1 |
|
19-May-2014 |
Lennart Poettering <lennart@poettering.net> |
sd-login: add C API to query primary session of a user |
de0671ee7fe465e108f62dcbbbe9366f81dd9e9a |
|
15-May-2014 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Remove unnecessary casts in printfs
No functional change expected :) |
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. |
58dfc42ecfa95f2b859790d726bfae2feea1faa9 |
|
17-Mar-2014 |
Lennart Poettering <lennart@poettering.net> |
build-sys: move sd-login src/login → src/libsystemd/sd-login
After all, it is ultimately linked to libsystems.so anyway, thus belongs
there and shares very little with the rest of logind, hence let's move
this away. |