* [PATCH 1/4] libselinux: add man page redirections
@ 2022-05-20 13:08 Christian Göttsche
2022-05-20 13:08 ` [PATCH 2/4] libselinux: enclose macro definition in parenthesis Christian Göttsche
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Christian Göttsche @ 2022-05-20 13:08 UTC (permalink / raw)
To: selinux
The following interfaces are documented but do not have a redirection:
- context_str(3)
- security_get_checkreqprot(3)
- security_set_boolean_list(3)
- selinux_sepgsql_context_path(3)
- setexecfilecon(3)
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
libselinux/man/man3/context_str.3 | 1 +
libselinux/man/man3/security_get_checkreqprot.3 | 1 +
libselinux/man/man3/security_set_boolean_list.3 | 1 +
libselinux/man/man3/selinux_sepgsql_context_path.3 | 1 +
libselinux/man/man3/setexecfilecon.3 | 1 +
5 files changed, 5 insertions(+)
create mode 100644 libselinux/man/man3/context_str.3
create mode 100644 libselinux/man/man3/security_get_checkreqprot.3
create mode 100644 libselinux/man/man3/security_set_boolean_list.3
create mode 100644 libselinux/man/man3/selinux_sepgsql_context_path.3
create mode 100644 libselinux/man/man3/setexecfilecon.3
diff --git a/libselinux/man/man3/context_str.3 b/libselinux/man/man3/context_str.3
new file mode 100644
index 00000000..f4f03a6d
--- /dev/null
+++ b/libselinux/man/man3/context_str.3
@@ -0,0 +1 @@
+.so man3/context_new.3
diff --git a/libselinux/man/man3/security_get_checkreqprot.3 b/libselinux/man/man3/security_get_checkreqprot.3
new file mode 100644
index 00000000..d59e5c2c
--- /dev/null
+++ b/libselinux/man/man3/security_get_checkreqprot.3
@@ -0,0 +1 @@
+.so man3/security_getenforce.3
diff --git a/libselinux/man/man3/security_set_boolean_list.3 b/libselinux/man/man3/security_set_boolean_list.3
new file mode 100644
index 00000000..29731efa
--- /dev/null
+++ b/libselinux/man/man3/security_set_boolean_list.3
@@ -0,0 +1 @@
+.so man3/security_load_booleans.3
diff --git a/libselinux/man/man3/selinux_sepgsql_context_path.3 b/libselinux/man/man3/selinux_sepgsql_context_path.3
new file mode 100644
index 00000000..175a611a
--- /dev/null
+++ b/libselinux/man/man3/selinux_sepgsql_context_path.3
@@ -0,0 +1 @@
+.so man3/selinux_binary_policy_path.3
diff --git a/libselinux/man/man3/setexecfilecon.3 b/libselinux/man/man3/setexecfilecon.3
new file mode 100644
index 00000000..b2e6ab81
--- /dev/null
+++ b/libselinux/man/man3/setexecfilecon.3
@@ -0,0 +1 @@
+.so man3/getexeccon.3
--
2.36.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/4] libselinux: enclose macro definition in parenthesis
2022-05-20 13:08 [PATCH 1/4] libselinux: add man page redirections Christian Göttsche
@ 2022-05-20 13:08 ` Christian Göttsche
2022-05-20 13:08 ` [PATCH 3/4] libselinux: name parameters in context.h Christian Göttsche
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Christian Göttsche @ 2022-05-20 13:08 UTC (permalink / raw)
To: selinux
Avoid potential precedence issues.
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
libselinux/include/selinux/avc.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libselinux/include/selinux/avc.h b/libselinux/include/selinux/avc.h
index 9b23357a..4bbd2382 100644
--- a/libselinux/include/selinux/avc.h
+++ b/libselinux/include/selinux/avc.h
@@ -24,7 +24,7 @@ struct security_id {
};
typedef struct security_id *security_id_t;
-#define SECSID_WILD (security_id_t)NULL /* unspecified SID */
+#define SECSID_WILD ((security_id_t)NULL) /* unspecified SID */
/**
* avc_sid_to_context - get copy of context corresponding to SID.
--
2.36.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/4] libselinux: name parameters in context.h
2022-05-20 13:08 [PATCH 1/4] libselinux: add man page redirections Christian Göttsche
2022-05-20 13:08 ` [PATCH 2/4] libselinux: enclose macro definition in parenthesis Christian Göttsche
@ 2022-05-20 13:08 ` Christian Göttsche
2022-06-07 17:16 ` [PATCH v2 " Christian Göttsche
2022-05-20 13:08 ` [PATCH 4/4] libselinux: declare parameter of security_load_policy(3) const Christian Göttsche
2022-06-08 17:51 ` [PATCH 1/4] libselinux: add man page redirections James Carter
3 siblings, 1 reply; 7+ messages in thread
From: Christian Göttsche @ 2022-05-20 13:08 UTC (permalink / raw)
To: selinux
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
libselinux/include/selinux/context.h | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/libselinux/include/selinux/context.h b/libselinux/include/selinux/context.h
index 949fb1e1..1fb3a69c 100644
--- a/libselinux/include/selinux/context.h
+++ b/libselinux/include/selinux/context.h
@@ -17,7 +17,7 @@ extern "C" {
/* Return a new context initialized to a context string */
- extern context_t context_new(const char *);
+ extern context_t context_new(const char *str);
/*
* Return a pointer to the string value of the context_t
@@ -25,24 +25,24 @@ extern "C" {
* for the same context_t*
*/
- extern char *context_str(context_t);
+ extern char *context_str(context_t con);
/* Free the storage used by a context */
- extern void context_free(context_t);
+ extern void context_free(context_t con);
/* Get a pointer to the string value of a context component */
- extern const char *context_type_get(context_t);
- extern const char *context_range_get(context_t);
- extern const char *context_role_get(context_t);
- extern const char *context_user_get(context_t);
+ extern const char *context_type_get(context_t con);
+ extern const char *context_range_get(context_t con);
+ extern const char *context_role_get(context_t con);
+ extern const char *context_user_get(context_t con);
/* Set a context component. Returns nonzero if unsuccessful */
- extern int context_type_set(context_t, const char *);
- extern int context_range_set(context_t, const char *);
- extern int context_role_set(context_t, const char *);
- extern int context_user_set(context_t, const char *);
+ extern int context_type_set(context_t con, const char *type);
+ extern int context_range_set(context_t con, const char *range);
+ extern int context_role_set(context_t con, const char *role);
+ extern int context_user_set(context_t con, const char *user);
#ifdef __cplusplus
}
--
2.36.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/4] libselinux: declare parameter of security_load_policy(3) const
2022-05-20 13:08 [PATCH 1/4] libselinux: add man page redirections Christian Göttsche
2022-05-20 13:08 ` [PATCH 2/4] libselinux: enclose macro definition in parenthesis Christian Göttsche
2022-05-20 13:08 ` [PATCH 3/4] libselinux: name parameters in context.h Christian Göttsche
@ 2022-05-20 13:08 ` Christian Göttsche
2022-06-08 17:51 ` [PATCH 1/4] libselinux: add man page redirections James Carter
3 siblings, 0 replies; 7+ messages in thread
From: Christian Göttsche @ 2022-05-20 13:08 UTC (permalink / raw)
To: selinux
security_load_policy(3) takes a read-only memory address for a binary
policy to be loaded.
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
libselinux/include/selinux/selinux.h | 2 +-
libselinux/man/man3/security_load_policy.3 | 2 +-
libselinux/src/load_policy.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libselinux/include/selinux/selinux.h b/libselinux/include/selinux/selinux.h
index ae98a92e..47af9953 100644
--- a/libselinux/include/selinux/selinux.h
+++ b/libselinux/include/selinux/selinux.h
@@ -279,7 +279,7 @@ extern int security_validatetrans_raw(const char *scon,
const char *newcon);
/* Load a policy configuration. */
-extern int security_load_policy(void *data, size_t len);
+extern int security_load_policy(const void *data, size_t len);
/* Get the context of an initial kernel security identifier by name.
Caller must free via freecon */
diff --git a/libselinux/man/man3/security_load_policy.3 b/libselinux/man/man3/security_load_policy.3
index af561636..b2da0256 100644
--- a/libselinux/man/man3/security_load_policy.3
+++ b/libselinux/man/man3/security_load_policy.3
@@ -5,7 +5,7 @@ security_load_policy \- load a new SELinux policy
.SH "SYNOPSIS"
.B #include <selinux/selinux.h>
.sp
-.BI "int security_load_policy(void *" data ", size_t "len );
+.BI "int security_load_policy(const void *" data ", size_t "len );
.sp
.BI "int selinux_mkload_policy(int " preservebools ");"
.sp
diff --git a/libselinux/src/load_policy.c b/libselinux/src/load_policy.c
index d8c715ed..17918e8b 100644
--- a/libselinux/src/load_policy.c
+++ b/libselinux/src/load_policy.c
@@ -23,7 +23,7 @@
#define MNT_DETACH 2
#endif
-int security_load_policy(void *data, size_t len)
+int security_load_policy(const void *data, size_t len)
{
char path[PATH_MAX];
int fd, ret;
--
2.36.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 3/4] libselinux: name parameters in context.h
2022-05-20 13:08 ` [PATCH 3/4] libselinux: name parameters in context.h Christian Göttsche
@ 2022-06-07 17:16 ` Christian Göttsche
0 siblings, 0 replies; 7+ messages in thread
From: Christian Göttsche @ 2022-06-07 17:16 UTC (permalink / raw)
To: selinux
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
v2:
- Rebase on top of dd98fa32 ("libselinux: declare return value of
context_str(3) const")
---
libselinux/include/selinux/context.h | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/libselinux/include/selinux/context.h b/libselinux/include/selinux/context.h
index 82f4e690..59d9bb69 100644
--- a/libselinux/include/selinux/context.h
+++ b/libselinux/include/selinux/context.h
@@ -17,7 +17,7 @@ extern "C" {
/* Return a new context initialized to a context string */
- extern context_t context_new(const char *);
+ extern context_t context_new(const char *str);
/*
* Return a pointer to the string value of the context_t
@@ -25,24 +25,24 @@ extern "C" {
* for the same context_t*
*/
- extern const char *context_str(context_t);
+ extern const char *context_str(context_t con);
/* Free the storage used by a context */
- extern void context_free(context_t);
+ extern void context_free(context_t con);
/* Get a pointer to the string value of a context component */
- extern const char *context_type_get(context_t);
- extern const char *context_range_get(context_t);
- extern const char *context_role_get(context_t);
- extern const char *context_user_get(context_t);
+ extern const char *context_type_get(context_t con);
+ extern const char *context_range_get(context_t con);
+ extern const char *context_role_get(context_t con);
+ extern const char *context_user_get(context_t con);
/* Set a context component. Returns nonzero if unsuccessful */
- extern int context_type_set(context_t, const char *);
- extern int context_range_set(context_t, const char *);
- extern int context_role_set(context_t, const char *);
- extern int context_user_set(context_t, const char *);
+ extern int context_type_set(context_t con, const char *type);
+ extern int context_range_set(context_t con, const char *range);
+ extern int context_role_set(context_t con, const char *role);
+ extern int context_user_set(context_t con, const char *user);
#ifdef __cplusplus
}
--
2.36.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] libselinux: add man page redirections
2022-05-20 13:08 [PATCH 1/4] libselinux: add man page redirections Christian Göttsche
` (2 preceding siblings ...)
2022-05-20 13:08 ` [PATCH 4/4] libselinux: declare parameter of security_load_policy(3) const Christian Göttsche
@ 2022-06-08 17:51 ` James Carter
2022-06-15 13:45 ` James Carter
3 siblings, 1 reply; 7+ messages in thread
From: James Carter @ 2022-06-08 17:51 UTC (permalink / raw)
To: Christian Göttsche; +Cc: SElinux list
On Fri, May 20, 2022 at 9:36 AM Christian Göttsche
<cgzones@googlemail.com> wrote:
>
> The following interfaces are documented but do not have a redirection:
>
> - context_str(3)
> - security_get_checkreqprot(3)
> - security_set_boolean_list(3)
> - selinux_sepgsql_context_path(3)
> - setexecfilecon(3)
>
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
For these four patches:
Acked-by: James Carter <jwcart2@gmail.com>
> ---
> libselinux/man/man3/context_str.3 | 1 +
> libselinux/man/man3/security_get_checkreqprot.3 | 1 +
> libselinux/man/man3/security_set_boolean_list.3 | 1 +
> libselinux/man/man3/selinux_sepgsql_context_path.3 | 1 +
> libselinux/man/man3/setexecfilecon.3 | 1 +
> 5 files changed, 5 insertions(+)
> create mode 100644 libselinux/man/man3/context_str.3
> create mode 100644 libselinux/man/man3/security_get_checkreqprot.3
> create mode 100644 libselinux/man/man3/security_set_boolean_list.3
> create mode 100644 libselinux/man/man3/selinux_sepgsql_context_path.3
> create mode 100644 libselinux/man/man3/setexecfilecon.3
>
> diff --git a/libselinux/man/man3/context_str.3 b/libselinux/man/man3/context_str.3
> new file mode 100644
> index 00000000..f4f03a6d
> --- /dev/null
> +++ b/libselinux/man/man3/context_str.3
> @@ -0,0 +1 @@
> +.so man3/context_new.3
> diff --git a/libselinux/man/man3/security_get_checkreqprot.3 b/libselinux/man/man3/security_get_checkreqprot.3
> new file mode 100644
> index 00000000..d59e5c2c
> --- /dev/null
> +++ b/libselinux/man/man3/security_get_checkreqprot.3
> @@ -0,0 +1 @@
> +.so man3/security_getenforce.3
> diff --git a/libselinux/man/man3/security_set_boolean_list.3 b/libselinux/man/man3/security_set_boolean_list.3
> new file mode 100644
> index 00000000..29731efa
> --- /dev/null
> +++ b/libselinux/man/man3/security_set_boolean_list.3
> @@ -0,0 +1 @@
> +.so man3/security_load_booleans.3
> diff --git a/libselinux/man/man3/selinux_sepgsql_context_path.3 b/libselinux/man/man3/selinux_sepgsql_context_path.3
> new file mode 100644
> index 00000000..175a611a
> --- /dev/null
> +++ b/libselinux/man/man3/selinux_sepgsql_context_path.3
> @@ -0,0 +1 @@
> +.so man3/selinux_binary_policy_path.3
> diff --git a/libselinux/man/man3/setexecfilecon.3 b/libselinux/man/man3/setexecfilecon.3
> new file mode 100644
> index 00000000..b2e6ab81
> --- /dev/null
> +++ b/libselinux/man/man3/setexecfilecon.3
> @@ -0,0 +1 @@
> +.so man3/getexeccon.3
> --
> 2.36.1
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/4] libselinux: add man page redirections
2022-06-08 17:51 ` [PATCH 1/4] libselinux: add man page redirections James Carter
@ 2022-06-15 13:45 ` James Carter
0 siblings, 0 replies; 7+ messages in thread
From: James Carter @ 2022-06-15 13:45 UTC (permalink / raw)
To: Christian Göttsche; +Cc: SElinux list
On Wed, Jun 8, 2022 at 1:51 PM James Carter <jwcart2@gmail.com> wrote:
>
> On Fri, May 20, 2022 at 9:36 AM Christian Göttsche
> <cgzones@googlemail.com> wrote:
> >
> > The following interfaces are documented but do not have a redirection:
> >
> > - context_str(3)
> > - security_get_checkreqprot(3)
> > - security_set_boolean_list(3)
> > - selinux_sepgsql_context_path(3)
> > - setexecfilecon(3)
> >
> > Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
>
> For these four patches:
> Acked-by: James Carter <jwcart2@gmail.com>
>
This series has been merged.
Thanks,
Jim
> > ---
> > libselinux/man/man3/context_str.3 | 1 +
> > libselinux/man/man3/security_get_checkreqprot.3 | 1 +
> > libselinux/man/man3/security_set_boolean_list.3 | 1 +
> > libselinux/man/man3/selinux_sepgsql_context_path.3 | 1 +
> > libselinux/man/man3/setexecfilecon.3 | 1 +
> > 5 files changed, 5 insertions(+)
> > create mode 100644 libselinux/man/man3/context_str.3
> > create mode 100644 libselinux/man/man3/security_get_checkreqprot.3
> > create mode 100644 libselinux/man/man3/security_set_boolean_list.3
> > create mode 100644 libselinux/man/man3/selinux_sepgsql_context_path.3
> > create mode 100644 libselinux/man/man3/setexecfilecon.3
> >
> > diff --git a/libselinux/man/man3/context_str.3 b/libselinux/man/man3/context_str.3
> > new file mode 100644
> > index 00000000..f4f03a6d
> > --- /dev/null
> > +++ b/libselinux/man/man3/context_str.3
> > @@ -0,0 +1 @@
> > +.so man3/context_new.3
> > diff --git a/libselinux/man/man3/security_get_checkreqprot.3 b/libselinux/man/man3/security_get_checkreqprot.3
> > new file mode 100644
> > index 00000000..d59e5c2c
> > --- /dev/null
> > +++ b/libselinux/man/man3/security_get_checkreqprot.3
> > @@ -0,0 +1 @@
> > +.so man3/security_getenforce.3
> > diff --git a/libselinux/man/man3/security_set_boolean_list.3 b/libselinux/man/man3/security_set_boolean_list.3
> > new file mode 100644
> > index 00000000..29731efa
> > --- /dev/null
> > +++ b/libselinux/man/man3/security_set_boolean_list.3
> > @@ -0,0 +1 @@
> > +.so man3/security_load_booleans.3
> > diff --git a/libselinux/man/man3/selinux_sepgsql_context_path.3 b/libselinux/man/man3/selinux_sepgsql_context_path.3
> > new file mode 100644
> > index 00000000..175a611a
> > --- /dev/null
> > +++ b/libselinux/man/man3/selinux_sepgsql_context_path.3
> > @@ -0,0 +1 @@
> > +.so man3/selinux_binary_policy_path.3
> > diff --git a/libselinux/man/man3/setexecfilecon.3 b/libselinux/man/man3/setexecfilecon.3
> > new file mode 100644
> > index 00000000..b2e6ab81
> > --- /dev/null
> > +++ b/libselinux/man/man3/setexecfilecon.3
> > @@ -0,0 +1 @@
> > +.so man3/getexeccon.3
> > --
> > 2.36.1
> >
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-06-15 13:46 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20 13:08 [PATCH 1/4] libselinux: add man page redirections Christian Göttsche
2022-05-20 13:08 ` [PATCH 2/4] libselinux: enclose macro definition in parenthesis Christian Göttsche
2022-05-20 13:08 ` [PATCH 3/4] libselinux: name parameters in context.h Christian Göttsche
2022-06-07 17:16 ` [PATCH v2 " Christian Göttsche
2022-05-20 13:08 ` [PATCH 4/4] libselinux: declare parameter of security_load_policy(3) const Christian Göttsche
2022-06-08 17:51 ` [PATCH 1/4] libselinux: add man page redirections James Carter
2022-06-15 13:45 ` James Carter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.