Skip to content

T7278: Fix python3-cracklib database creation on update #935

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 1 commit into from
Mar 25, 2025

Conversation

oniko94
Copy link
Contributor

@oniko94 oniko94 commented Mar 24, 2025

Change summary

Explicitly omit directory in /var/cache created by cracklib in the exclusion list for mksquashfs and add a script that creates this directory and required files in the chroot environment during build.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

https://vyos.dev/T7278

Related PR(s)

Blocks: vyos/vyos-1x#4413

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@oniko94 oniko94 requested a review from a team as a code owner March 24, 2025 09:55
Copy link

github-actions bot commented Mar 24, 2025

👍
No issues in PR Title / Commit Title

@github-actions github-actions bot added the current VyOS rolling release label Mar 24, 2025
Copy link
Contributor

@jestabro jestabro left a comment

Choose a reason for hiding this comment

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

Updating from an older image, namely one preceding the original addition of password strength check, this fix does not work to avoid the problem of T7278 --- I have no idea why yet, but we will hold off on merging until sorted out ...

Original image version: 1.5-rolling-202502242009
Update to current with this PR

I would suggest grabbing on older rolling release, say
https://github.com/vyos/vyos-nightly-build/releases/download/1.5-rolling-202502220006/vyos-1.5-rolling-202502220006-generic-amd64.iso
and checking to rule out (my) user error, and investigate root cause.

@oniko94 oniko94 force-pushed the fix/T7278-fix-cracklib-dep-build branch from f0f59c0 to ad69c72 Compare March 24, 2025 23:40
@oniko94
Copy link
Contributor Author

oniko94 commented Mar 24, 2025

@jestabro After a deeper investitgation and some tinkering while following your advice to test image update against an older release I have pinpointed the issue - the issue was, basically, in the build sequence - the script I've added executed as expected, BUT for no gain, because we generate the image squashfs after running all of the hooks - and it reads directly from the data/live-build-config/rootfs/excludes file, where we explicitly had a wildcard for any directory in /var/cache. Now, I have googled around and found these solutions:

and decided to change the excludes file accordingly. The effect of my change to that file is basically telling mksquashfs to exclude all files and directories in /var/cache except cracklib and its contents. Building a new image and testing an update against an older rolling release now worked as expected, and there were no redundant files copied to /var/cache except the cracklib directory and all of the required files. I have also tested creating a user in configuration mode, which worked as expected as well.

Copy link
Member

@dmbaturin dmbaturin left a comment

Choose a reason for hiding this comment

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

I have nothing against the PR, just a few minor suggestions.

@oniko94 oniko94 force-pushed the fix/T7278-fix-cracklib-dep-build branch from ad69c72 to 5b088c8 Compare March 25, 2025 11:53
@oniko94
Copy link
Contributor Author

oniko94 commented Mar 25, 2025

@dmbaturin thanks for the review! I've updated the PR according to the suggestions

@oniko94 oniko94 requested a review from dmbaturin March 25, 2025 11:54
@dmbaturin
Copy link
Member

@dmbaturin thanks for the review! I've updated the PR according to the suggestions

There was also a suggestion to fix the grammar of the log message and move it inside the conditional. Since it will only be shown if the cracklib database doesn't already exist, it can be just "Creating cracklib database in ...", without the "if it does not exist" part.

@oniko94 oniko94 force-pushed the fix/T7278-fix-cracklib-dep-build branch from 5b088c8 to 0646013 Compare March 25, 2025 12:15
@oniko94
Copy link
Contributor Author

oniko94 commented Mar 25, 2025

@dmbaturin thanks for the review! I've updated the PR according to the suggestions

There was also a suggestion to fix the grammar of the log message and move it inside the conditional. Since it will only be shown if the cracklib database doesn't already exist, it can be just "Creating cracklib database in ...", without the "if it does not exist" part.

My bad, missed it somehow; fixed right now

@oniko94 oniko94 requested review from jestabro and sever-sever March 25, 2025 12:45
@dmbaturin dmbaturin merged commit e57bff5 into vyos:current Mar 25, 2025
7 checks passed
@vyosbot vyosbot added mirror-initiated This PR initiated for mirror sync workflow mirror-completed and removed mirror-initiated This PR initiated for mirror sync workflow labels Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
current VyOS rolling release mirror-completed
Development

Successfully merging this pull request may close these issues.

6 participants