Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • apparmor apparmor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 139
    • Issues 139
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 30
    • Merge requests 30
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • AppArmorAppArmor
  • apparmorapparmor
  • Merge requests
  • !809

Add support for reading s390x and aarch64 wtmp file

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Christian Boltz requested to merge cboltz/apparmor:cboltz-aa-notify-multiarch into master Oct 24, 2021
  • Overview 1
  • Commits 6
  • Pipelines 3
  • Changes 12

Both aarch64 and s390x have a bigger wtmp record size (16 bytes more than x86_64, 400 bytes total).

The byte position of the timestamp is also different on each architecture. To make things even more interesting, s390x is big endian.

Note that this MR includes more things, like

  • moving get_last_login_timestamp() to the new apparmor/notify.py file
  • add unit tests for it
  • add wtmp example files from various architectures, including a hand-edited one claiming to be from 1999
  • fixing a bug in get_last_login_timestamp() that unpacked type from too many bytes - which accidently worked on x86_64
  • detecting from which architecture the wtmp file comes (luckily the timestamps are located at different locations)

See the individual commits for details.

Fixes: https://bugzilla.opensuse.org/show_bug.cgi?id=1181155

I propose this patch for 3.0 and master.

(2.13 and older have the old perl-based aa-notify, which makes backporting this patch a bit ;-) harder.)

Edited Oct 24, 2021 by Christian Boltz
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: cboltz-aa-notify-multiarch