Skip to content

join key dir and key filename/name with slash "/" #1233

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wolfaba
Copy link

@wolfaba wolfaba commented May 30, 2025

Summary

The apt-key definition provides dir, name and filename.

In the manifest/keyring.pp (apt::keyring) the destination file on the filesystem is generated as $file = "${dir}/${filename}".

In the manifest/source.pp (apt::source) the destination file is generated with the follwing code

$_list_keyring = if $_key['dir'] and $_key['filename'] {
  "${_key['dir']}${_key['filename']}"
} elsif $_key['filename'] {
  "/etc/apt/keyrings/${_key['filename']}"
} elsif $_key['dir'] {
  "${_key['dir']}${_key['name']}"
} else {
  "/etc/apt/keyrings/${_key['name']}"
}

If the $_list_keyring is generated from dir and filename or name, then there is no / separator between dir and filename. The key::dir: of the apt::source has to contains the / otherwise incorrect filename will be generated. This PR just create final full filename by joining directory name with filename using directory separator slash /.

@wolfaba wolfaba requested review from bastelfreak, smortex and a team as code owners May 30, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant