Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

group resource: Modified DarwinGroup to collect all users properly on macos #4343

Merged
merged 1 commit into from
Aug 8, 2019

Conversation

zenspider
Copy link
Contributor

I noticed that my profile targeting group "staff" on OSX wasn't
returning ME. That seemed wrong. And it turns out it is wrong. We were
not collecting any users whose primary group was that group. (almost
all regular users are in group staff and they're all missing).

I ALSO found out that our MockLoader-based testing is piss-poor and,
through much pain and suffering, figured out how to test the group
resource directly.

Signed-off-by: Ryan Davis zenspider@chef.io

Copy link
Contributor

@miah miah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to chefstyle -a =)

@zenspider
Copy link
Contributor Author

And probably to convert everything over to command resources? This was sloppy and only tested locally. Not sure HOW to test this tbh.. BK doesn't do mac yet.

Copy link
Contributor

@clintoncwolfe clintoncwolfe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it may seem unlikely someone would use a Mac machine as a remote scan target, we have to be careful to keep local execution separate from remote execution - so we need to check the backticks.

lib/inspec/resources/groups.rb Outdated Show resolved Hide resolved
@zenspider zenspider force-pushed the zenspider/osx-groups branch 2 times, most recently from 0a9cbf8 to 800eca4 Compare August 8, 2019 03:16
I noticed that my profile targeting group "staff" on OSX wasn't
returning *me*. I'm awesome! So that seemed wrong. And it turns out it
is wrong. We were not collecting any users whose primary group was
that group. (almost all regular users are in group staff and they're
all missing).

Signed-off-by: Ryan Davis <zenspider@chef.io>
@codeclimate
Copy link

codeclimate bot commented Aug 8, 2019

Code Climate has analyzed commit 374e365 and detected 2 issues on this pull request.

Here's the issue category breakdown:

Category Count
Bug Risk 1
Complexity 1

View more on Code Climate.

@clintoncwolfe clintoncwolfe added Platform: macOS Component: Core Resources Resources shipped with InSpec. Type: Bug Feature not working as expected labels Aug 8, 2019
@clintoncwolfe clintoncwolfe changed the title Modified DarwinGroup to collect all users properly. group resource: Modified DarwinGroup to collect all users properly on macos Aug 8, 2019
@clintoncwolfe clintoncwolfe merged commit 95e6bcb into master Aug 8, 2019
@clintoncwolfe clintoncwolfe deleted the zenspider/osx-groups branch August 8, 2019 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Core Resources Resources shipped with InSpec. Platform: macOS Type: Bug Feature not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants