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

Implement new Service method to retrieve its SID type info #112

Merged
merged 4 commits into from
Dec 27, 2023

Conversation

PaulDance
Copy link
Contributor

@PaulDance PaulDance commented Dec 12, 2023

Dear maintainers,

The Service struct supports modifying the underlying system resource's SID type information through the Service::set_config_service_sid_info method. However, there is currently no way to easily retrieve the value from the service manager, for example to check if a call to set_config_service_sid_info actually worked.

This PR therefore adds a new small Service::get_config_service_sid_info method that does just that. Also, some other minor bonus changes are included.

Cheers,
Paul.


This change is Reviewable

@faern faern requested a review from dlon December 22, 2023 13:33
Copy link
Member

@dlon dlon left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @PaulDance)


src/service.rs line 1652 at r1 (raw file):

    /// access permission prior to calling this method.
    pub fn get_config_service_sid_info(&self) -> crate::Result<ServiceSidType> {
        let mut data = vec![0u8; u32::BITS as usize / 8];

Nit: This could probably be replaced with let mut data = 0u32;

Copy link
Member

@dlon dlon left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @PaulDance)


src/service.rs line 1652 at r1 (raw file):

Previously, dlon (David Lönnhager) wrote…

Nit: This could probably be replaced with let mut data = 0u32;

Or even better: ServiceSidType::None

Copy link
Member

@dlon dlon left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @PaulDance)


src/service.rs line 1652 at r1 (raw file):

Previously, dlon (David Lönnhager) wrote…

Or even better: ServiceSidType::None

My bad, I see now that it must be a mutable slice. I must have been looking at change_config2.

@dlon dlon merged commit 1f8a221 into mullvad:main Dec 27, 2023
10 of 11 checks passed
@PaulDance
Copy link
Contributor Author

Yes, indeed!

Thanks a bunch!

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