File: id

package info (click to toggle)
fakeroot 1.37.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,912 kB
  • sloc: sh: 5,437; ansic: 5,346; makefile: 199; perl: 14
file content (18 lines) | stat: -rw-r--r-- 269 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

real_id=$(id -u)
fake_id=$(fakeroot id -u)

case "${real_id}:${fake_id}" in
  (0:0)
  echo >&2 "test run under root: failure"
  exit 1
  ;;
  (*:0)
  echo "id: OK"
  ;;
  (*)
  echo >&2 "unexpected result (${real_id}:${fake_id}): failure"
  exit 2
  ;;
esac