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

Chef/Modernize/CronDFileOrTemplate matches on /etc/cron.deny #946

Closed
tas50 opened this issue Feb 8, 2022 · 3 comments
Closed

Chef/Modernize/CronDFileOrTemplate matches on /etc/cron.deny #946

tas50 opened this issue Feb 8, 2022 · 3 comments
Labels
False Positive Cop has false positives (errors for no reason) Status: Good First Issue An issue ready for a new contributor. Triage: Confirmed Indicates and issue has been confirmed as described. Type: Bug Does not work as expected.

Comments

@tas50
Copy link
Contributor

tas50 commented Feb 8, 2022

/etc/cron.deny is matching with the Chef/Modernize/CronDFileOrTemplate cop. Example:

file '/etc/cron.deny' do
  action :delete
end
@tas50 tas50 added Type: Bug Does not work as expected. Status: Untriaged An issue that has yet to be triaged. labels Feb 8, 2022
@draksha22
Copy link

hey @tas50 can you please elaborate your issue.

@ddamw
Copy link

ddamw commented Mar 9, 2022

cron.deny and cron.allow are special files that can be placed in /etc/cron.d that allow or deny access to crontab. Their contents are completely different from regular cron.d files and as such can not be serviced by the cron_d resource.

Source: https://docs.oracle.com/cd/E19253-01/817-0403/sysrescron-23/index.html

I noticed that @tas50 is not even processing the file in /etc/cron.d, but in /etc instead, which should not trigger the warning at all imho. I noticed something similar with cron.daily, but will report that in a new issue.

@dafyddcrosby dafyddcrosby added Triage: Confirmed Indicates and issue has been confirmed as described. Status: Good First Issue An issue ready for a new contributor. False Positive Cop has false positives (errors for no reason) and removed Status: Untriaged An issue that has yet to be triaged. labels Jun 13, 2024
dafyddcrosby added a commit to dafyddcrosby/cookstyle that referenced this issue Jun 14, 2024
chef#959 fixed this, but the regression test was missing

Signed-off-by: David Crosby <dcrosby@fb.com>
@dafyddcrosby
Copy link
Collaborator

Confirmed bug fixed with #959, but didn't have a regression test, so made one with #972

dafyddcrosby added a commit to dafyddcrosby/cookstyle that referenced this issue Jun 14, 2024
chef#959 fixed this, but the regression tests were missing

Signed-off-by: David Crosby <dcrosby@fb.com>
tpowell-progress added a commit that referenced this issue Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive Cop has false positives (errors for no reason) Status: Good First Issue An issue ready for a new contributor. Triage: Confirmed Indicates and issue has been confirmed as described. Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

5 participants
@dafyddcrosby @tas50 @ddamw @draksha22 and others