~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/config/util/syminst.sh

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
#
 
4
# syminst - install with a symbolic link back to the build tree
 
5
#
 
6
 
 
7
# set DOITPROG to echo to test this script
 
8
 
 
9
doit="${DOITPROG-}"
 
10
 
 
11
 
 
12
# put in absolute paths if you don't have them in your path; or use env. vars.
 
13
 
 
14
lnprog="${LNPROG-ln -s}"
 
15
rmprog="${RMPROG-rm}"
 
16
 
 
17
instcmd="$lnprog"
 
18
rmcmd="$rmprog -f"
 
19
srcdir=`pwd`/
 
20
src=""
 
21
dst=""
 
22
 
 
23
while [ x"$1" != x ]; do
 
24
    case $1 in
 
25
        -c) shift
 
26
            continue;;
 
27
 
 
28
        -m) shift
 
29
            shift
 
30
            continue;;
 
31
 
 
32
        -o) shift
 
33
            shift
 
34
            continue;;
 
35
 
 
36
        -g) shift
 
37
            shift
 
38
            continue;;
 
39
 
 
40
        -s) shift
 
41
            continue;;
 
42
 
 
43
        -DIR) srcdir=`echo $2 | sed 's;/\./;/;g'`/
 
44
              shift
 
45
              shift
 
46
              continue;;
 
47
 
 
48
        *)  if [ x"$src" = x ]
 
49
            then
 
50
                src=$1
 
51
            else
 
52
                dst=$1
 
53
            fi
 
54
            shift
 
55
            continue;;
 
56
    esac
 
57
done
 
58
 
 
59
if [ x"$src" = x ]
 
60
then
 
61
        echo "syminst:  no input file specified"
 
62
        exit 1
 
63
fi
 
64
 
 
65
if [ x"$dst" = x ]
 
66
then
 
67
        echo "syminst:  no destination specified"
 
68
        exit 1
 
69
fi
 
70
 
 
71
 
 
72
# if destination is a directory, append the input filename; if your system
 
73
# does not like double slashes in filenames, you may need to add some logic
 
74
 
 
75
if [ -d $dst ]
 
76
then
 
77
        dst="$dst"/`basename $src`
 
78
fi
 
79
 
 
80
case $src in
 
81
    /*) srcdir=""
 
82
        instcmd=cp;;
 
83
esac
 
84
 
 
85
# get rid of the old one and mode the new one in
 
86
 
 
87
$doit $rmcmd $dst
 
88
$doit $instcmd $srcdir$src $dst
 
89
 
 
90
exit 0