~ubuntu-branches/ubuntu/breezy/pam/breezy

« back to all changes in this revision

Viewing changes to Linux-PAM/modules/register_static

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2004-06-28 14:28:08 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040628142808-adikk7vtfg3pzcjw
Tags: 0.76-22
* Add uploaders
* Document location of repository
* Fix options containing arguments in pam_unix, Closes: #254904

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
if [ `basename $PWD` != "modules" ]; then
 
4
        echo "$0 must be run from the .../modules directory"
 
5
        exit 1
 
6
fi
 
7
 
 
8
merge_line ()
 
9
{
 
10
        if [ $# != 3 ]; then
 
11
                echo "usage: merge_line token filename 'new line'"
 
12
        fi
 
13
        if [ -f $2 ]; then
 
14
# remove any existing entry...
 
15
                grep -v "$1" $2 > tmp.$2
 
16
                rm -f $2
 
17
                mv {tmp.,}$2
 
18
        fi
 
19
        cat << EOT >> $2
 
20
$3
 
21
EOT
 
22
 
 
23
}
 
24
 
 
25
 
 
26
if [ $# -ne 2 ]; then
 
27
 
 
28
        cat << EOT 2>&1
 
29
$0:     this script takes TWO arguments:
 
30
        the 'alphanumeric label' of the module and the location of
 
31
        its object file from the .../modules/ directory
 
32
EOT
 
33
        exit 1
 
34
 
 
35
else
 
36
        echo "
 
37
 *> registering static module: $1 ($2) <*
 
38
"
 
39
        merge_line "$1" _static_module_list "\
 
40
extern struct pam_module _$1_modstruct;"
 
41
 
 
42
        merge_line "$1" _static_module_entry "    &_$1_modstruct,"
 
43
        if [ -n "$2" ]; then
 
44
                merge_line "$2" _static_module_objects "../modules/$2"
 
45
        fi
 
46
 
 
47
fi
 
48
 
 
49
exit 0