File: config_modules_security_modules

package info (click to toggle)
net-snmp 5.9+dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 36,760 kB
  • sloc: ansic: 283,039; perl: 17,712; sh: 11,887; makefile: 2,705; xml: 663; python: 623; pascal: 62; sql: 47
file content (70 lines) | stat: -rw-r--r-- 2,447 bytes parent folder | download | duplicates (5)
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
# -*- sh -*-
security_def_list="usm"
security_src_list=""
security_obj_list=""
security_lobj_list=""
security_ftobj_list=""
security_mod_list=" "

new_with_security=
new_with_out_security=`echo $with_out_security_modules | tr , ' '`

# Assign additional security modules
for i in `echo $with_security_modules | tr , ' '`; do
  if echo " $new_with_out_security " | $GREP " $i " > /dev/null; then
    echo
    AC_MSG_ERROR([security module conflict - $i both included and excluded])
  elif echo " $new_with_security " | $GREP " $i " > /dev/null ; then
    : # Double define, ignore
  else
    new_with_security="$new_with_security $i"
  fi
done

# Add default security modules
for i in $security_def_list; do
  if echo " $new_with_out_security " | $GREP " $i " > /dev/null; then
    : # Excluded, ignore
  elif echo " $new_with_security " | $GREP " $i " > /dev/null ; then
    : # Double define, ignore
  else
    new_with_security="$new_with_security $i"
  fi
done

# Generate output files
: ${security_init_file:='snmplib/snmpsm_init.h'}
: ${security_shutdown_file:='snmplib/snmpsm_shutdown.h'}
: ${security_incl_file:='include/net-snmp/library/snmpv3-security-includes.h'}

echo "/* This file is automatically generated by configure.  Do not modify by hand. */" > $security_init_file
echo "/* This file is automatically generated by configure.  Do not modify by hand. */" > $security_shutdown_file
echo "/* This file is automatically generated by configure.  Do not modify by hand. */" > $security_incl_file

for i in $new_with_security; do
  cfile="snmp"$i".c"
  hfile="snmp"$i".h"

  # make sure support exists for it
  if test -f $srcdir"/snmplib/"$cfile -a -f $srcdir"/include/net-snmp/library/"$hfile; then
    :
  else
    echo
    AC_MSG_ERROR(No such security module: $i / $cfile / $hfile)
  fi

  # define a bunch of stuff to enable it
  security_mod_list="${security_mod_list} $i"
  security_src_list="$security_src_list $cfile"
  security_src_list="$security_src_list $cfile"
  security_hdr_list="$security_hdr_list $hfile"
  security_obj_list="$security_obj_list snmp"$i".o"
  security_lobj_list="$security_lobj_list snmp"$i".lo"
  security_ftobj_list="$security_ftobj_list snmp"$i".ft"
  echo "init_"$i"();" >> $security_init_file
  echo "shutdown_"$i"();" >> $security_shutdown_file
  echo "#include <net-snmp/library/$hfile>" >> $security_incl_file
  def_name="AS_TR_CPP([NETSNMP_SECMOD_$i])"
  AC_DEFINE_UNQUOTED($def_name)
done