Skip to content

Commit

Permalink
libselinux: formally deprecate security_compute_user()
Browse files Browse the repository at this point in the history
It was originally marked for deprecation back in Feb 2020,
commit a41dfeb ("libselinux: deprecate security_compute_user(),
update man pages"), but the attribute was not added at the time.

Signed-off-by: Stephen Smalley <[email protected]>
  • Loading branch information
stephensmalley committed Oct 4, 2024
1 parent b411742 commit cc937c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libselinux/include/selinux/selinux.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,15 @@ extern int security_compute_member_raw(const char * scon,
* These interfaces are deprecated. Use get_ordered_context_list() or
* one of its variant interfaces instead.
*/
#ifdef __GNUC__
__attribute__ ((deprecated))
#endif
extern int security_compute_user(const char * scon,
const char *username,
char *** con);
#ifdef __GNUC__
__attribute__ ((deprecated))
#endif
extern int security_compute_user_raw(const char * scon,
const char *username,
char *** con);
Expand Down
2 changes: 2 additions & 0 deletions libselinux/src/compute_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ int security_compute_user(const char * scon,
if (selinux_trans_to_raw_context(scon, &rscon))
return -1;

IGNORE_DEPRECATED_DECLARATION_BEGIN
ret = security_compute_user_raw(rscon, user, con);
IGNORE_DEPRECATED_DECLARATION_END

freecon(rscon);
if (!ret) {
Expand Down

0 comments on commit cc937c3

Please sign in to comment.