Hello community, here is the log from the commit of package yast2-apparmor for openSUSE:Factory checked in at 2017-04-12 17:09:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-apparmor (Old) and /work/SRC/openSUSE:Factory/.yast2-apparmor.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-apparmor" Wed Apr 12 17:09:37 2017 rev:59 rq:485764 version:3.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-apparmor/yast2-apparmor.changes 2014-12-05 21:02:42.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-apparmor.new/yast2-apparmor.changes 2017-04-12 17:09:40.582808377 +0200 @@ -1,0 +2,14 @@ +Wed Apr 5 07:03:30 UTC 2017 - [email protected] + +- bnc#1026027 + - removed package dependency on insserv +- 3.2.0 + +------------------------------------------------------------------- +Mon Apr 3 14:06:20 UTC 2017 - [email protected] + +- Use Yast::Service to enable/disable service +- Remove (unused) notify settings +- Reload profiles by calling apparmor_parser directly. + +------------------------------------------------------------------- Old: ---- yast2-apparmor-3.1.3.tar.bz2 New: ---- yast2-apparmor-3.2.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-apparmor.spec ++++++ --- /var/tmp/diff_new_pack.KM8wIX/_old 2017-04-12 17:09:41.594665137 +0200 +++ /var/tmp/diff_new_pack.KM8wIX/_new 2017-04-12 17:09:41.594665137 +0200 @@ -1,7 +1,7 @@ # # spec file for package yast2-apparmor # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: yast2-apparmor -Version: 3.1.3 +Version: 3.2.0 Release: 0 Summary: YaST2 - Plugins for AppArmor Profile Management License: GPL-2.0 @@ -34,12 +34,12 @@ Requires: perl(Encode) Requires: perl(Getopt::Long) Requires: perl(Immunix::AppArmor) -Requires: perl(Immunix::Notify) Requires: perl(Locale::gettext) Requires: perl(POSIX) Requires: perl(ycp) Obsoletes: yast2-subdomain Provides: yast2-subdomain + BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch %if 0%{?suse_version} >= 1140 @@ -73,8 +73,6 @@ %{yast_moduledir} %{yast_desktopdir} %{yast_agentdir} -%dir %{perl_vendorlib}/Immunix -%{perl_vendorlib}/Immunix/Notify.pm %dir %{_sysconfdir}/apparmor %config(noreplace) %{_sysconfdir}/apparmor/reports.crontab %config(noreplace) %{_sysconfdir}/apparmor/reports.conf ++++++ yast2-apparmor-3.1.3.tar.bz2 -> yast2-apparmor-3.2.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-apparmor-3.1.3/.travis.yml new/yast2-apparmor-3.2.0/.travis.yml --- old/yast2-apparmor-3.1.3/.travis.yml 2014-12-04 10:51:39.678753635 +0100 +++ new/yast2-apparmor-3.2.0/.travis.yml 2017-04-05 10:21:30.785108603 +0200 @@ -1,16 +1,11 @@ -language: cpp -compiler: - - gcc +sudo: required +language: bash +services: + - docker + before_install: - # disable rvm, use system Ruby - - rvm reset - - wget https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/travis_setup.sh - - sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2" -g "yast-rake gettext" + - docker build -t yast-apparmor-image . script: - - rake check:syntax - - rake check:pot - - make -f Makefile.cvs - - make - - sudo make install - - make check - + # the "yast-travis-ruby" script is included in the base yastdevel/ruby image + # see https://github.com/yast/docker-yast-ruby/blob/master/yast-travis-ruby + - docker run -it -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" yast-apparmor-image yast-travis-ruby diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-apparmor-3.1.3/CONTRIBUTING.md new/yast2-apparmor-3.2.0/CONTRIBUTING.md --- old/yast2-apparmor-3.1.3/CONTRIBUTING.md 2014-12-04 10:51:39.678753635 +0100 +++ new/yast2-apparmor-3.2.0/CONTRIBUTING.md 2017-04-05 10:21:30.785108603 +0200 @@ -3,7 +3,7 @@ YaST is an open source project and as such it welcomes all kinds of contributions. If you decide to contribute, please follow these guidelines to -ensure the process is effective and pleasant both for you and YaST maintainers. +ensure the process is effective and pleasant both for you and the YaST maintainers. There are two main forms of contribution: reporting bugs and performing code changes. @@ -12,18 +12,16 @@ ----------- If you find a problem, please report it either using -[Bugzilla](https://bugzilla.novell.com/enter_bug.cgi?format=guided&product=openSUSE+Factory&component=YaST2) +[Bugzilla](https://bugzilla.suse.com/enter_bug.cgi?format=guided&product=openSUSE+Factory&component=YaST2) or [GitHub issues](../../issues). (For Bugzilla, use the [simplified registration](https://secure-www.novell.com/selfreg/jsp/createSimpleAccount.jsp) if you don't have an account yet.) -If you find a problem, please report it either using -[Bugzilla](https://bugzilla.novell.com/) or GitHub issues. We can't guarantee -that every bug will be fixed, but we'll try. - When creating a bug report, please follow our [bug reporting guidelines](http://en.opensuse.org/openSUSE:Report_a_YaST_bug). +We can't guarantee that every bug will be fixed, but we'll try. + Code Changes ------------ @@ -44,15 +42,22 @@ to the [Ruby style guide](https://github.com/SUSE/style-guides/blob/master/Ruby.md). - 4. Make sure your change didn't break anything by building the RPM package + 4. Update the package version (in `packages/*.spec`, usually by + `rake version:bump`) and add a new entry to the `package/*.changes` file + (by `osc vc package`). + For bigger changes or changes which need longer discussion it is advised to + add this as a separate last commit so it can be easily updated when another + change is merged in the meantime. + + 5. Make sure your change didn't break anything by building the RPM package (`rake osc:build`). The build process includes running the full testsuite. - 5. Publish the branch and create a pull request. + 6. Publish the branch and create a pull request. - 6. YaST developers will review your change and possibly point out issues. + 7. YaST developers will review your change and possibly point out issues. Adapt the code under their guidance until they are all resolved. - 7. Finally, the pull request will get merged or rejected. + 8. Finally, the pull request will get merged or rejected. See also [GitHub's guide on contributing](https://help.github.com/articles/fork-a-repo). @@ -60,9 +65,6 @@ If you want to do multiple unrelated changes, use separate branches and pull requests. -Do not change the `VERSION` and `*.changes` files as this could lead to -conflicts. - ### Commits Each commit in the pull request should do only one thing, which is clearly @@ -71,7 +73,7 @@ [widely used conventions](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). -If your commit is related to a bug in Buzgilla or an issue on GitHub, make sure +If your commit is related to a bug in Bugzilla or an issue on GitHub, make sure you mention it in the commit message for cross-reference. Use format like bnc#775814 or gh#yast/yast-foo#42. See also [GitHub autolinking](https://help.github.com/articles/github-flavored-markdown#references) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-apparmor-3.1.3/Dockerfile new/yast2-apparmor-3.2.0/Dockerfile --- old/yast2-apparmor-3.1.3/Dockerfile 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-apparmor-3.2.0/Dockerfile 2017-04-05 10:21:30.785108603 +0200 @@ -0,0 +1,3 @@ +FROM yastdevel/ruby +COPY . /usr/src/app + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-apparmor-3.1.3/package/yast2-apparmor.changes new/yast2-apparmor-3.2.0/package/yast2-apparmor.changes --- old/yast2-apparmor-3.1.3/package/yast2-apparmor.changes 2014-12-04 10:51:39.702753635 +0100 +++ new/yast2-apparmor-3.2.0/package/yast2-apparmor.changes 2017-04-05 10:21:30.785108603 +0200 @@ -1,4 +1,18 @@ ------------------------------------------------------------------- +Wed Apr 5 07:03:30 UTC 2017 - [email protected] + +- bnc#1026027 + - removed package dependency on insserv +- 3.2.0 + +------------------------------------------------------------------- +Mon Apr 3 14:06:20 UTC 2017 - [email protected] + +- Use Yast::Service to enable/disable service +- Remove (unused) notify settings +- Reload profiles by calling apparmor_parser directly. + +------------------------------------------------------------------- Thu Dec 4 09:49:13 UTC 2014 - [email protected] - remove X-KDE-Library from desktop file (bnc#899104) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-apparmor-3.1.3/package/yast2-apparmor.spec new/yast2-apparmor-3.2.0/package/yast2-apparmor.spec --- old/yast2-apparmor-3.1.3/package/yast2-apparmor.spec 2014-12-04 10:51:39.706753635 +0100 +++ new/yast2-apparmor-3.2.0/package/yast2-apparmor.spec 2017-04-05 10:21:30.789108603 +0200 @@ -17,7 +17,7 @@ Name: yast2-apparmor -Version: 3.1.3 +Version: 3.2.0 Release: 0 Summary: YaST2 - Plugins for AppArmor Profile Management Url: https://github.com/yast/yast-apparmor @@ -31,7 +31,6 @@ Requires: perl(Encode) Requires: perl(Getopt::Long) Requires: perl(Immunix::AppArmor) -Requires: perl(Immunix::Notify) Requires: perl(Locale::gettext) Requires: perl(POSIX) Requires: perl(ycp) @@ -40,6 +39,7 @@ Requires: yast2-ruby-bindings >= 1.0.0 Obsoletes: yast2-subdomain Provides: yast2-subdomain + BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch %if 0%{?suse_version} >= 1140 @@ -74,8 +74,6 @@ %{yast_moduledir} %{yast_desktopdir} %{yast_agentdir} -%dir %{perl_vendorlib}/Immunix -%{perl_vendorlib}/Immunix/Notify.pm %dir %{_sysconfdir}/apparmor %config(noreplace) %{_sysconfdir}/apparmor/reports.crontab %config(noreplace) %{_sysconfdir}/apparmor/reports.conf diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-apparmor-3.1.3/perl-lib/Makefile.am new/yast2-apparmor-3.2.0/perl-lib/Makefile.am --- old/yast2-apparmor-3.1.3/perl-lib/Makefile.am 2014-12-04 10:51:39.706753635 +0100 +++ new/yast2-apparmor-3.2.0/perl-lib/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +0,0 @@ -perl_DATA = \ - Notify.pm - -perldir = $(PERL_VENDORLIB)/Immunix - -EXTRA_DIST = $(perl_DATA) - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-apparmor-3.1.3/perl-lib/Notify.pm new/yast2-apparmor-3.2.0/perl-lib/Notify.pm --- old/yast2-apparmor-3.1.3/perl-lib/Notify.pm 2014-12-04 10:51:39.706753635 +0100 +++ new/yast2-apparmor-3.2.0/perl-lib/Notify.pm 1970-01-01 01:00:00.000000000 +0100 @@ -1,264 +0,0 @@ -# ------------------------------------------------------------------ -# -# Copyright (C) 2005-2006 Novell/SUSE -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of version 2 of the GNU General Public -# License published by the Free Software Foundation. -# -# ------------------------------------------------------------------ - -package Immunix::Notify; - -################################################################################ -# /usr/lib/perl5/vendor_perl/Immunix/Notify.pm -# -# - Parses /etc/apparmor/notify.cfg for AppArmor notification -# - Used with aa-config.ycp for yast configuration -# -################################################################################ - -use strict; -use ycp; -use POSIX; -use Locale::gettext; - -setlocale(LC_MESSAGES, ""); -textdomain("yast2-apparmor"); - -use constant NTCONF => '/etc/apparmor/notify.cfg'; - -sub debug { - my $cf = shift; - - for my $type ( keys %$cf) { - ycp::y2milestone("[apparmor] Type: $type"); - for my $rec ( keys %{$cf->{ $type }} ) { - ycp::y2milestone("[apparmor]\t$rec value: $cf->{$type}{$rec}"); - } - } -} - - -# Replaces old files with new files -sub updateFiles { - - my ( $oldFile, $newFile ) = @_; - - if ( unlink("$oldFile") ) { - if ( ! rename ("$newFile", "$oldFile") ) { - if ( ! system('/bin/mv', "$newFile","$oldFile") ) { - ycp::y2error(sprintf(gettext("Failed copying %s."), $oldFile)); - return 1; - } - } - } else { - system('/bin/rm', "$oldFile"); - system('/bin/mv', "$newFile", "$oldFile"); - } - - return 0; -} - -sub safeFormat { - - my $emailAddr = shift; - my $safeFormat = 0; - - if ( $emailAddr && (length($emailAddr) < 129) ) { - #if ( $emailAddr =~ /^\w+[\.\w]+\@[\w+\.]+\w+$/ || - if ( $emailAddr =~ /^([\w\+-]+\.?)*[\w\+-]+\@(\w+\.?)*\w+$/ || - $emailAddr =~ /^\/var\/mail\/\w+$/ ) { - $safeFormat = 1; - } else { - ycp::y2milestone("[apparmor] email address contains invalid - characters."); - } - - } else { - ycp::y2milestone("[apparmor] email address is too long--more than - 128 characters."); - } - - return $safeFormat; -} - -# check for reasonable values (especially email address) -sub sanitize { - - my $newConfig = shift; - my $oldConfig = getNotifySettings(); - my $result = "success"; - - if ( $newConfig->{'set_notify'}) { - delete($newConfig->{'set_notify'}); # don't need this anymore - } - - # Sanitize, reverting to current values if poorly formed email address - for my $type (keys(%$newConfig)) { - - my $enable = "enable_" . "$type"; - my $email = "$type" . "_email"; - - next unless ($newConfig->{$type}->{$enable} eq 'yes'); - - if ( $newConfig->{$type}->{$enable} eq "yes" && ! - safeFormat($newConfig->{$type}->{$email}) ) { - $result = "Error in email address format. Skipping changes - for $type notification."; - ycp::y2milestone("[apparmor] $result"); - $newConfig->{$type} = $oldConfig->{$type}; - } - } - - return ($newConfig, $result); -} - -sub getNotifyStatus { - - my $config = getNotifySettings(); - - my $noteStatus = "disabled"; - - if ( $config->{terse}->{terse_freq} && $config->{terse}->{terse_freq} != 0) { - $noteStatus = "enabled"; - } elsif ( $config->{summary}->{summary_freq} && - $config->{summary}->{summary_freq} != 0) { - $noteStatus = "enabled"; - } elsif ( $config->{verbose}->{verbose_freq} && - $config->{verbose}->{verbose_freq} != 0) { - $noteStatus = "enabled"; - } - - return $noteStatus; -} - -sub delBadEntries { - - my $config = shift; - my @delList = (); - - # Remove bad entries pulled from config file - for my $type (keys(%$config)) { - if ( $type !~ /(summary|terse|verbose)/ ) { - push(@delList, $type); - next; - } else { - - my $freq = $type . "_freq"; - my $email = $type . "_email"; - my $level = $type . "_level"; - my $unk = $type . "_unknown"; - no strict; - - if ( ! $config->{$type}->{$email} ) { - push(@delList, $type); - next; - } - - for my $val ( keys %{$config->{ $type }} ) { - if ( $val eq $freq ) { - if ( $config->{$type}->{$val} !~ /\d+/ ) { - $config->{$type}->{$val} = 0; - } - } elsif ( $val eq $email ) { - if ( ! safeFormat($config->{$type}->{$val}) ) { - push(@delList, $type); - next; - } - } elsif ( $val eq $level ) { - if ( ($config->{$type}->{$val} =~ /\d\d/ && - $config->{$type}->{$val} > 10) ) { - $config->{$type}->{$val} = 0; - } - } elsif ( $val eq $unk ) { - $config->{$type}->{$val} =~ /[0|1]/ || 0; - } - } - } - } - - # Delete entire record if bad email address - for (@delList) { - delete($config->{$_}); - } - - return $config; -} - -sub getNotifySettings { - - my $config = (); - my $cleanConfig = (); - my $ntConf = NTCONF; - - if ( open(CFG, "<$ntConf") ) { - while(<CFG>) { - chomp; - $config->{$2}{$1} = $4 if /^((\S+)_(\S+))\s+(.+)\s*$/; - } - close(CFG); - - # delete notification entries without a reasonable email address - $cleanConfig = delBadEntries($config); - - } else { - ycp::y2milestone("[apparmor] Couldn't open $ntConf."); - } - - return $cleanConfig; -} - -sub setNotifySettings { - - my $config = shift; - my $result = "success"; - my $ntConf = NTCONF; - - # not enabling aaeventd here as it gets enabled as part of global apparmor switch - if ( open(CFG, "> $ntConf") ) { - if($config->{terse}->{enable_terse} eq "yes") { - # if we didn't get passed a valid frequency, default to off - $config->{terse}->{terse_freq} ||= 0; - $config->{terse}->{terse_level} ||= 0; - # default to including unknown events if we didn't get passed that setting - $config->{terse}->{terse_unknown} = 1 unless defined $config->{terse}->{terse_unknown}; - print CFG "terse_freq $config->{terse}->{terse_freq}\n"; - print CFG "terse_email $config->{terse}->{terse_email}\n"; - print CFG "terse_level $config->{terse}->{terse_level}\n"; - print CFG "terse_unknown $config->{terse}->{terse_unknown}\n"; - } - if($config->{summary}->{enable_summary} eq "yes") { - # if we didn't get passed a valid frequency, default to off - $config->{summary}->{summary_freq} ||= 0; - $config->{summary}->{summary_level} ||= 0; - # default to including unknown events if we didn't get passed that setting - $config->{summary}->{summary_unknown} = 1 unless defined $config->{summary}->{summary_unknown}; - print CFG "summary_freq $config->{summary}->{summary_freq}\n"; - print CFG "summary_email $config->{summary}->{summary_email}\n"; - print CFG "summary_level $config->{summary}->{summary_level}\n"; - print CFG "summary_unknown $config->{summary}->{summary_unknown}\n"; - } - if($config->{verbose}->{enable_verbose} eq "yes") { - # if we didn't get passed a valid frequency, default to off - $config->{verbose}->{verbose_freq} ||= 0; - $config->{verbose}->{verbose_level} ||= 0; - # default to including unknown events if we didn't get passed that setting - $config->{verbose}->{verbose_unknown} = 1 unless defined $config->{verbose}->{verbose_unknown}; - print CFG "verbose_freq $config->{verbose}->{verbose_freq}\n"; - print CFG "verbose_email $config->{verbose}->{verbose_email}\n"; - print CFG "verbose_level $config->{verbose}->{verbose_level}\n"; - print CFG "verbose_unknown $config->{verbose}->{verbose_unknown}\n"; - } - close(CFG); - } else { - $result = "Unable to write config changes to $ntConf"; - ycp::y2milestone("[apparmor] $result: $!"); - } - - return($result); -} - - -1; - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-apparmor-3.1.3/src/include/apparmor/aa-config.rb new/yast2-apparmor-3.2.0/src/include/apparmor/aa-config.rb --- old/yast2-apparmor-3.1.3/src/include/apparmor/aa-config.rb 2014-12-04 10:51:39.706753635 +0100 +++ new/yast2-apparmor-3.2.0/src/include/apparmor/aa-config.rb 2017-04-05 10:21:30.789108603 +0200 @@ -33,408 +33,28 @@ Yast.import "Label" Yast.import "Popup" Yast.import "Wizard" + Yast.import "Service" end def changeAppArmorState(aaEnabled) - error = nil - aaAction = "" - + success = true if aaEnabled == true - aaAction = "apparmor:enable" + success = Yast::Service.start("apparmor") && Yast::Service.enable("apparmor") else - aaAction = "apparmor:disable" + success = Yast::Service.stop("apparmor") && Yast::Service.disable("apparmor") end - error = SCR.Execute(path(".aaconf"), aaAction) - - if error != nil && Ops.is_string?(error) - errorMsg = Convert.to_string(error) - popError = _( - "This operation generated the following error. Check your installation and AppArmor profile settings." - ) - Popup.Message(Ops.add(Ops.add(Ops.add(popError, "\n["), errorMsg), "]")) + if !success + Yast::Report.Error(_('Failed to change apparmor service. Please use journal (journalctl -n -u apparmor) to diagnose')) aaEnabled = !aaEnabled end aaEnabled end - def displayNotifyForm - settings = Convert.to_map( - SCR.Execute(path(".apparmor"), "aa-notify-settings") - ) - - terse = Ops.get_map(settings, "terse", {}) - summary = Ops.get_map(settings, "summary", {}) - verbose = Ops.get_map(settings, "verbose", {}) - - t_freq = Ops.get_integer(terse, "terse_freq", 0) - s_freq = Ops.get_integer(summary, "summary_freq", 0) - v_freq = Ops.get_integer(verbose, "verbose_freq", 0) - - t_unknown = true - a_t_poop = Ops.get_string(terse, "terse_unknown", "1") - t_poop = Builtins.tostring(a_t_poop) - t_unknown = false if t_poop == "0" - - s_unknown = true - a_s_poop = Ops.get_string(terse, "summary_unknown", "1") - s_poop = Builtins.tostring(a_s_poop) - s_unknown = false if s_poop == "0" - - v_unknown = true - a_v_poop = Ops.get_string(verbose, "verbose_unknown", "1") - v_poop = Builtins.tostring(a_v_poop) - v_unknown = false if v_poop == "0" - - terse_items = [ - Item(Id(0), _("Disabled"), t_freq == 0 ? true : false), - Item(Id(60), _("1 minute"), t_freq == 60 ? true : false), - Item(Id(300), _("5 minutes"), t_freq == 300 ? true : false), - Item(Id(600), _("10 minutes"), t_freq == 600 ? true : false), - Item(Id(900), _("15 minutes"), t_freq == 900 ? true : false), - Item(Id(1800), _("30 minutes"), t_freq == 1800 ? true : false), - Item(Id(3600), _("1 hour"), t_freq == 3600 ? true : false), - Item(Id(86400), _("1 day"), t_freq == 86400 ? true : false), - Item(Id(604800), _("1 week"), t_freq == 604800 ? true : false) - ] - - summary_items = [ - Item(Id(0), _("Disabled"), s_freq == 0 ? true : false), - Item(Id(60), _("1 minute"), s_freq == 60 ? true : false), - Item(Id(300), _("5 minutes"), s_freq == 300 ? true : false), - Item(Id(600), _("10 minutes"), s_freq == 600 ? true : false), - Item(Id(900), _("15 minutes"), s_freq == 900 ? true : false), - Item(Id(1800), _("30 minutes"), s_freq == 1800 ? true : false), - Item(Id(3600), _("1 hour"), s_freq == 3600 ? true : false), - Item(Id(86400), _("1 day"), s_freq == 86400 ? true : false), - Item(Id(604800), _("1 week"), s_freq == 604800 ? true : false) - ] - - verbose_items = [ - Item(Id(0), _("Disabled"), v_freq == 0 ? true : false), - Item(Id(60), _("1 minute"), v_freq == 60 ? true : false), - Item(Id(300), _("5 minutes"), v_freq == 300 ? true : false), - Item(Id(600), _("10 minutes"), v_freq == 600 ? true : false), - Item(Id(900), _("15 minutes"), v_freq == 900 ? true : false), - Item(Id(1800), _("30 minutes"), v_freq == 1800 ? true : false), - Item(Id(3600), _("1 hour"), v_freq == 3600 ? true : false), - Item(Id(86400), _("1 day"), v_freq == 86400 ? true : false), - Item(Id(604800), _("1 week"), v_freq == 604800 ? true : false) - ] - - - event_config = HVCenter( - VBox( - Opt(:vstretch), - Frame( - _("Security Event Notification"), - HBox( - HSpacing(1), - VBox( - Opt(:vstretch), - VSpacing(1), - Frame( - _("Terse Notification"), - VBox( - Opt(:vstretch), - HBox( - ComboBox(Id(:terse_freq), _("Frequency"), terse_items), - TextEntry( - Id(:terse_email), - _("Email Address"), - Ops.get_string(terse, "terse_email", "") - ), - IntField( - Id(:terse_level), - _("Severity"), - 0, - 10, - Ops.get_integer(terse, "terse_level", 0) - ) - ), - HBox( - CheckBox( - Id(:terse_unknown), - _("Include Unknown Severity Events"), - t_unknown - ) - ) - ) - ), - VSpacing(1), - Frame( - _("Summary Notification"), - VBox( - Opt(:vstretch), - HBox( - ComboBox(Id(:summary_freq), _("Frequency"), summary_items), - TextEntry( - Id(:summary_email), - _("Email Address"), - Ops.get_string(summary, "summary_email", "") - ), - IntField( - Id(:summary_level), - _("Severity"), - 0, - 10, - Ops.get_integer(summary, "summary_level", 0) - ) - ), - HBox( - CheckBox( - Id(:summary_unknown), - _("Include Unknown Severity Events"), - s_unknown - ) - ) - ) - ), - VSpacing(1), - Frame( - _("Verbose Notification"), - VBox( - Opt(:vstretch), - HBox( - ComboBox(Id(:verbose_freq), _("Frequency"), verbose_items), - TextEntry( - Id(:verbose_email), - _("Email Address"), - Ops.get_string(verbose, "verbose_email", "") - ), - IntField( - Id(:verbose_level), - _("Severity"), - 0, - 10, - Ops.get_integer(verbose, "verbose_level", 0) - ) - ), - HBox( - CheckBox( - Id(:verbose_unknown), - _("Include Unknown Severity Events"), - v_unknown - ) - ) - ) - ), - VSpacing(1) - ), - HSpacing(1) - ) - ) - ) - ) - - Wizard.CreateDialog - Wizard.SetContentsButtons( - _("Security Event Notification"), - event_config, - Ops.get_string(@helps, "EventNotifyHelpText", ""), - Label.BackButton, - Label.OKButton - ) - Wizard.DisableBackButton - - ntInput = nil - notifyLabelValue = "" - - while true - ntInput = UI.UserInput - - if ntInput == :next - answers = {} - set_notify = {} - summary2 = {} - verbose2 = {} - terse2 = {} - - t_freq = UI.QueryWidget(Id(:terse_freq), :Value) - s_freq = UI.QueryWidget(Id(:summary_freq), :Value) - v_freq = UI.QueryWidget(Id(:verbose_freq), :Value) - - Ops.set(set_notify, "aa-set-notify", "yes") - Ops.set(terse2, "terse_freq", Builtins.tostring(t_freq)) - Ops.set(summary2, "summary_freq", Builtins.tostring(s_freq)) - Ops.set(verbose2, "verbose_freq", Builtins.tostring(v_freq)) - - if t_freq != 0 - t_email = Convert.to_string( - UI.QueryWidget(Id(:terse_email), :Value) - ) - - if t_email == nil || t_email == "" - Popup.Error( - _( - "An email address is required for each selected notification method." - ) - ) - next - elsif !checkEmailAddress(t_email) - next - end - - Ops.set(terse2, "enable_terse", "yes") - Ops.set( - terse2, - "terse_email", - Convert.to_string(UI.QueryWidget(Id(:terse_email), :Value)) - ) - Ops.set( - terse2, - "terse_level", - Builtins.tostring(UI.QueryWidget(Id(:terse_level), :Value)) - ) - - t_unknown2 = Convert.to_boolean( - UI.QueryWidget(Id(:terse_unknown), :Value) - ) - - if t_unknown2 == true - Ops.set(terse2, "terse_unknown", "1") - else - Ops.set(terse2, "terse_unknown", "0") - end - else - Ops.set(terse2, "enable_terse", "no") - end - - if s_freq != 0 - s_email = Convert.to_string( - UI.QueryWidget(Id(:summary_email), :Value) - ) - if s_email == nil || s_email == "" - Popup.Error( - _( - "An email address is required for each selected notification method." - ) - ) - next - elsif !checkEmailAddress(s_email) - next - end - - Ops.set(summary2, "enable_summary", "yes") - Ops.set( - summary2, - "summary_email", - Convert.to_string(UI.QueryWidget(Id(:summary_email), :Value)) - ) - Ops.set( - summary2, - "summary_level", - Builtins.tostring(UI.QueryWidget(Id(:summary_level), :Value)) - ) - - s_unknown2 = Convert.to_boolean( - UI.QueryWidget(Id(:summary_unknown), :Value) - ) - - if s_unknown2 == true - Ops.set(summary2, "summary_unknown", "1") - else - Ops.set(summary2, "summary_unknown", "0") - end - else - Ops.set(summary2, "enable_summary", "no") - end - - if v_freq != 0 - v_email = Convert.to_string( - UI.QueryWidget(Id(:verbose_email), :Value) - ) - if v_email == nil || v_email == "" - Popup.Error( - _( - "An email address is required for each selected notification method." - ) - ) - next - elsif !checkEmailAddress(v_email) - next - end - - Ops.set(verbose2, "enable_verbose", "yes") - Ops.set( - verbose2, - "verbose_email", - Convert.to_string(UI.QueryWidget(Id(:verbose_email), :Value)) - ) - Ops.set( - verbose2, - "verbose_level", - Builtins.tostring(UI.QueryWidget(Id(:verbose_level), :Value)) - ) - - v_unknown2 = Convert.to_boolean( - UI.QueryWidget(Id(:verbose_unknown), :Value) - ) - - if v_unknown2 == true - Ops.set(verbose2, "verbose_unknown", "1") - else - Ops.set(verbose2, "verbose_unknown", "0") - end - else - Ops.set(verbose2, "enable_verbose", "no") - end - - Ops.set(answers, "set_notify", set_notify) - Ops.set(answers, "terse", terse2) - Ops.set(answers, "summary", summary2) - Ops.set(answers, "verbose", verbose2) - - result = Convert.to_string(SCR.Execute(path(".aaconf"), answers)) - - if result != "success" - Popup.Error( - Ops.add( - _("Configuration failed for the following operations: "), - result - ) - ) - end - - if t_freq != 0 || s_freq != 0 || v_freq != 0 - notifyLabelValue = _("Notification is enabled") - else - notifyLabelValue = _("Notification is disabled") - end - end - - Wizard.CloseDialog - if ntInput == :ok || ntInput == :next - UI.ChangeWidget(Id(:notifyLabel), :Value, notifyLabelValue) - end - break - end - - nil - end - def displayAppArmorConfig # AppArmor Status - aaEnabled = false - ntIsEnabled = false - apparmor = Convert.to_string(SCR.Execute(path(".apparmor"), "aa-status")) - aaEnStr = _("AppArmor is disabled") - - if apparmor == "enabled" - aaEnabled = true - aaEnStr = _("AppArmor is enabled") - end - - # Notification Status - evnotify = Convert.to_string(SCR.Execute(path(".apparmor"), "aa-notify")) - evEnStr = _("Notification is disabled") - if evnotify == "enabled" - ntIsEnabled = true - evEnStr = _("Notification is enabled") - elsif evnotify == "notinstalled" - evnotify = "disabled" - end + aaEnabled = Yast::Service.Enabled("apparmor") # Network dialog caption caption = _("AppArmor Configuration") @@ -471,16 +91,6 @@ HSpacing(Opt(:hstretch), 4), VBox( VSpacing(1), - # event notification disabled due to changes in AppArmor - # `Frame ( _("Security Event Notification"), - # `HBox( - # `VSpacing(1), `HSpacing(1), - # `HVCenter( `Label( `id(`notifyLabel), evEnStr )), - # `PushButton( `id(`ntconf), _("C&onfigure")), - # `VSpacing(1), `HSpacing(1) - # ) - # ), - # `VSpacing(1), `HSpacing(20), Frame( _("Configure Profile Modes"), HBox( @@ -538,8 +148,6 @@ if aaEnabled == requestedAaState UI.ChangeWidget(Id(:aaEnableFrame), :Enabled, aaEnabled) end - elsif ret == :ntconf - displayNotifyForm elsif ret == :modeconf profileModeConfigForm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-apparmor-3.1.3/src/include/apparmor/profile_dialogs.rb new/yast2-apparmor-3.2.0/src/include/apparmor/profile_dialogs.rb --- old/yast2-apparmor-3.1.3/src/include/apparmor/profile_dialogs.rb 2014-12-04 10:51:39.710753635 +0100 +++ new/yast2-apparmor-3.2.0/src/include/apparmor/profile_dialogs.rb 2017-04-05 10:21:30.789108603 +0200 @@ -1386,7 +1386,7 @@ "PROFILE_NAME" => pathname } result = SCR.Write(path(".apparmor_profiles"), argmap) - result2 = SCR.Write(path(".apparmor_profiles.reload"), "-") + result2 = SCR.Execute(path(".target.bash"), "/sbin/apparmor_parser -r /etc/apparmor.d") end else if !Builtins.haskey( @@ -1491,7 +1491,7 @@ ) Builtins.y2milestone(Ops.add("Deleted ", profilename)) result = SCR.Write(path(".apparmor_profiles.delete"), profilename) - result2 = SCR.Write(path(".apparmor_profiles.reload"), "-") + result2 = SCR.Execute(path(".target.bash"), "/sbin/apparmor_parser -r /etc/apparmor.d") end id = :reread break diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-apparmor-3.1.3/src/servers_non_y2/ag_aa_config new/yast2-apparmor-3.2.0/src/servers_non_y2/ag_aa_config --- old/yast2-apparmor-3.1.3/src/servers_non_y2/ag_aa_config 2014-12-04 10:51:39.710753635 +0100 +++ new/yast2-apparmor-3.2.0/src/servers_non_y2/ag_aa_config 2017-04-05 10:21:30.789108603 +0200 @@ -39,20 +39,8 @@ } } close(RUN); - if (-f "/etc/init.d/boot.apparmor") { - system("/sbin/insserv boot.apparmor"); - } else { - system("/sbin/insserv boot.apparmor"); - } - if (-f "/etc/init.d/aaeventd") { - system("/sbin/rcaaeventd start"); - system("/sbin/insserv aaeventd"); - } + system("systemctl enable boot.apparmor"); } else { - if (-f "/etc/init.d/aaeventd") { - system("/sbin/rcaaeventd stop"); - system("/sbin/insserv -r aaeventd"); - } if (-e "/sbin/rcapparmor") { open(RUN, "/sbin/rcapparmor stop 2>&1 |"); } else { @@ -64,11 +52,7 @@ } } close(RUN); - if (-f "/etc/init.d/boot.apparmor") { - system("/sbin/insserv -r boot.apparmor"); - } else { - system("/sbin/insserv -r boot.apparmor"); - } + system("systemctl disable boot.apparmor"); } return $errmsg; }
