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

feat(24.04): add libcrack-runtime and its dependencies #329

Open
wants to merge 5 commits into
base: ubuntu-24.04
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions slices/cracklib-runtime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package: cracklib-runtime

essential:
- cracklib-runtime_copyright

# Cracklib runs /usr/sbin/update-cracklib on install, and this
# in turns generate the cracklib caches. This is mostly possible to do
# as a mutation script, and is provided here:
# https://paste.ubuntu.com/p/Jc5vvgk3tN/
Copy link
Member

@rebornplusplus rebornplusplus Sep 11, 2024

Choose a reason for hiding this comment

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

Nice work there! It's a shame we cannot write raw bytes yet.
On another note, could this link expire some day? If so, I would want there to be something that does not expire, Github Gist maybe?

# however the files it writes are malformed as we cannot write raw bytes,
# but instead we write files as text which results in larger files than
# expected (i.e the generated cracklib_dict.hwm is 1618 bytes instead of 1024).
# If we could use the above mutation script, then the contents of the 'bins'
# slice would probably not be needed, together with most of the 'config'
# slice.
slices:
# the scripts use both 'file', 'find' and 'grep'
# so we ensure those dependencies are added.
# furthermore, libssl3t64 is required as well
bins:
essential:
- cracklib-runtime_config
- file_bins
- findutils_bins
- grep_bins
- libc6_libs
- libcrack2_libs
- libssl3t64_libs
contents:
/usr/sbin/cracklib-check:
/usr/sbin/cracklib-format:
/usr/sbin/cracklib-packer:
/usr/sbin/cracklib-unpacker:
/usr/sbin/create-cracklib-dict:
/usr/sbin/update-cracklib:

config:
contents:
/etc/cracklib/cracklib.conf:
/etc/logcheck/ignore.d.paranoid/cracklib-runtime:
/usr/share/dict/cracklib-small:
/var/cache/cracklib/: { make: true, mode: 0755 }

copyright:
contents:
/usr/share/doc/cracklib-runtime/copyright:
17 changes: 17 additions & 0 deletions slices/file.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package: file

essential:
- file_copyright

slices:
bins:
essential:
- libc6_libs
- libmagic1t64_config
- libmagic1t64_libs
contents:
/usr/bin/file:

copyright:
contents:
/usr/share/doc/file/copyright:
15 changes: 15 additions & 0 deletions slices/libcrack2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package: libcrack2

essential:
- libcrack2_copyright

slices:
libs:
essential:
- libc6_libs
contents:
/usr/lib/*-linux-*/libcrack.so.2*:

copyright:
contents:
/usr/share/doc/libcrack2/copyright:
15 changes: 15 additions & 0 deletions slices/libmagic-mgc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package: libmagic-mgc

essential:
- libmagic-mgc_copyright

slices:
config:

Choose a reason for hiding this comment

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

Can we call this slice data since these files are binary not easily edited?

contents:
/usr/lib/file/magic.mgc:
/usr/share/file/magic.mgc:
/usr/share/misc/magic.mgc:

copyright:
contents:
/usr/share/doc/libmagic-mgc/copyright:
26 changes: 26 additions & 0 deletions slices/libmagic1t64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package: libmagic1t64

essential:
- libmagic1t64_copyright

slices:
libs:
essential:
- libbz2-1.0_libs
- libc6_libs
- liblzma5_libs
- zlib1g_libs
contents:
/usr/lib/*-linux-*/libmagic.so.1*:

config:
essential:
- libmagic-mgc_config
contents:
/etc/magic:
/etc/magic.mime:
/usr/share/misc/magic:

copyright:
contents:
/usr/share/doc/libmagic1t64/copyright:
31 changes: 31 additions & 0 deletions tests/spread/integration/cracklib-runtime/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
summary: Integration tests for cracklib-runtime

systems:
- -ubuntu-24.04-ppc64le
- -ubuntu-24.04-s390x
Comment on lines +4 to +5
Copy link
Member

Choose a reason for hiding this comment

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

Curious to know why you don't need these.


execute: |
rootfs="$(install-slices bash_bins base-files_base coreutils_bins cracklib-runtime_bins)"

chroot "$rootfs" ln -s /usr/bin/bash /bin/sh
chroot "$rootfs" /usr/sbin/update-cracklib

if ! [ -e "$rootfs"/var/cache/cracklib/cracklib_dict.hwm ]; then
echo "expected /var/cache/cracklib/cracklib_dict.hwm to exist"
exit -1
fi

if ! [ -e "$rootfs"/var/cache/cracklib/cracklib_dict.pwd ]; then
echo "expected /var/cache/cracklib/cracklib_dict.pwd to exist"
exit -1
fi

if ! [ -e "$rootfs"/var/cache/cracklib/cracklib_dict.pwi ]; then
echo "expected /var/cache/cracklib/cracklib_dict.pwi to exist"
exit -1
fi

if ! [ -e "$rootfs"/var/cache/cracklib/src-dicts ]; then
echo "expected /var/cache/cracklib/src-dicts to exist"
exit -1
fi

Choose a reason for hiding this comment

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

Can you also add smoke tests for the rest of the binaries in cracklib-runtime_bins slice?

Loading