diff mbox series

[v2,5/6] libsemanage: Drop deprecated functions

Message ID 20201009130052.52409-6-plautrba@redhat.com (mailing list archive)
State Accepted
Headers show
Series [v2,1/6] libsepol: Get rid of the old and duplicated symbols | expand

Commit Message

Petr Lautrbach Oct. 9, 2020, 1 p.m. UTC
semanage_module_enable() and semanage_module_disable() were deprecated
by commit 9fbc6d14418f ("libsemanage: add back original module
enable/disable functions for ABI compatability") in 2014 in order to
preserve ABI compatibility. As we the libsemanage ABI is changed by the
previous commit, it makes sense to drop them completely.

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
 libsemanage/src/libsemanage.map |  2 --
 libsemanage/src/modules.c       | 56 ---------------------------------
 2 files changed, 58 deletions(-)

Comments

James Carter Oct. 15, 2020, 5:57 p.m. UTC | #1
On Fri, Oct 9, 2020 at 9:48 AM Petr Lautrbach <plautrba@redhat.com> wrote:
>
> semanage_module_enable() and semanage_module_disable() were deprecated
> by commit 9fbc6d14418f ("libsemanage: add back original module
> enable/disable functions for ABI compatability") in 2014 in order to
> preserve ABI compatibility. As we the libsemanage ABI is changed by the
> previous commit, it makes sense to drop them completely.
>
> Signed-off-by: Petr Lautrbach <plautrba@redhat.com>

Acked-by: James Carter <jwcart2@gmail.com>

> ---
>  libsemanage/src/libsemanage.map |  2 --
>  libsemanage/src/modules.c       | 56 ---------------------------------
>  2 files changed, 58 deletions(-)
>
> diff --git a/libsemanage/src/libsemanage.map b/libsemanage/src/libsemanage.map
> index 4bec06aaae27..3ea7b60f97bb 100644
> --- a/libsemanage/src/libsemanage.map
> +++ b/libsemanage/src/libsemanage.map
> @@ -165,8 +165,6 @@ LIBSEMANAGE_1.0 {
>      semanage_is_connected;
>      semanage_is_managed;
>      semanage_mls_enabled;
> -    semanage_module_disable;
> -    semanage_module_enable;
>      semanage_module_get_name;
>      semanage_module_get_version;
>      semanage_module_info_datum_destroy;
> diff --git a/libsemanage/src/modules.c b/libsemanage/src/modules.c
> index 8b36801038df..b6dd456cac32 100644
> --- a/libsemanage/src/modules.c
> +++ b/libsemanage/src/modules.c
> @@ -734,62 +734,6 @@ int semanage_module_set_enabled(semanage_handle_t *sh,
>  }
>
>
> -/* This function exists only for ABI compatibility. It has been deprecated and
> - * should not be used. Instead, use semanage_module_set_enabled() */
> -int semanage_module_enable(semanage_handle_t *sh, char *module_name)
> -{
> -       int rc = -1;
> -       semanage_module_key_t *modkey = NULL;
> -
> -       rc = semanage_module_key_create(sh, &modkey);
> -       if (rc != 0)
> -               goto exit;
> -
> -       rc = semanage_module_key_set_name(sh, modkey, module_name);
> -       if (rc != 0)
> -               goto exit;
> -
> -       rc = semanage_module_set_enabled(sh, modkey, 1);
> -       if (rc != 0)
> -               goto exit;
> -
> -       rc = 0;
> -
> -exit:
> -       semanage_module_key_destroy(sh, modkey);
> -       free(modkey);
> -
> -       return rc;
> -}
> -
> -/* This function exists only for ABI compatibility. It has been deprecated and
> - * should not be used. Instead, use semanage_module_set_enabled() */
> -int semanage_module_disable(semanage_handle_t *sh, char *module_name)
> -{
> -       int rc = -1;
> -       semanage_module_key_t *modkey = NULL;
> -
> -       rc = semanage_module_key_create(sh, &modkey);
> -       if (rc != 0)
> -               goto exit;
> -
> -       rc = semanage_module_key_set_name(sh, modkey, module_name);
> -       if (rc != 0)
> -               goto exit;
> -
> -       rc = semanage_module_set_enabled(sh, modkey, 0);
> -       if (rc != 0)
> -               goto exit;
> -
> -       rc = 0;
> -
> -exit:
> -       semanage_module_key_destroy(sh, modkey);
> -       free(modkey);
> -
> -       return rc;
> -}
> -
>  /* Converts a string to a priority
>   *
>   * returns -1 if str is not a valid priority.
> --
> 2.28.0
>
diff mbox series

Patch

diff --git a/libsemanage/src/libsemanage.map b/libsemanage/src/libsemanage.map
index 4bec06aaae27..3ea7b60f97bb 100644
--- a/libsemanage/src/libsemanage.map
+++ b/libsemanage/src/libsemanage.map
@@ -165,8 +165,6 @@  LIBSEMANAGE_1.0 {
     semanage_is_connected;
     semanage_is_managed;
     semanage_mls_enabled;
-    semanage_module_disable;
-    semanage_module_enable;
     semanage_module_get_name;
     semanage_module_get_version;
     semanage_module_info_datum_destroy;
diff --git a/libsemanage/src/modules.c b/libsemanage/src/modules.c
index 8b36801038df..b6dd456cac32 100644
--- a/libsemanage/src/modules.c
+++ b/libsemanage/src/modules.c
@@ -734,62 +734,6 @@  int semanage_module_set_enabled(semanage_handle_t *sh,
 }
 
 
-/* This function exists only for ABI compatibility. It has been deprecated and
- * should not be used. Instead, use semanage_module_set_enabled() */
-int semanage_module_enable(semanage_handle_t *sh, char *module_name)
-{
-	int rc = -1;
-	semanage_module_key_t *modkey = NULL;
-
-	rc = semanage_module_key_create(sh, &modkey);
-	if (rc != 0)
-		goto exit;
-
-	rc = semanage_module_key_set_name(sh, modkey, module_name);
-	if (rc != 0)
-		goto exit;
-
-	rc = semanage_module_set_enabled(sh, modkey, 1);
-	if (rc != 0)
-		goto exit;
-
-	rc = 0;
-
-exit:
-	semanage_module_key_destroy(sh, modkey);
-	free(modkey);
-
-	return rc;
-}
-
-/* This function exists only for ABI compatibility. It has been deprecated and
- * should not be used. Instead, use semanage_module_set_enabled() */
-int semanage_module_disable(semanage_handle_t *sh, char *module_name)
-{
-	int rc = -1;
-	semanage_module_key_t *modkey = NULL;
-
-	rc = semanage_module_key_create(sh, &modkey);
-	if (rc != 0)
-		goto exit;
-
-	rc = semanage_module_key_set_name(sh, modkey, module_name);
-	if (rc != 0)
-		goto exit;
-
-	rc = semanage_module_set_enabled(sh, modkey, 0);
-	if (rc != 0)
-		goto exit;
-
-	rc = 0;
-
-exit:
-	semanage_module_key_destroy(sh, modkey);
-	free(modkey);
-
-	return rc;
-}
-
 /* Converts a string to a priority
  *
  * returns -1 if str is not a valid priority.