]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/exec-credential: make param const where appropriate
authorMike Yuan <me@yhndnzj.com>
Sat, 3 Feb 2024 15:50:07 +0000 (23:50 +0800)
committerMike Yuan <me@yhndnzj.com>
Sun, 4 Feb 2024 08:35:13 +0000 (16:35 +0800)
src/core/exec-credential.c
src/core/exec-credential.h

index 80ebd96f971f51d63210ddc0da264c193d14830a..ef3033f67ab0c0cf44290e4e04c0103cf8ae4b45 100644 (file)
@@ -57,16 +57,15 @@ bool exec_context_has_credentials(const ExecContext *c) {
                 !set_isempty(c->import_credentials);
 }
 
-bool exec_context_has_encrypted_credentials(ExecContext *c) {
-        ExecLoadCredential *load_cred;
-        ExecSetCredential *set_cred;
-
+bool exec_context_has_encrypted_credentials(const ExecContext *c) {
         assert(c);
 
+        const ExecLoadCredential *load_cred;
         HASHMAP_FOREACH(load_cred, c->load_credentials)
                 if (load_cred->encrypted)
                         return true;
 
+        const ExecSetCredential *set_cred;
         HASHMAP_FOREACH(set_cred, c->set_credentials)
                 if (set_cred->encrypted)
                         return true;
index 6f836fbd0b835cccbdaf38f63ac6bf35d17c3553..9e4770d0b8e03256ec1e0f9164db8ef09bed3878 100644 (file)
@@ -34,8 +34,8 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(ExecLoadCredential*, exec_load_credential_free);
 extern const struct hash_ops exec_set_credential_hash_ops;
 extern const struct hash_ops exec_load_credential_hash_ops;
 
-bool exec_context_has_encrypted_credentials(ExecContext *c);
 bool exec_context_has_credentials(const ExecContext *c);
+bool exec_context_has_encrypted_credentials(const ExecContext *c);
 
 int exec_context_get_credential_directory(
                 const ExecContext *context,