aa-mergeprof failure if merging profile that doesn't exist in target directory

Bug #1398197 reported by Christian Boltz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
AppArmor
New
Undecided
Unassigned

Bug Description

# head */*
==> new/bin.true <==
# Last Modified: Mon Dec 1 23:21:00 2014
/bin/true {
  /bin/true r,

}

==> old/bin.false <==
/bin/false {
  /bin/false r,
}

# cd new
# aa-mergeprof -d . ../old/bin.false

Merging profile for /bin/false

Profile: /bin/false
Path: /bin/false
Mode: r
Severity: unknown

 [1 - /bin/false]
[(A)llow] / (D)eny / (I)gnore / (G)lob / Glob with (E)xtension / (N)ew / Abo(r)t / (F)inish / (M)ore
Adding /bin/false r to profile

= Changed Local Profiles =

The following local profiles were changed. Would you like to save them?

 [1 - /bin/false]
(S)ave Changes / [(V)iew Changes] / Abo(r)t / (I)gnore

Now we have even two ways to fail:

a) (S)ave Changes will write an empty bin.false file

b) (V)iew Changes will crash with an obvious reason:

Traceback (most recent call last):
  File "/home/cb/apparmor/HEAD-clean/utils/aa-mergeprof", line 795, in <module>
    main()
  File "/home/cb/apparmor/HEAD-clean/utils/aa-mergeprof", line 113, in main
    act([user_file, base_file, None], 2, profile_name)
  File "/home/cb/apparmor/HEAD-clean/utils/aa-mergeprof", line 157, in act
    apparmor.aa.display_changes_with_comments(mergeprofiles.user.filename, newprofile)
  File "/home/cb/apparmor/HEAD-clean/utils/apparmor/aa.py", line 2437, in display_changes_with_comments
    raise AppArmorException(_("Can't find existing profile %s to compare changes.") % oldprofile)
apparmor.common.AppArmorException: "Can't find existing profile /home/cb/apparmor/HEAD-clean/profiles/server-profile/logprof-crash-logger/new/bin.false to compare changes."

Tags: aa-tools
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.