Skip to content

Fix error code in is_assigned#483

Merged
jbaublitz merged 1 commit into
stratis-storage:masterfrom
frankdavid:master
May 27, 2026
Merged

Fix error code in is_assigned#483
jbaublitz merged 1 commit into
stratis-storage:masterfrom
frankdavid:master

Conversation

@frankdavid
Copy link
Copy Markdown
Contributor

The C function crypt_token_is_assigned returns -ENOENT when the token is unassigned.

The C function `crypt_token_is_assigned` returns a negative error code when the token is unassigned, but libc::ENOENT is positive.
@packit-as-a-service
Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/stratis-storage-libcryptsetup-rs-483
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

1 similar comment
@packit-as-a-service
Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/stratis-storage-libcryptsetup-rs-483
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

Copy link
Copy Markdown
Member

@jbaublitz jbaublitz left a comment

Choose a reason for hiding this comment

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

I'm a little confused by this PR.

Here's what I found:

/**
 * Get info about token assignment to particular keyslot.
 *
 * @param cd crypt device handle
 * @param token token id
 * @param keyslot keyslot
 *
 * @return @e 0 on success (token exists and is assigned to the keyslot),
 *	   -ENOENT if token is not assigned to a keyslot (token, keyslot
 *	   or both may be inactive) or other negative errno value otherwise.
 */

so the value should be negative. Based on libc docs this value is positive so the negative would need to be included in the comparison. Otherwise libcryptsetup would return -ENOENT (negative) which would be compared to libc::ENOENT (positive).

Copy link
Copy Markdown
Member

@jbaublitz jbaublitz left a comment

Choose a reason for hiding this comment

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

Wow I have not had enough coffee today. I read the left as the change and not the current state of things. This is correct. I'll merge this.

@jbaublitz jbaublitz assigned jbaublitz and frankdavid and unassigned jbaublitz May 27, 2026
@jbaublitz jbaublitz added the bug Something isn't working label May 27, 2026
@jbaublitz jbaublitz moved this to In Review in 2026May May 27, 2026
@jbaublitz jbaublitz modified the milestones: 0.16.0, 0.16.1 May 27, 2026
@jbaublitz jbaublitz merged commit 11682c3 into stratis-storage:master May 27, 2026
44 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in 2026May May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants