[apparmor] [patch] apparmor-utils: Allow repository to be completely disabled (apparmor-remove-repo)

Steve Beattie steve at nxnw.org
Tue Aug 16 21:48:13 UTC 2011


On Tue, Aug 09, 2011 at 12:17:59AM +0200, Christian Boltz wrote:
> Hello,
> 
> the following openSUSE patch disables the profile repository (can be
> re-enabled with a config option).
> 
> 
> From: Jeff Mahoney <jeffm at suse.com>                                                                                                                                             
> Subject: apparmor-utils: Allow repository to be completely disabled
> 
>  This patch allows the repository to be completely disabled. It's been
>  subject to massive bitrot and isn't really maintained.
> 
>  It will only confuse the user if they are asked for repository information
>  and it doesn't work.
> 
> Signed-off-by: Jeff Mahoney <jeffm at suse.com>

This has already been disabled in 2.6 and trunk for a while now (rev
1606). That said, I like this approach a little better than the one
that's in our source. But I don't think it's a big enough difference
to warrant changing it.

> From: Jeff Mahoney <jeffm at suse.com>
> Subject: apparmor-utils: Allow repository to be completely disabled
> 
>  This patch allows the repository to be completely disabled. It's been
>  subject to massive bitrot and isn't really maintained.
> 
>  It will only confuse the user if they are asked for repository information
>  and it doesn't work.
> 
> Signed-off-by: Jeff Mahoney <jeffm at suse.com>
> ---
>  utils/Immunix/AppArmor.pm |    5 +++++
>  utils/logprof.conf        |    4 ++++
>  2 files changed, 9 insertions(+)
> 
> --- a/utils/Immunix/AppArmor.pm
> +++ b/utils/Immunix/AppArmor.pm
> @@ -3153,6 +3153,8 @@ sub UI_repo_signup() {
>  sub UI_ask_to_enable_repo() {
>  
>      my $q = { };
> +    return if (defined $cfg->{settings}{allow_repository} &&
> +		       $cfg->{settings}{allow_repository} eq "no");
>      return if ( not defined $cfg->{repository}{url} );
>      $q->{headers} = [
>        gettext("Repository"), $cfg->{repository}{url},
> @@ -3277,6 +3279,8 @@ sub get_preferred_user ($) {
>  
>  sub repo_is_enabled () {
>      my $enabled;
> +    return 0 if defined($cfg->{settings}{allow_repository}) &&
> +		        $cfg->{settings}{allow_repository} eq "no";
>      if ($cfg->{repository}{url} &&
>          $repo_cfg &&
>          $repo_cfg->{repository}{enabled} &&
> @@ -3290,6 +3294,7 @@ sub repo_is_enabled () {
>  sub update_repo_profile($) {
>      my $profile = shift;
>  
> +    return undef if not repo_is_enabled();
>      return undef if ( not is_repo_profile($profile) );
>      my $distro = $cfg->{repository}{distro};
>      my $url    = $profile->{repo}{url};
> --- a/utils/logprof.conf
> +++ b/utils/logprof.conf
> @@ -34,6 +34,10 @@
>    # files.
>    custom_includes =
>  
> +  # whether to prompt to enable repositories (values: yes/no)
> +  # This feature has fallen to bitrot and should not be used.
> +  allow_repository = no
> +
>  
>  [repository]
>    distro         = ubuntu-intrepid

> -- 
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor


-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20110816/2fde7600/attachment.pgp>


More information about the AppArmor mailing list