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

Minor signature handling improvements #36

Merged
merged 2 commits into from
May 1, 2016
Merged

Minor signature handling improvements #36

merged 2 commits into from
May 1, 2016

Conversation

Celti
Copy link
Contributor

@Celti Celti commented May 1, 2016

I got tired of waiting for #31 to be fixed, and also documented --sign. See commit messages for more detail.

Works for both symlinks and reflinks. In no case does it do any true
error handling for either one; it simply avoids creating symlinks if
source doesn't exist in the pool, and reflinks if it can't open either
end of the link.

This is on the grounds that the detached signature files aren't strictly
necessary for any purpose (as the database contains individual package
signatures) and therefore there's no need to complain if they don't
exist, and little need to complain if it can't create them.
_cleanup_close_ int sigsrc = openat(repo->poolfd, signame, O_RDONLY);
_cleanup_close_ int sigdest = openat(repo->rootfd, signame, O_WRONLY | O_TRUNC, 0664);

if (sigdest < 0 && errno == ENOENT && sigsrc > -1)
Copy link
Owner

@vodik vodik May 1, 2016

Choose a reason for hiding this comment

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

Am I missing something or will this condition always be false? Since sigdest is opened last, if sigdest > 0, errno should be 0, right?

Never mind, I fail at reading comprehension.

@vodik vodik merged commit 65687e1 into vodik:master May 1, 2016
@vodik
Copy link
Owner

vodik commented May 1, 2016

Looks good, thank you very much! Appreciate it.

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.

2 participants