~ubuntu-branches/ubuntu/utopic/gridengine/utopic

« back to all changes in this revision

Viewing changes to source/security/gss/starter_cred.ksh

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2008-06-25 22:36:13 UTC
  • Revision ID: james.westby@ubuntu.com-20080625223613-tvd9xlhuoct9kyhm
Tags: upstream-6.2~beta2
ImportĀ upstreamĀ versionĀ 6.2~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#___INFO__MARK_BEGIN__
 
3
##########################################################################
 
4
#
 
5
#  The Contents of this file are made available subject to the terms of
 
6
#  the Sun Industry Standards Source License Version 1.2
 
7
#
 
8
#  Sun Microsystems Inc., March, 2001
 
9
#
 
10
#
 
11
#  Sun Industry Standards Source License Version 1.2
 
12
#  =================================================
 
13
#  The contents of this file are subject to the Sun Industry Standards
 
14
#  Source License Version 1.2 (the "License"); You may not use this file
 
15
#  except in compliance with the License. You may obtain a copy of the
 
16
#  License at http://gridengine.sunsource.net/Gridengine_SISSL_license.html
 
17
#
 
18
#  Software provided under this License is provided on an "AS IS" basis,
 
19
#  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 
20
#  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 
21
#  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 
22
#  See the License for the specific provisions governing your rights and
 
23
#  obligations concerning the Software.
 
24
#
 
25
#  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 
26
#
 
27
#  Copyright: 2001 by Sun Microsystems, Inc.
 
28
#
 
29
#  All Rights Reserved.
 
30
#
 
31
##########################################################################
 
32
#___INFO__MARK_END__
 
33
 
 
34
set +u
 
35
 
 
36
if [ -z "$SGE_ROOT" ]
 
37
then
 
38
   echo "\$SGE_ROOT environment variable not set" >> error
 
39
   echo 7 > exit_status
 
40
   exit 7
 
41
fi
 
42
SGE_CELL=${SGE_CELL:-default}
 
43
 
 
44
arch=`$SGE_ROOT/util/arch`
 
45
eval `grep "^USER=" environment`
 
46
eval `grep "^JOB_ID=" environment`
 
47
eval `grep "^KRB5CCNAME=" environment`
 
48
export USER
 
49
export JOB_ID
 
50
export KRB5CCNAME
 
51
 
 
52
# Remove KRB5CCNAME from the environment file and
 
53
# change ownership of environment file, so we can set
 
54
# the new KRB5CCNAME returned by k5dcelogin below.
 
55
 
 
56
grep -v "^KRB5CCNAME=" <environment >environment.new
 
57
mv environment.new environment
 
58
chown $USER environment
 
59
 
 
60
exec $SGE_ROOT/utilbin/$arch/k5dcelogin /bin/sh -c "echo KRB5CCNAME=\$KRB5CCNAME>>environment; exec $SGE_ROOT/bin/$arch/sge_shepherd -bg; echo could not exec shepherd >> error; exit 7" 2>> error
 
61
 
 
62
echo "could not exec k5dcelogin" >> error
 
63
echo 7 > exit_status
 
64
exit 7