summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2013-11-28bus: add new sd_bus_creds object to encapsulate process credentialsLennart Poettering
This way we can unify handling of credentials that are attached to messages, or can be queried for bus name owners or connection peers. This also adds the ability to extend incomplete credential information with data from /proc, Also, provide a convenience call that will automatically determine the most appropriate credential object for an incoming message, by using the the attached information if possible, the sending name information if available and otherwise the peer's credentials.
2013-11-28util: fix handling of trailing whitespace in split_quoted()Lennart Poettering
Inspired by a patch by Lukas Nykryn.
2013-11-28logind: remove unused session->closing fieldDavid Herrmann
This field is always false, drop it. If you want a reliable way to get session state, call session_get_state(). Testing for any flags directly doesn't work currently so don't pretend it would.
2013-11-28logind: require VTs on seat0 and forbid elsewhereDavid Herrmann
Sessions on seat0 must pass us a vtnr, otherwise, you shouldn't try attaching it to seat0. For seats without VTs, we do the exact opposite: we forbid VTs. There can be odd situations if the session-files contain invalid combinations. However, we try to keep sessions alive and restore state as good as possible.
2013-11-28logind: make VT numbers unsignedDavid Herrmann
Fix the whole code to use "unsigned int" for vtnr. 0 is an invalid vtnr so we don't need negative numbers at all. Note that most code already assumes it's unsigned so in case there's a negative vtnr, our code may, under special circumstances, silently break. So this patch makes sure all sources of vtnrs verify the validity. Also note that the dbus api already uses unsigned ints.
2013-11-28networkd: fix several Address entries in [Network] sectionTom Gundersen
2013-11-28event: allow EPOLLET as event flagDavid Herrmann
EPOLLET enables edge-triggered mode (see epoll(7) for more). For most use-cases, level-triggered is just fine, but for master-TTYs we need edge-triggered to catch EPOLLHUP. master-TTYs signal EPOLLHUP if no client is connected, but a client may connect some time later (same happens during vhangup(2)). However, epoll doesn't allow masking EPOLLHUP so it's signaled constantly. To avoid this, edge-triggered mode is needed.
2013-11-28logind: mute/restore VT on behalf of session controllersDavid Herrmann
If a session process calls TakeControl(), we now put the VT into KD_GRAPHICS+K_OFF mode. This way, the new session controller can solely rely on the logind-dbus API to manage the session. Once the controller exits or calls ReleaseControl(), we restore the VT. We also restore it, if we lost a controller during crash/restart (but only if there really *was* a controller previously). Note that we also must put the VT into VT_PROCESS mode. We want VT_AUTO semantics, but VT_AUTO+KD_GRAPHICS actually disables *all* VT switches (who came up with that great idea?). Hence, we set VT_PROCESS for logind but acknowledge *all* requests immediately. If a compositor wants custom VT setups, they can still get this by *first* calling TakeControl() and afterwards setting up the VT. logind doesn't touch the VT during controller runtime, only during setup/teardown. This is actually what weston already does.
2013-11-28logind: restore session-controller after crashDavid Herrmann
We now save the unique bus-name of a session-controller as CONTROLLER=%s in the session files. This allows us to restore the controller after a crash or restart. Note that we test whether the name is still valid (dbus guarantees that the name is unique as long as the machine is up and running). If it is, we know that the controller still exists and can safely restore it. Our dbus-name-tracking guarantees that we're notified once it exits. Also note that session-devices are *not* restored. We have no way to know which devices where used before the crash. We could store all these on disk, too, or mark them via udev. However, this seems to be rather cumbersome. Instead, we expect controllers to listen for NewSession signals for their own session. This is sent on session_load() and they can then re-request all devices. The only race I could find is if logind crashes, then the session controller tries calling ReleaseControl() (which will fail as logind is down) but keeps the bus-connection valid for other independent requests. If logind is restarted, it will restore the old controller and thus block the session. However, this seems unlikely for several reasons: - The ReleaseControl() call must occur exactly in the timespan where logind is dead. - A process which calls ReleaseControl() usually closes the bus-connection afterwards. Especially if ReleaseControl() fails, the process should notice that something is wrong and close the bus. - A process calling ReleaseControl() usually exits afterwards. There may be any cleanup pending, but other than that, usual compositors exit. - If a session-controller calls ReleaseControl(), a session is usually considered closing. There is no known use-case where we hand-over session-control in a single session. So we don't care whether the controller is locked afterwards. So this seems negligible.
2013-11-28logind: ignore failing close() on session-devicesDavid Herrmann
Unfortunately, close() on a revoked/removed character-device fails with ENODEV. I tried tracking this down in the kernel, but couldn't figure out were exactly it comes from. However, can be easily reproduced with: fd = open("/dev/input/event0", O_RDWR); ioctl(fd, EVIOCREVOKE, 0); r = close(fd); A second close on @fd would return EBADF so the close is actually valid. We simply ignore close() errors for all session-devices as their access may be revoked asynchronously, or the device might get unplugged. We use close_nointr() in case anyone ever looks at the return value (or anyone runs "grep 'close(' -r src/" to find broken close() calls). Fixes: systemd-logind[31992]: Assertion 'close_nointr(fd) == 0' failed at src/shared/util.c:185, function close_nointr_nofail(). Aborting.
2013-11-28bus: add bus_name_has_owner() helperDavid Herrmann
Small helper to run a synchronous "NameHasOwner" request on the dbus-daemon.
2013-11-28login: revert lazy session-activation on non-VT seatsDavid Herrmann
Existing applications like gdm already depend on new sessions to get immediately activated on seats without VTs. Fixes a bug reported as: [systemd-devel] systemd 208:trouble with inactive user sessions at non-seat0 seats This patch restores the original behavior. We either need to add a new flag for session-creation or some other heuristic to avoid activating new sessions in the future.
2013-11-28bus: update kdbus.h and always subscribe to KDBUS_HELLO_ATTACH_NAMESKay Sievers
2013-11-28automount: log info about triggering processKay Sievers
2013-11-28core: initialize variableKay Sievers
2013-11-27Revert "socket-proxyd: Add --listener option for listener/destination pairs."Lennart Poettering
This reverts commit adcf4c81c58511b67644e17fa743d1729d3c9ccf. We have a better solution for the problem of making two processes run in the same namespace, and --listener is not needed hence and should be dropped. Conflicts: man/systemd-socket-proxyd.xml
2013-11-27namespace: comment typo fixLennart Poettering
2013-11-27bus: properly handle if we get disconnected during HELLO phaseLennart Poettering
2013-11-27service: add the ability for units to join other unit's PrivateNetwork= and ↵Lennart Poettering
PrivateTmp= namespaces
2013-11-27networkd: Initialize variable to NULLPatrik Flykt
If any number of arguments are given, _cleanup_manager_free_ is used with unitialized memory causing a crash.
2013-11-27logind: log which process is delaying suspend and not closing locksLennart Poettering
2013-11-27journald: mention how long we needed to flush to /var in the logsLennart Poettering
2013-11-27journal: simplify pre-allocation logicLennart Poettering
let's just do a single fallocate() as far as possible, and don't distuingish between allocated space and file size. This way we can save a syscall for each append, which makes quite some benefits.
2013-11-27journal: add a test case for flushing messages out of a series of journal ↵Lennart Poettering
files into a single new one
2013-11-27journal: allow journal_file_copy_entry() to work on non-local filesLennart Poettering
2013-11-27journal: fix iteration when we go backwards from the beginning of an array ↵Lennart Poettering
chain element
2013-11-26journal: optimize bisection logic a bit by caching the last positionLennart Poettering
This way we can do a quick restart limiting a bit how wildly we need to jump around during the bisection process.
2013-11-26journald: keep statistics on how of we hit/miss the mmap cacheLennart Poettering
2013-11-26journal: make table constLennart Poettering
2013-11-26journal: when appending to journal file, allocate larger blocks at onceLennart Poettering
2013-11-26tree-wide usage of %m specifier instead of strerror(errno)Daniel Buch
Also for log_error() except where a specific error is specified e.g. errno ? strerror(errno) : "Some user specified message"
2013-11-26systemctl: fix enable/disable reply handlingKay Sievers
2013-11-26pam_systemd: do not set XDG_RUNTIME_DIR if the session's original user is ↵Lennart Poettering
not the same as the newly logged in one It's better not to set any XDG_RUNTIME_DIR at all rather than one of a different user. So let's do this. This changes the bus call parameters of CreateSession(), but that is explicitly an internal API hence should be fine. Note however, that a logind restart (the way the RPM postinst scriptlets do it) is necessary to make things work again.
2013-11-26nspawn: improve error message when we cannot resolve the root directory argumentLennart Poettering
2013-11-26systemctl: replace the three job mode options by a single --job-mode= optionLennart Poettering
Also, expose the new "flush" job mode this way.
2013-11-26core: add new "flush" job mode to cancel all other jobs when queuing a new jobLennart Poettering
2013-11-26core: replace OnFailureIsolate= setting by a more generic OnFailureJobMode= ↵Lennart Poettering
setting and make use of it where applicable
2013-11-26networkd: add bridge supportTom Gundersen
A bridge is specified in a .netdev file with a section [Bridge] and at least the entry Name=. A link may be joined to a bridge if the .network applied to it has a Bridge= entry giving the name of the bridge in its [Network] section. We eagerly create all bridges on startup, and links are added to bridges as soon as they both appear.
2013-11-26networkd: minor fixesTom Gundersen
In particular, store the ifname, though we should only use it carefully, as it is not guaranteed to be stable. Using it for logging is fine though.
2013-11-26rtnl: add support for IFLA_MASTERTom Gundersen
2013-11-26rtnl: add preliminary support for containersTom Gundersen
For now, we only support one container type IFLA_LINKINFO, and we still lack support for parsing the containers again.
2013-11-25networkd: use correct printf formatterDave Reisner
uint64_t can be formatted correctly with %ju, rather than casting to unsigned and potentially losing accuracy.
2013-11-25conf-parser: fix memory realloc errorYin Kangkai
Otherwise there is some memory corruption and undefined behavior, e.g., in my case systemd-udev was always aborted at the _cleanup_freep_ around that code blocks.
2013-11-25core: fix order of parameters in broadcast_signal()Lennart Poettering
2013-11-25bus: properly return errors to client if invalid parameters are passed to ↵Lennart Poettering
built-in methods
2013-11-25service: fix handling of PID file inotify eventsLennart Poettering
2013-11-25core: include following set data in dumpLennart Poettering
2013-11-25swap: always track the current real device node of all swap devices, even ↵Lennart Poettering
when not active This way, we can avoid executing two /bin/swapon jobs to be dispatched for the same swap device if it is configured for two different paths. Previously we were just tracking the device nodes of active swap devices, which would not allow us to recognize the identity of two swap devices before they are active. https://bugs.freedesktop.org/show_bug.cgi?id=69835
2013-11-25shutdown: during final killing spree also send SIGHUP in addition to SIGTERM ↵Lennart Poettering
to deal with shells This makes shutdown a bit faster if debug-shell.service is enabled.
2013-11-25delete unused variablesThomas Hindoe Paaboel Andersen