summaryrefslogtreecommitdiff
path: root/dispatcher
AgeCommit message (Collapse)AuthorFilesLines
2010-01-11New SelfConfig protocolMilan Bouchet-Valat1-60/+11
SelfConfig is now a real object, and a dispatcher redirects messages with the UID of the caller. Rename a few calls that were naming it user_config, to avoid any confusion with the general UserConfig. Add SelfConfig.pm, only accepting GECOS fields, locale and location, since other parameters can't be changed without admin authentication. Old and new passwords are required, since we'll use PAM to change it. Add Users.pm::[sg]et_self() to handle the DBus methods. Update DBus config file as needed.
2010-01-11New users D-Bus protocolMilan Bouchet-Valat1-13/+12
Going through UsersConfig to commit changes to users is not the best solution since this can affect users that were not edited in case of a bug on the client's side. Thus, remove UsersConfig::set() in favor of new UserConfig::add(), del() and set(), which take a generic user structure. Allow these functions in dispatcher.c, but always check for "set" PolicyKit authorization (making distinction between "add", "set", "del" makes no sense at this point). Add some fields to the user struct to be used later: encrypted home, locale and location, plus password and home directory flags. GID is now an unsigned 32 bits integer, with its max value meaning no group. Rename D-Bus interfaces to UserConfig2 and UsersConfig2, since we break compatibility. Update DBus config file to reflect that.
2009-09-15Don't daemonize by defaultMilan Bouchet-Valat1-4/+6
D-Bus activation can return an error if we daemonize, so we should not do this be default, and let D-Bus daemonize the dispatcher. Thus, add a -D option to force this behavior if needed, and make -n a no-op. In the process, the commit removes the handling of the old STB_NO_DAEMON envvar, which has become useless. This fixes https://bugs.launchpad.net/bugs/411533. See also an explanation at https://bugzilla.gnome.org/show_bug.cgi?id=583356.
2009-08-19bfo#21529 - Move the s-t-b executable to sbindirVladimir Lettiev1-1/+1
s-t-b is system service and unprivileged users cannot run it. So it must be moved to sbindir.
2009-08-19bfo#18625 - Remove stale PID file when terminatingChris Coulson1-0/+7
Patch used downstream by Ubuntu.
2009-08-18Fix error message when authenticatingMilan Bouchet-Valat1-1/+1
Errors from polkit_authority_check_authorization_sync() are not related to getting the PID of the caller, and they should be self-explanative.
2009-08-18Port to PolicyKit1, part 2 (use PID to identify caller)Milan Bouchet-Valat1-2/+45
On the client side, GUIs should use PolkitLockButton from libpolkit-gtk-1, which uses PID to identify process. For now, PolicyKit requires us to use PIDs on both sides to work correctly. This commit is separate to allow reverting it or making it simpler if PolicyKit's API improves.
2009-08-18Port to PolicyKit1Milan Bouchet-Valat1-74/+12
We can remove many parts of the code thanks to the new version. This is fully incompatible with previous API of PolicyKit, so clients need to be updated too. This patch uses D-Bus connexion to identify the client, which does not work for now with PolkitLockButton in the GUI. Next patch fixes that, but could possibly be reverted or simplified later.
2009-03-17Fix some compiler warnings.Carlos Garnacho2-7/+9
2008-03-05Add I/O functions to manage PolicyKit configuration.Carlos Garnacho1-4/+49
This fixes authorization DB not being updated after the cache has been populated, which did lead to s-t-b not getting to know about new authorized processes.
2008-02-06Add some debugging to the privileges checking process.Carlos Garnacho1-2/+11
2008-01-16Get correctly the elements from the SelfConfig message. Also return an error ↵Carlos Garnacho1-1/+3
if something went wrong.
2008-01-14Update file monitor to latest gio changes.Carlos Garnacho1-1/+1
2007-12-15Compile with latest gio changes.Carlos Garnacho1-3/+2
2007-12-13Make s-t-b use DBus system bus activation. Distros shouldn't need a ↵Carlos Garnacho1-81/+11
initscript anymore. * configure.in: bumped DBus requirement to 1.1.2, install service files in system-services directory. * services/*.in: * org.freedesktop.SystemToolsBackends.service.in: Tell them to run with User=root. * system-tools-backends.conf.in: Removed, autofoo doesn't need to modify anything here anymore, new file is * system-tools-backends.conf: Added, contains new DBus rules. Basically, users can only access the dispatcher, only the user running the dispatcher (root) will be able to communicate with the backend modules. This is done so the dispatcher can check user permissions, etc... * Makefile.am: install new configuration file * dispatcher/dispatcher.c: do not spawn any private DBus, from now on, all communications will happen in the system bus, being the services spawned when they're required. * Utils/DBus.pm (get_bus): Make backend modules use the system bus.
2007-12-12Implement getFiles for GroupsConfig.Carlos Garnacho1-2/+0
2007-12-12Add StbFileMonitor object, use it in the dispatcher to emit "changed" when ↵Carlos Garnacho4-3/+381
any configuration file has changed. Now, configuration modules have to implement the getFiles method, so the dispatcher can query it and monitor the relevant files. * dispatcher/file-monitor.[ch]: new object * dispatcher/dispatcher.c: query files and at them to the monitor * configure.in: look optionally for Gio. This feature will not be compiled if Gio is not found. * dispatcher/Makefile.am: make necessary changes.
2007-12-08Add logging to the dispatcher.Carlos Garnacho3-2/+103
* dispatcher/dispatcher.[ch] (stb_dispatcher_[gs]et_debug): Added. Added some debug messages to the message dispatching flux. * dispatcher/main.c: turn debugging on when -d is passed.
2007-11-06Export a SelfConfig object, which uses internally UserConfig call for the ↵Carlos Garnacho1-8/+97
requester uid. * system-tools-backends.policy: add org.freedesktop.systemtoolsbackends.self.set action. * dispatcher.c (can_caller_do_action): add additional argument to set individual names for actions. (dispatch_stb_message): add parameter to pass a serial id around to forge the response. (dispatch_platform_message), (dispatcher_filter_func): update callers. (dispatch_user_config): new, creates and dispatch a UserConfig message for a SelfConfig request.
2007-11-06refactor message dispatchingCarlos Garnacho1-24/+35
Separate dispatch_platform_message() from dispatch_stb_message(), also just dispatch messages to the introspectable interface
2007-10-09Add optional support for PolicyKitCarlos Garnacho2-3/+99
If PolicyKit is found, s-t-b will ask it whether the user is allowed for the policy "org.freedesktop.systemtoolsbackends.set" before applying any change. The policy is configured to ask for admin password by default.
2007-10-09GObjectify dispatcherCarlos Garnacho4-147/+368
StbDispatcher lives in dispatcher.[ch] and the main routine lives in main.c
2007-07-052007-06-05 Carlos Garnacho <carlosg@gnome.org>carlosg1-3/+12
* dispatcher/dispatcher.c (get_destination): be more paranoid checking the destination path before creating the forwarded copy. (dispatch_stb_message): do not leak the copy if there was something wrong with the destination.
2006-12-012006-12-01 Carlos Garnacho <carlosg@gnome.org>carlosg1-4/+5
* dispatcher/dispatcher.c: do not read trash from private DBus stdout, problem spotted by seb128
2006-12-012006-12-01 Carlos Garnacho <carlosg@gnome.org>carlosg1-7/+18
* dispatcher/dispatcher.c: catch DBus errors, kill the private bus if there was any fatal error.
2006-11-302006-11-30 Carlos Garnacho <carlosg@gnome.org>carlosg1-1/+2
* configure.in, dispatcher/dispatcher.c: use localstatedir for the pidfile location based on the autogen/configure arguments.
2006-11-302006-11-30 Carlos Garnacho <carlosg@gnome.org>carlosg1-1/+5
* dispatcher/dispatcher.c (daemonize): Oops, create the pid file if it doesn't exist, also close unneeded file descriptors.
2006-11-272006-11-27 Carlos Garnacho <carlosg@gnome.org>carlosg2-0/+316
Merge c-dispatcher branch, adds a lightweight dispatcher which raises configuration modules on demand, reducing memory use during inactivity and allowing the development of modules in other languages than Perl. 2006-10-24 Carlos Garnacho <carlosg@gnome.org> * dispatcher/dispatcher.c: exit() on SIGTERM. 2006-10-24 Carlos Garnacho <carlosg@gnome.org> Continued work on the dispatcher, I think it's now feature complete enough to work. * StbObject.pm: base object for s-t-b services, does all initialization and common stuff. * GroupsConfig.pm, HostsConfig.pm, IfacesConfig.pm, NFSConfig.pm, NTPConfig.pm, SMBConfig.pm, ServicesConfig.pm, TimeConfig.pm, UsersConfig.pm: inherit from StbObject, keep message format in a variable to avoid duplicates. * Utils/Platform.pm: move DBus code to Platform.pm. * Platform.pm: added, new DBus object. * Utils/Backend.pm: ensure system and platform. * Init/Services.pm: code improvements for archlinux * dispatcher/dispatcher.c: Add license, make it raise it's own private session bus to spawn configuration modules, cache platform and return it when asked, create a copy of the message to pass around (seems to be necessary by design) * services/*: added, used to raise configuration modules. * configure.in, Makefile.am: added services directory stuff. 2006-10-13 Carlos Garnacho <carlosg@gnome.org> * dispatcher/dispatcher.c (daemonize): added, function to make the dispatcher become a daemon. 2006-10-12 Carlos Garnacho <carlosg@gnome.org> beginnings of a really lightweight dispatcher written in C, this way the modules will only be loaded when necessary, reducing memory usage and allowing to develop modules in other languages than Perl. * dispatcher/dispatcher.c, Makefile.am: added, first draft of the dispatcher, it already forwards messages and sends replies back and tries to raise modules in the session bus * Makefile.am: add the dispatcher directory. * configure.in: require GLib to build the dispatcher, maybe this dep could be dropped at some point in the future, if I don't feel too lazy... * Utils/Backend.pm: remove --no-daemon and --session-bus parameters, should be no longer needed. Add --disable-shutdown for testing purposes, as modules are supposed to shutdown automatically after some inactivity. Add --module parameter to raise a configuration module. * GroupsConfig.pm, HostsConfig.pm, IfacesConfig.pm, NFSConfig.pm, NTPConfig.pm, SMBConfig.pm, ServicesConfig.pm, TimeConfig.pm, UsersConfig.pm: create the DBus object by themselves. * SystemToolsBackends.pl.in: do not create all the DBus objects, just the one we want to raise, this way the script becomes a loader for services instead of a service itself.