summaryrefslogtreecommitdiff
path: root/lib/chef/provider/user
Commit message (Collapse)AuthorAgeFilesLines
* Solaris users are locked only if *LK*COOL-413/getent-on-solaris-doesnt-workTom Duffield2016-10-311-1/+1
| | | | | | | | | According to `man shadow` on Solaris 10 and 11, an account is only locked if the first four characters in the password field are `*LK*`. The same is true for SmartOS (the OS for which the initial code was contributed). Signed-off-by: Tom Duffield <tom@chef.io>
* Properly check lock status of user on solaris2Tom Duffield2016-10-311-12/+5
| | | | | | | | | On Solaris, the 'shadow' database does not exist within `getent`, so the checking for the username there won't return accurate results. As the Solaris provider assumes user management via /etc/shadow, we can very easily parse the contents of the file directly. Signed-off-by: Tom Duffield <tom@chef.io>
* fix manage_home provider inconsistencylcg/manage-home-consistencyLamont Granquist2016-10-064-23/+9
| | | | | | | | on freebsd and mac we're now telling people to use `manage_home` instead of `supports[:manage_home]` but it doesn't actually work. fixes that so that it works now. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Fix solaris handling for -m/-M behavior. Fixes #5403.Noah Kantrowitz2016-10-051-2/+4
| | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* Fully override the method because we are planning to phase out the shared ↵Noah Kantrowitz2016-09-212-2/+14
| | | | | | base class anyway so the slight code duplication is fine. Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* Solaris doesn't support -r for users or group.Noah Kantrowitz2016-09-191-1/+2
| | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* revert supports[:manage_home] behaviorLamont Granquist2016-09-141-4/+14
| | | | | | | even though i violently disagree that this is correct behavior and we're just going to break everyone in one massive go when we hit Chef 13. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* rewrite linu_user provider check_lockLamont Granquist2016-08-241-31/+19
| | | | | | | | | | | | this removes the kinda brittle kinda insane parsing of the installed rpm version. now we're just less strict about the exit 1 code and fail on the output not being what is expected. this also likely fixes a bug in rhel in why-run mode where shell_out! would have failed on the user-not-found and raised an exception that would have ended the run. the code before certainly looks buggy. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* sort out the -m / -M mess a bit betterLamont Granquist2016-08-231-5/+8
| | | | | | -M is not valid for usermod Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* clean up everythingLamont Granquist2016-08-231-5/+109
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* user provider manage_home behavior and refactorLamont Granquist2016-08-197-8/+48
| | | | | | | | | split out the user provider into 1:1 resources. fix the behavior of the linux user provider to implement manage_home behavior correctly. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* autofixing Style/AccessModifierIndentation copLamont Granquist2016-08-162-2/+2
|
* chefstyle Style/AndOr fixesLamont Granquist2016-03-142-2/+2
| | | | | this is part of our informal style guide, lets make it formal since clearly its not getting followed very well.
* s/escape_glob/escape_glob_dir/lcg/fix-escape-globLamont Granquist2016-03-101-1/+1
| | | | | Removes all remaining references to the deprecated escape_glob helper routine.
* Revert "Merge pull request #4465 from ↵tm/revert_4465Thom May2016-03-021-2/+2
| | | | | | | artursitarski/change-shell-for-locked-user" This reverts commit 94494e761763b877c3ef3b52eee9ac9df2186340, reversing changes made to a95a87d50c9e5af2fbd583afcf972880656d1a4b.
* flip multiline function arguments aroundlcg/rubocop-0.37.2Lamont Granquist2016-02-191-2/+2
| | | | no enforced trailing comma on arguments...
* deal with 0.37.2 renamed copsLamont Granquist2016-02-181-1/+1
| | | | | | | | | | | | | | | 252 Style/TrailingCommaInLiteral 84 Style/TrailingCommaInArguments 15 Style/SpaceAroundKeyword -- 351 Total We already dealt with SpaceAroundKeyword under its old name SpaceBeforeModifierKeyword, it looks like it got stricter about spaces after keywords. TrailingComma also got split, and it looks like the TrailingCommaInArguments behavior is new?
* Merge pull request #4465 from artursitarski/change-shell-for-locked-userThom May2016-02-161-2/+2
|\ | | | | Change shell for locked user.
| * More consistent wayartursitarski2016-01-271-4/+2
| |
| * Change shell for locked user.artursitarski2016-01-271-0/+2
| |
* | autofixing auto-inserted delimiterslcg/chefstyle-batchLamont Granquist2016-02-091-1/+1
| |
* | auto fixing some rubocopsLamont Granquist2016-02-092-6/+6
| | | | | | | | | | | | | | | | | | Style/NegatedWhile Style/ParenthesesAroundCondition Style/WhileUntilDo Style/WordArray Performance/ReverseEach Style/ColonMethodCall
* | autofixing whitespace copsLamont Granquist2016-02-055-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4174 Style/SpaceInsideHashLiteralBraces 1860 Style/SpaceAroundOperators 1336 Style/SpaceInsideBlockBraces 1292 Style/AlignHash 997 Style/SpaceAfterComma 860 Style/SpaceAroundEqualsInParameterDefault 310 Style/EmptyLines 294 Style/IndentationConsistency 267 Style/TrailingWhitespace 238 Style/ExtraSpacing 212 Style/SpaceBeforeBlockBraces 166 Style/MultilineOperationIndentation 144 Style/TrailingBlankLines 120 Style/EmptyLineBetweenDefs 101 Style/IndentationWidth 82 Style/SpaceAroundBlockParameters 40 Style/EmptyLinesAroundMethodBody 29 Style/EmptyLinesAroundAccessModifier 1 Style/RescueEnsureAlignment
* | Update all auth email address from opscode.com and getchef.com to chef.io.Noah Kantrowitz2016-02-022-2/+2
| | | | | | Generated via git ls-files | xargs perl -pi -e "s/(Author.*?<[^@]+@)(?:opscode\\.com|getchef\\.com)(>)/\\1chef.io\\2/gi"
* | Replace all Opscode copyrights with Chef Software.Noah Kantrowitz2016-02-025-5/+5
| | | | | | Created via git ls-files | xargs perl -pi -e "s/(Copyright.*?), Opscode(,)? Inc(\.)?/\\1, Chef Software Inc./gi"
* | Copyright year update for 2016 and massive cleanup.Noah Kantrowitz2016-02-026-7/+7
|/ | | Generated via git ls-files | xargs perl -pi -e "s/[Cc]opyright (?:\([Cc]\) )?((?\!$(date +%Y))\\d{4})(-\\d{4})?([, ][ \d]+)*(,|(?= ))/Copyright \\1-$(date +%Y),/g"
* Autofixing Style/PercentLiteralDelimeterslcg/percentliteraldelimetersLamont Granquist2016-01-183-3/+3
| | | | | | See chef/chefstyle#11 for analysis and discussion. We select '{}' since audit of our source code shows that is the most common, and that used to be the dominant learning paradigm (e.g. in ruby 1.9 pickaxe book.
* Use double quotes by defaultThom May2016-01-145-38/+38
| | | | | | | This is an entirely mechanically generated (chefstyle -a) change, to go along with chef/chefstyle#5 . We should pick something and use it consistently, and my opinion is that double quotes are the appropriate thing.
* autocorrecting Style/TrailingCommalcg/trailing_commaLamont Granquist2016-01-133-5/+5
| | | | chefstyle -a fixed 1044 occurrances
* really fix copslcg/really-fix-copsLamont Granquist2016-01-121-8/+8
|
* fix PR#3193 mutating new resourcelcg/3193Lamont Granquist2015-10-241-101/+108
| | | | | also converts ivar to accessors note with comments other new_resource mutating to clean up
* provider/user/dscl: Set "comment" default valueMikhail Zholobov2015-10-241-1/+2
| | | | | "comment" attribute should be defined to create user account properly on OS X. Otherwise, the RealName will be empty.
* provider/user/dscl: Set default gid to 20Mikhail Zholobov2015-10-231-2/+5
| | | | | gid should always be defined to create user account properly on OS X. "staff" (gid 20) is a default group for regular user accounts.
* fixing typoMatt Wrock2015-10-081-1/+1
|
* fix spacingmwrock/no_win_groupMatt Wrock2015-10-081-1/+1
|
* ignore gid on windows and warn to use groupMatt Wrock2015-10-081-4/+6
|
* fix locking/unlocking users on SmartOSDave Eddy2015-09-021-4/+32
|
* Move provider_mapping values out into the actual resource classesJohn Keiser2015-06-024-2/+7
|
* Sometimes plutil returns an invalid utf-8 string, which gets interpreted as ↵Jay Mundrawala2015-03-091-1/+5
| | | | | | ascii This causes plist gem to crash
* provider_resolver migration from provider_mappingLamont Granquist2015-03-042-0/+4
| | | | | | | | - move macosx providers to dynamic resolution - move windows providers to dynamic resolution - move openbsd/netbsd providers to dynamic resolution - move all cron providers to dynamic resolution - move mdadm to static mapping
* Merge pull request #2723 from patcox/CHEF-2667Phil Dibowitz2015-01-141-3/+13
|\ | | | | bugfix dscl provider
| * fix small readability issue, as per code reviewPat Cox2015-01-121-1/+3
| |
| * bugfix dscl providerPat Cox2015-01-121-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | We need to compare with the UID, not a GUID. So we need to map the correct field for comparison. Also fix a bug in determining used uids. This fixes this exception when the specified uid is actually in use by the correct user: Chef::Exceptions::RequestedUIDUnavailable: uid 48 is already in use
* | add code comment, add unit test for case when no salt is foundPat Cox2015-01-121-0/+4
| |
* | OS X user provider - fix exception if no salt is foundPat Cox2015-01-121-0/+1
|/ | | | | | | | Some system users don't have salts. This exception is fixed by this commit: # in `convert_to_binary': NoMethodError: undefined method `size' for nil:NilClass
* typo fixes - https://github.com/vlajos/misspell_fixerVeres Lajos2014-11-081-1/+1
|
* Remove requires path_helper from provider class, add to provider subclasses ↵Claire McQuin2014-09-241-0/+1
| | | | using PathHelper.
* Escape path for globbing.Claire McQuin2014-09-221-2/+2
|
* Updates based on @jaymzh's comments.Serdar Sutay2014-09-041-2/+6
|
* Set the password at the right time using the correct info in order not to ↵Serdar Sutay2014-09-041-28/+28
| | | | overwrite other changes.