summaryrefslogtreecommitdiff
path: root/lib/chef/provider/user
Commit message (Collapse)AuthorAgeFilesLines
* clean up updating_home?lcg/cleanup-userLamont Granquist2018-05-103-22/+0
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* bonus fix to remove unnecessary duping in dscl userLamont Granquist2018-05-101-7/+3
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* move should_set? to superclassLamont Granquist2018-05-103-13/+0
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* clean up AIX providerLamont Granquist2018-05-103-55/+37
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* better comment on /etc/shadow manglingLamont Granquist2018-05-101-1/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* clean up solaris providerLamont Granquist2018-05-101-71/+54
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* migrate logic into aix and solaris subclassesLamont Granquist2018-05-093-11/+136
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* mechanical conversion of most debug log statements to traceThom May2018-03-266-17/+17
| | | | Signed-off-by: Thom May <thom@chef.io>
* Check for set home property before file existence (fixes #5777)Sean Karlage2018-01-041-1/+1
| | | | Signed-off-by: Sean Karlage <skarlage@fb.com>
* fixes for rubocop 0.49.1 engineLamont Granquist2017-06-202-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* change worning msg for windows create user resourceMSys2017-05-051-1/+1
| | | | Signed-off-by: MSys <harikesh.kolekar@msystechnologies.com>
* Fix manage_home on AIXtm/aix_manage_homeThom May2017-04-271-1/+1
| | | | | | Fixes: #6092 Signed-off-by: Thom May <thom@chef.io>
* fix build break on master in linux user providerlcg/fix-linux-userLamont Granquist2017-04-041-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Merge pull request #5720 from Ppjet6/masterSteven Murawski2017-04-041-0/+1
|\ | | | | Add -u param to usermod in linux_user resource when using non_unique
| * Add -u param to usermod in linux_user resource when using non_uniqueMaxime “pep” Buquet2017-01-251-0/+1
| | | | | | | | Signed-off-by: Maxime “pep” Buquet <pep@collabora.com>
* | convert remaining popen4 code to shell_outLamont Granquist2017-04-011-7/+1
| | | | | | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Chef-13: Remove supports API from all user providersLamont Granquist2017-02-285-18/+18
|/ | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* user provider cleanupLamont Granquist2016-12-227-179/+168
| | | | | | | | * removes more run_command * converts to shell_out_compact * some other misc style cleanup Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Add a default GID for user creation on MacOS (#5393)cgerke2016-11-021-3/+8
| | | | | | | | | | | | * Avoid ArgumentError new_resource.gid.to_s will be empty if a recipe calls the user resource without gid and changes the home property. Will result in an exception and if chef is run by root, the home dir will end up being owned by root from the mv. * Avoid chown issues when using manage_home and not specifying a gid Using a sensible CONSTANT for gid when new_resource.gid.nil? Signed-off-by: Chris Gerke <chris.gerke@gmail.com>
* 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