8000 20250313 unixd system cache by Firstyear · Pull Request #3501 · kanidm/kanidm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

20250313 unixd system cache #3501

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

Merged
merged 16 commits into from
Mar 14, 2025

Conversation

Firstyear
Copy link
Member

Change summary

The implementation of the unixd cache relies on inotify to detect changes to files in /etc so that we know when to reload the data for nss/passwd. However, the way that groupadd/del and other tools work is they copy the file, change it, and then move it into place. It turns out that william of the past didn't realise that inotify works on inodes not paths like other tools do (auditctl for example).

As a result, when something modified /etc/group or another related file, the removal was seen, but this breaks notifications on any future change until you reload unixd.

To resolve this we need to recursively watch /etc with inotify - yep, that's correct. We have to watch everything in /etc for changes because it's the only way to pick up on the add/remove of files. But because we have to watch everything, we need permissions to watch everything.

This forces us to move the parsing of the etc passwd/group/shadow files to the unixd tasks daemon - arguably, this is the correct place to read these anyway since that is a high priv (and locked down) daemon. Because of this, we actually end up solving the missing "shadow" group on debian issue, and probably similar on the BSD's in future.

In order to make my life easier while testing I also threw in a makefile that symlinks the files to needed locations for testing. It has plenty of warnings as it should.

Fixes #3499
Fixes #3407
Fixes #3249

Checklist

  • This PR contains no AI generated code
  • book chapter included (if relevant)
  • design document included (if relevant)

@Firstyear Firstyear requested a review from yaleman March 13, 2025 06:34
@Firstyear Firstyear marked this pull request as ready for review March 13, 2025 06:34
@Firstyear Firstyear force-pushed the 20250313-unixd-system-cache branch from 1112eec to 2ada7a3 Compare March 13, 2025 06:36
@Firstyear Firstyear enabled auto-merge (squash) March 13, 2025 23:58
Copy link
Member
@yaleman yaleman left a comment

Choose a reason for hiding this comment

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

Also, buncha tests failing 😄

@github-project-automation github-project-automation bot moved this from 🆕 New to 📋 Backlog in Organising Everything Mar 14, 2025
@Firstyear
Copy link
Member Author

Also, buncha tests failing 😄

Whaaaaaaa they weren't failing before. I'll have a look soon.

@Firstyear Firstyear force-pushed the 20250313-unixd-system-cache branch from 51d500e to d1d9aee Compare March 14, 2025 03:20
@Firstyear Firstyear merged commit b88b692 into kanidm:master Mar 14, 2025
25 checks passed
@github-project-automation github-project-automation bot moved this from 📋 Backlog to 🔖 Ready in Organising Everything Mar 14, 2025
@github-project-automation github-project-automation bot moved this from 🔖 Ready to ✅ Done in Organising Everything Mar 14, 2025
@Firstyear Firstyear deleted the 20250313-unixd-system-cache branch March 14, 2025 04:40
Copy link
Collaborator
@CEbbinghaus CEbbinghaus left a comment

Choose a reason for hiding this comment

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

RIP, Missed submitting the comment before the merge 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
3 participants
0