This file is indexed.

postinst is in freeradius-common 2.1.10+dfsg-3ubuntu0.12.04.2.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#! /bin/sh

set -e

update_fs_from_statoverride() {
  # I wish a simple dpkg-statoverride --update $file just did
  # the right thing, but it doesn't, so we have to do it manually.
  type=$1
  user=$2
  group=$3
  mode=$4
  file=$5
  if [ -n "$type" -a -n "$group" -a -n "$mode" -a -n "$file" ]; then
    if [ "$(find $file -maxdepth 0 -type $type -group $group -perm $mode)" = "" -a -$type $file ]; then
      chgrp $group $file
      chmod $mode $file
    fi
  fi
}

handle_config_files() {
  runmode=$1

  set +e
  so=$(dpkg-statoverride --list /etc/freeradius)
  ret=$?
  set -e
  case "$runmode" in
    initial)
      if [ $ret != 0 ]; then
        dpkg-statoverride --add --update freerad freerad 2751 /etc/freeradius
      fi
      ;;
    upgrade)
      update_fs_from_statoverride d $so
      ;;
  esac

  set +e
  so=$(dpkg-statoverride --list /etc/freeradius/radiusd.conf)
  ret=$?
  set -e
  case "$runmode" in
    initial)
      if [ $ret != 0 ]; then
        dpkg-statoverride --add --update root freerad 0640 /etc/freeradius/radiusd.conf 
      fi
      ;;
    upgrade)
      update_fs_from_statoverride f $so
      ;;
  esac

  # Relax permissions on local dictionary - allows radclient to run and should
  # not contain secrets.  At any rate, only do it on fresh install
  set +e
  so=$(dpkg-statoverride --list /etc/freeradius/dictionary)
  ret=$?
  set -e
  case "$runmode" in
    initial)
      if [ $ret != 0 ]; then
        dpkg-statoverride --add --update root freerad 0644 /etc/freeradius/dictionary
      fi
      ;;
    upgrade)
      update_fs_from_statoverride f $so
      ;;
  esac
}

case "$1" in
  configure)
        if [ -z "$2" ]; then
          # On a fresh install, add the necessary user and group
          adduser --quiet --system --no-create-home --home /etc/freeradius --group --disabled-password freerad

          # Put user freerad in group shadow, so the daemon can auth locally
          # Only do this on fresh install as the admin may not want freerad in shadow
          # group if authenticating by another mechanism
          adduser --quiet freerad shadow

          handle_config_files initial

        else
          handle_config_files upgrade
        fi
        ;;
esac



exit 0