-
Notifications
You must be signed in to change notification settings - Fork 2.7k
cargo-credential-libsecret: give FFI correctly-sized object #15767
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
+61
−47
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The type is typedef struct { const gchar *name; SecretSchemaFlags flags; SecretSchemaAttribute attributes[32]; /* <private> */ gint reserved; gpointer reserved1; gpointer reserved2; gpointer reserved3; gpointer reserved4; gpointer reserved5; gpointer reserved6; gpointer reserved7; } SecretSchema; so the current object we give it is 8 pointers too short It's incredibly lucky that libsecret, at this time, only uses reserved, and not in any of the functions we call
We already don't do this and use this precise idiom elsewhere
weihanglo
reviewed
Jul 22, 2025
weihanglo
approved these changes
Jul 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
bors
added a commit
to rust-lang/rust
that referenced
this pull request
Jul 25, 2025
Update cargo 8 commits in 6833aa715d724437dc1247d0166afe314ab6854e..9b296973b425ffb159e12cf3cd56580fd5c85382 2025-07-13 02:25:52 +0000 to 2025-07-25 17:10:08 +0000 - Allow using Cargo-as-a-library with gix's reqwest backend (rust-lang/cargo#15653) - Make timings graphs scalable to user's window (rust-lang/cargo#15766) - refactor: rename arg `mode` to `intent` (rust-lang/cargo#15774) - fix: `no-proc-macro` is overridden by subsequent edges (rust-lang/cargo#15764) - Use `gix` for `cargo package` (rust-lang/cargo#15534) - cargo-credential-libsecret: give FFI correctly-sized object (rust-lang/cargo#15767) - Remove unnecessary target-c-int-width from target specs (rust-lang/cargo#15759) - Expose artifact dependency getters in cargo-as-a-library (rust-lang/cargo#15753)
bors
added a commit
to rust-lang/rust
that referenced
this pull request
Jul 25, 2025
Update cargo 8 commits in 6833aa715d724437dc1247d0166afe314ab6854e..9b296973b425ffb159e12cf3cd56580fd5c85382 2025-07-13 02:25:52 +0000 to 2025-07-25 17:10:08 +0000 - Allow using Cargo-as-a-library with gix's reqwest backend (rust-lang/cargo#15653) - Make timings graphs scalable to user's window (rust-lang/cargo#15766) - refactor: rename arg `mode` to `intent` (rust-lang/cargo#15774) - fix: `no-proc-macro` is overridden by subsequent edges (rust-lang/cargo#15764) - Use `gix` for `cargo package` (rust-lang/cargo#15534) - cargo-credential-libsecret: give FFI correctly-sized object (rust-lang/cargo#15767) - Remove unnecessary target-c-int-width from target specs (rust-lang/cargo#15759) - Expose artifact dependency getters in cargo-as-a-library (rust-lang/cargo#15753)
github-actions bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this pull request
Jul 28, 2025
Update cargo 8 commits in 6833aa715d724437dc1247d0166afe314ab6854e..9b296973b425ffb159e12cf3cd56580fd5c85382 2025-07-13 02:25:52 +0000 to 2025-07-25 17:10:08 +0000 - Allow using Cargo-as-a-library with gix's reqwest backend (rust-lang/cargo#15653) - Make timings graphs scalable to user's window (rust-lang/cargo#15766) - refactor: rename arg `mode` to `intent` (rust-lang/cargo#15774) - fix: `no-proc-macro` is overridden by subsequent edges (rust-lang/cargo#15764) - Use `gix` for `cargo package` (rust-lang/cargo#15534) - cargo-credential-libsecret: give FFI correctly-sized object (rust-lang/cargo#15767) - Remove unnecessary target-c-int-width from target specs (rust-lang/cargo#15759) - Expose artifact dependency getters in cargo-as-a-library (rust-lang/cargo#15753)
github-actions bot
pushed a commit
to rust-lang/rust-analyzer
that referenced
this pull request
Jul 28, 2025
Update cargo 8 commits in 6833aa715d724437dc1247d0166afe314ab6854e..9b296973b425ffb159e12cf3cd56580fd5c85382 2025-07-13 02:25:52 +0000 to 2025-07-25 17:10:08 +0000 - Allow using Cargo-as-a-library with gix's reqwest backend (rust-lang/cargo#15653) - Make timings graphs scalable to user's window (rust-lang/cargo#15766) - refactor: rename arg `mode` to `intent` (rust-lang/cargo#15774) - fix: `no-proc-macro` is overridden by subsequent edges (rust-lang/cargo#15764) - Use `gix` for `cargo package` (rust-lang/cargo#15534) - cargo-credential-libsecret: give FFI correctly-sized object (rust-lang/cargo#15767) - Remove unnecessary target-c-int-width from target specs (rust-lang/cargo#15759) - Expose artifact dependency getters in cargo-as-a-library (rust-lang/cargo#15753)
rust-cloud-vms bot
pushed a commit
to makai410/rustc_public
that referenced
this pull request
Aug 16, 2025
Update cargo 8 commits in 6833aa715d724437dc1247d0166afe314ab6854e..9b296973b425ffb159e12cf3cd56580fd5c85382 2025-07-13 02:25:52 +0000 to 2025-07-25 17:10:08 +0000 - Allow using Cargo-as-a-library with gix's reqwest backend (rust-lang/cargo#15653) - Make timings graphs scalable to user's window (rust-lang/cargo#15766) - refactor: rename arg `mode` to `intent` (rust-lang/cargo#15774) - fix: `no-proc-macro` is overridden by subsequent edges (rust-lang/cargo#15764) - Use `gix` for `cargo package` (rust-lang/cargo#15534) - cargo-credential-libsecret: give FFI correctly-sized object (rust-lang/cargo#15767) - Remove unnecessary target-c-int-width from target specs (rust-lang/cargo#15759) - Expose artifact dependency getters in cargo-as-a-library (rust-lang/cargo#15753)
rust-cloud-vms bot
pushed a commit
to makai410/rustc_public
that referenced
this pull request
Aug 20, 2025
Update cargo 8 commits in 6833aa715d724437dc1247d0166afe314ab6854e..9b296973b425ffb159e12cf3cd56580fd5c85382 2025-07-13 02:25:52 +0000 to 2025-07-25 17:10:08 +0000 - Allow using Cargo-as-a-library with gix's reqwest backend (rust-lang/cargo#15653) - Make timings graphs scalable to user's window (rust-lang/cargo#15766) - refactor: rename arg `mode` to `intent` (rust-lang/cargo#15774) - fix: `no-proc-macro` is overridden by subsequent edges (rust-lang/cargo#15764) - Use `gix` for `cargo package` (rust-lang/cargo#15534) - cargo-credential-libsecret: give FFI correctly-sized object (rust-lang/cargo#15767) - Remove unnecessary target-c-int-width from target specs (rust-lang/cargo#15759) - Expose artifact dependency getters in cargo-as-a-library (rust-lang/cargo#15753)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
The type is
so the current object we give it is 8 pointers too short
It's incredibly lucky that libsecret, at this time, only uses
reserved
, and not in any of the functions we callAlso, some obvious cleanups while I was there and comparing with my implementation from cargo-update 17.0.0.
How to test and review this PR?
Observe https://sources.debian.org/src/libsecret/0.20.5-3/libsecret/secret-schema.h/#L43 I suppose?