From: Mike Yuan Date: Sat, 3 Feb 2024 15:50:07 +0000 (+0800) Subject: core/exec-credential: make param const where appropriate X-Git-Tag: v256-rc1~968^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=881dbad1f10edc408490e9f2c53cd2e92c7ababc;p=thirdparty%2Fsystemd.git core/exec-credential: make param const where appropriate --- diff --git a/src/core/exec-credential.c b/src/core/exec-credential.c index 80ebd96f971..ef3033f67ab 100644 --- a/src/core/exec-credential.c +++ b/src/core/exec-credential.c @@ -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; diff --git a/src/core/exec-credential.h b/src/core/exec-credential.h index 6f836fbd0b8..9e4770d0b8e 100644 --- a/src/core/exec-credential.h +++ b/src/core/exec-credential.h @@ -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,