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

Annotate libselinux functions #357

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
libselinux: declare avc_open(3) options parameter const
The first parameter of avc_open(3) is a read-only array of options.

Signed-off-by: Christian Göttsche <[email protected]>
  • Loading branch information
cgzones committed May 12, 2023
commit aad63240f5c6747b888e57becd55f3daf8946de6
2 changes: 1 addition & 1 deletion libselinux/include/selinux/avc.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ extern int avc_init(const char *msgprefix,
* is set to "avc" and any callbacks desired should be specified via
* selinux_set_callback(). Available options are listed above.
*/
extern int avc_open(struct selinux_opt *opts, unsigned nopts) selinux_access((read_only, 1, 2)) selinux_nodiscard;
extern int avc_open(const struct selinux_opt *opts, unsigned nopts) selinux_access((read_only, 1, 2)) selinux_nodiscard;

/**
* avc_cleanup - Remove unused SIDs and AVC entries.
Expand Down
2 changes: 1 addition & 1 deletion libselinux/man/man3/avc_open.3
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ avc_open, avc_destroy, avc_reset, avc_cleanup \- userspace SELinux AVC setup and
.br
.B #include <selinux/avc.h>
.sp
.BI "int avc_open(struct selinux_opt *" options ", unsigned " nopt ");"
.BI "int avc_open(const struct selinux_opt *" options ", unsigned " nopt ");"
.sp
.BI "void avc_destroy(void);"
.sp
Expand Down
2 changes: 1 addition & 1 deletion libselinux/src/avc.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ static int avc_init_internal(const char *prefix,
return rc;
}

int avc_open(struct selinux_opt *opts, unsigned nopts)
int avc_open(const struct selinux_opt *opts, unsigned nopts)
{
avc_setenforce = 0;

Expand Down