summaryrefslogtreecommitdiff
path: root/Users
AgeCommit message (Collapse)AuthorFilesLines
2010-01-17Fix SelfConfigMilan Bouchet-Valat1-2/+2
We don't need to use a struct, since the whole message only holds this object. Update the parameters taken in set_self(), which were outdated.
2010-01-11Return new user struct when creating userMilan Bouchet-Valat1-0/+4
Clients need to know what values were chosen for fields left blank. This also allows us to return NULL in case of failure, which provides error checking.
2010-01-11New groups protocolMilan Bouchet-Valat1-41/+44
GroupsConfig is now only used to fetch list of groups and settings. All commit operations now go through GroupConfig: set(), add() and del() methods. This avoids problems when committing the whole list, which could lead to removing all groups on the system.
2010-01-11Use PAM to set passwordMilan Bouchet-Valat1-120/+33
Instead of getting the password encrypted by the client, get it in plain text, and set it via PAM. This behavior is standard on all supported platforms, which allows for code simplification, and avoids bugs when new password encryption algorithms appear. Never return the encrypted password on the bus. Instead, PAM should always be used to change it, possibly authenticating when changing own password.
2010-01-11New SelfConfig protocolMilan Bouchet-Valat1-0/+35
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-11Allow user fields to be empty on creation to use defaultsMilan Bouchet-Valat1-35/+51
When creating an user, empty string or maximum unsigned 32 bits integer value means "default", platform tools will then apply default system settings themselves. This applies to all parameters but user login, which is mandatory. Most clients should use this instead of guessing the policy by themselves. On FreeBSD, we need to choose the name of the home dir ourselves, since pw doesn't create it.
2010-01-11New users D-Bus protocolMilan Bouchet-Valat1-78/+75
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-11-02Fix user password modificationMilan Bouchet-Valat1-0/+2
Commit ee59351bfa31ee60779a20a79b1b49f308a777b0 broke it by removing the password parameter.
2009-10-31Fix major typo in command modifying usersMilan Bouchet-Valat1-2/+1
Passing a variable that did not exist on default platform completely broke users modification in most cases.
2009-09-28Remove versioning for Debian systems, and make Ubuntu follow DebianMilan Bouchet-Valat1-1/+1
Versions are confusing, and we should only support the current distribution release, since backports to stable releases are very unlikely. All this complexity was creating bugs with new versions not being supported properly. Adapted from a patch shipped by Debian as 01_debian_4.0.patch.
2009-09-28Bugs 519273 & 346342 - Clean Utils::File::run() logic by using array of ↵Milan Bouchet-Valat2-96/+95
arguments Using system() with a string instead of an array raises various issues when strings passed include special chars. Overall, it's claner and safer to use an array everywhere. This requires us to use our own execution code since system() does not accept setting STDOUT, STDERR, LC_ALL, and starting processes in the background when using an array. Note that run_backticks() still use the old logic, which is safe(r) because those commandlines are static. However, this commit also cleans get_cmd_path() by merging do_get_cmd_path() into it, and removing duplicate settings like $PATH.
2009-08-19Bug 590239 - Fix distro detection in users to use proper variant of useraddJeremy Guitton1-1/+2
Used by Gentoo for a long time.
2007-12-12Add getFiles base in StbObject. Implement getFiles for UserConfig and ↵Carlos Garnacho1-11/+10
UsersConfig. * StbObject.pm: Add DBus method there. * Users/Users.pm: turns out that get_files was already there, move it after the other main methods. * UserConfig.pm, UsersConfig.pm: implement getFiles().
2007-11-08Do the same to GroupsConfig. Also, remove the ID from the message format.Carlos Garnacho2-28/+22
This is a interface change, but a few more are to come in order to become more maintenable in the future, and the adoption of s-t-b is still low enough.
2007-11-07Compare users through login name instead of the custom ID.Carlos Garnacho1-6/+6
This way, if a user changes login name, for s-t-b it will count as a removal and an addition. I don't think that renaming an user is an usual task, and the ID relies too much on the other side having the correct ID accounting, under risk of screwing up if it differs at some point (besides, the meaning of the configuration in the other side should not depend on this side)
2007-11-06Add UserConfig module.Carlos Garnacho1-0/+56
It will get/set configuration for a single user, this should be hidden by the dispatcher in the form of SelfConfig, as the backend modules can't know the uid of the requester.
2007-10-14Also make redhat derived distros use useraddCarlos Garnacho1-1/+2
2007-09-252007-09-26 Carlos Garnacho <carlosg@gnome.org>carlosg1-1/+2
Add support for Archlinux to UsersConfig and ServicesConfig. patch provided by Ermanno Scaglione <e.scaglione@arcor.de> * Users/Users.pm (add_user): Archlinux prefers useradd. * Init/Services.pm (get_runlevels) (set_archlinux_service_status) (get_rcng_service_info) (run_rcng_script): Fixes for rcng/archlinux init.
2007-09-152007-09-15 Carlos Garnacho <carlosg@gnome.org>carlosg1-3/+4
* Users/Users.pm (add_user): adduser doesn't work as expected in Slackware, make sure we fallback to useradd for that distro. Spotted by Markus Kanet <<darkvision@gmx.info>
2007-09-112007-09-12 Carlos Garnacho <carlosg@gnome.org>carlosg1-6/+6
* Users/Users.pm (add_user): use abbreviated options for useradd, they seem to be more generic, and makes adding users work again for Slackware. Based on a patch by Markus Kanet <darkvision@gmx.info>. Bug #471083.
2007-09-032007-09-03 Carlos Garnacho <carlosg@gnome.org>carlosg1-7/+12
* Users/Shells.pm (get): get list of unique elements.
2006-10-052006-10-05 Carlos Garnacho <carlosg@gnome.org>carlosg3-48/+168
Ported to 1.9.x a huge and incredible patch by Darren Kenny <Darren.Kenny@Sun.COM> and Erast Benson <erast@gnusolaris.com> to make s-t-b recognize and configure SunOS based systems. * Utils/Platform.pm: recognize OpenSolaris and Nexenta properly. * Utils/File.pm (read_joined_lines): added. * Users/Shells.pm, Users.pm, Groups.pm: add SunOS case paths. * Time/NTP.pm, TimeDate.pm: ditto. * Shares/NFS.pm: parse/modify dfstab in the SunOS case * Network/Hosts.pm, Ifaces.pm: add code to deal with SunOS network configuration. * Init/Services.pm: deal with SMF init system.
2006-09-152006-09-15 Carlos Garnacho <carlosg@gnome.org>carlosg2-20/+24
* UsersConfig.pm, GroupsConfig.pm, Users/Users.pm, Users/Groups.pm: add an independent identification number to users and groups, this number should not be modified in the other communication side (GID and UID can be changed) and new users/groups should have different ID numbers (ideally counting from the current max ID number). Fixes the case described in GNOME bug #342293.
2006-08-112006-08-11 Carlos Garnacho <carlosg@gnome.org>carlosg1-37/+0
* Utils/Platform.pm (guess): make distribution detection more generic, remove lots of check_distro() functions. (ensure_distro_map): create a distro metamap, from now adding a new distro that behaves exactly like another will be one liner. (PLATFORM_INFO): remove some ancient (as in ooold) distros. * Init/Services.pm, Network/Hosts.pm, Network/Ifaces.pm, Shares/SMB.pm, Time/NTP.pm, Time/TimeDate.pm, Users/Users.pm: Unify parse/replace distro maps where necessary, make shorter those lists now that the distro metamap is there.
2006-06-052006-06-05 Carlos Garnacho <carlosg@gnome.org>carlosg1-1/+3
* Makefile.am, Init/Makefile.am, Network/Makefile.am, Shares/Makefile.am, Time/Makefile.am, Users/Makefile.am, Utils/Makefile.am: distcheck fixes
2006-06-052006-06-05 Carlos Garnacho <carlosg@gnome.org>carlosg2-4/+6
* Users/Users.pm (change_user_chfn): specify which user to modify. (add_user): remove a stray apostrophe. * Users/Groups.pm (change_group): get the correct state for the users
2006-05-292006-05-29 Joe Marcus Clarke <marcus@freebsd.org>carlosg1-0/+1
* Network/Ifaces.pm: fix wireless support, improve interface type detection. * Init/Services.pm, Init/ServicesList.pm, Network/Hosts.pm, Network/Ifaces.pm, Shares/SMB.pm, Time/NTP.pm, Time/TimeDate.pm, Users/Users.pm, Utils/Platform.pm: add support for FreeBSD 7
2006-05-262006-05-26 Carlos Garnacho <carlosg@gnome.org>carlosg2-30/+76
* UsersConfig.pm: added default group. -1 will mean "create new group for the user" * Users/Groups.pm: use addgroup/delgroup if available * Users/Users.pm: use adduser/deluser if available, translate default group to GIDs. Do not use a global variable getting the configuration, some values may survive several get() calls
2006-05-162006-05-15 Carlos Garnacho Parro <carlosg@gnome.org>carlosg5-0/+1057
* Merged the waiting-the-dbus branch into HEAD * configure.in, Makefile.am, autogen.sh: bump to 1.9.0, do not use translations (no longer needed) and fix references to the new .pc file * GroupsConfig.pm, HostsConfig.pm, IfacesConfig.pm, NFSConfig.pm, NTPConfig.pm, SMBConfig.pm, ServicesConfig.pm, ServicesList.pm, SharesList.pm, SystemToolsBackends.pl.in, TimeConfig.pm, UsersConfig.pm, org.freedesktop.SystemToolsBackends.service.in, system-tools-backends-2.0.pc.in, test-backends, Init/Services.pm, Init/ServicesList.pm, Network/Hosts.pm, Network/Ifaces.pm, Shares/Exports.pm, Shares/NFS.pm, Shares/SMB.pm, Time/NTP.pm, Time/TimeDate.pm, Users/Groups.pm, Users/Shells.pm, Users/Users.pm, Utils/Backend.pm, Utils/File.pm, Utils/Monitor.pm, Utils/Parse.pm, Utils/Platform.pm, Utils/Replace.pm, Utils/Report.pm, Utils/Util.pm, Utils/XML.pm: Added/refactored files, replace the functionality in the older *.pl.in files * boot-conf.in, boot-grub.pl.in, boot-lilo.pl.in, boot-yaboot.pl.in, boot.pl.in, file.pl.in, general.pl.in, network-conf.in, network.pl.in, parse.pl.in, platform.pl.in, replace.pl.in, report.pl.in, service-list.pl.in, service.pl.in, services-conf.in, share.pl.in, shares-conf.in, system-tools-backends.pc.in, time-conf.in, users-conf.in, util.pl.in, xml.pl.in: Functional removed files, they've been replaced with the files above. * add_amp.sh, debug.pl.in, dhcpd-conf.in, dhcpd.pl.in, disks-conf.in, display-conf.in, filesys.pl.in, font-conf.in, font.pl.in, gen-reportcode-list.sh, guess_system.sh, hardware-conf.in, internetsharing-conf.in, ishare.pl.in, media.pl.in, memory-conf.in, mouse-conf.in, option.pl, package-conf.in, partition.pl.in, perldoc.pl, print-conf.in, print.pl.in, process.pl.in, removable-media.pl.in, rhprinterdb2gstxml.pl, test.pl, tokenizer.pl.in, type1inst, x.pl.in: Bunch of unused files (or used in unstable tools), if/when they prove their usefulness, they'll be added back, but for now they'd better be in the Attic.