summaryrefslogtreecommitdiffstats
path: root/abs/core/shadow/shadow.install
blob: 83d9ab7d31777ea804740f94683b804fca709d58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
setcaps() {
  _setcap() {
    if filecap "$1" "$2"; then
      chmod -s "$1"
    fi
  }

  # shadow ships these as setuid, but if we can apply file caps, use those instead.
  # 'filecap' insists on absolute paths
  _setcap /usr/bin/newuidmap setuid
  _setcap /usr/bin/newgidmap setgid
}

post_install() {
  setcaps
}

post_upgrade() {
  setcaps
}

# vim:set ts=2 sw=2 et: