Changeset 7774 for TI12-security


Ignore:
Timestamp:
13/12/10 14:18:36 (9 years ago)
Author:
pjkersha
Message:

Incomplete - task 20: Check for MyProxy? Logon bash script bug

  • fix to support earlier versions of curl which don't include the --data-urlencode option.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/MyProxyWebService/myproxy/ws/client/myproxy-ws-logon.sh

    r7768 r7774  
    1 #!/bin/bash -xv 
     1#!/bin/bash 
    22# 
    33# Client script for web service interface to MyProxy logon based on openssl and 
     
    9090# Post request to MyProxy web service passing username/password for HTTP Basic 
    9191# auth based authentication.   
    92 response=$(curl $uri --sslv3 -u $username:$password --data-urlencode "certificate_request=$(cat $certreqfilepath)" --capath $cadir -w " %{http_code}" -s -S) 
     92#  
     93# Nb. Earlier versions of curl don't support --data-urlencode so use this  
     94# workaround instead... 
     95 
     96# Alterations to change Base 64 encoding to URL safe Base 64 
     97encoded_certreq=$(cat $certreqfilepath|sed s/+/%2B/g) 
     98 
     99response=$(curl $uri --sslv3 -u $username:$password --data "certificate_request=$encoded_certreq" --capath $cadir -w " %{http_code}" -s -S) 
     100 
    93101responsemsg=$(echo "$response"|sed '$s/ *\([^ ]* *\)$//') 
    94102responsecode=$(echo $response|awk '{print $NF}') 
Note: See TracChangeset for help on using the changeset viewer.