Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing perl code #15

Closed
wants to merge 5 commits into from
Closed

Removing perl code #15

wants to merge 5 commits into from

Conversation

goldwynr
Copy link
Collaborator

The primary reason of this effort is to do away with deprecated apparmor code. Since yast was the major user of the code, we added JSON functionality in apparmor to communicate with yast-apparmor.

This is a precursor to use aa-status json profile view.

Please note, "Configure" option is left hanging which will be filled
in the next patch.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Handles the profiles using JSON output of aa-status. This replaces the earlier
way of handling profiles.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
else
Yast::Report.Error(_('Unknown Dialog %s returned by apparmor') % hm['dialog'])
nil
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just nitpick, but for really big case I prefer map for it like

DIALOG_MAPPING = {
  'yesno' => YesNoDialog,
  'yesnocancel' => YesNoCancelDialog,
  ...
}

and usage
dialog = hm['dialog']
dialog_class = DIALOG_MAPPING[dialog]
if dialog_class
  dialog_class.new(hm)
else
  Yast::Report.Error(_('Unknown Dialog %s returned by apparmor') % hm['dialog'])
  nil
end

f.puts r.to_json
f.flush
end
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for me this part looks quite similar to GenProf, maybe have common ancestor that share it?

Copy link
Member

@jreidinger jreidinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general it looks good, just few notes how code can be improved, but not required. so if you want to have it this way, just ping me and I will merge it.

@goldwynr
Copy link
Collaborator Author

Thanks for the comments. I will incorporate these changes.
Should we increment the yast-apparmor version as well? To perhaps 3.3 or even 4.0?

The apparmor_ui_dialog communicates with aa-logprof in JSON.
Each dialog is converted to a yast dialog for input
from the user and returns the actions performed in yast in the
form of JSON response.

An extra opendialog has been used to indicate the end of the logprof
execution.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Asks for filename of the program and run aa-genprof --json against
the program.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants