Read on full site | Join TechSpot! (it's free) | Bookmark / Share this



Unix script security

mevreugd
07-07-2007, 05:08 AM
I'm using an excellent script from R. H. Reepe for accessing accounts, but need a security line, that fits the script. Any suggestions? Thx in advance;)
Her's the script

Arg_1 = Requested Account Name (coded string)
# Arg_2 = Calling Script Name ($0)
# Arg_3 = [Calling PID (for uniqueness)]
{

_audit_log=$ORACLE_LOG/oracle_audit_trail.log
if [ "$1" = "" ]
then
echo "Error in $0 : No coded string provided"
echo "Oracle Connection Refused"
exit 1
fi
if [ "$2" = "" ]
then
echo "Error in `s_prog` : No calling script_name provided for"
echo "Subroutine s_access_account - Oracle Connection Refused"
echo "Attempt to Crack Security made by $USER at `date`" >> $_audit_log
echo "From terminal $TERM (`tty`) using script `s_prog`" >> $_audit_log
exit 2
fi
_pid=${3:-""}
_timestamp=`s_timestamp`
_script_type=`dirname $2`
_script_type=`basename $_script_type`
_script_name=`basename $2`
if [ "$_script_type" = "." ]
then
_script_type=`pwd`
_script_type=`basename $_script_type`
_script_name=`s_prog`
fi
account=`/usr/5bin/echo "$1\c" | $DECODE`
/usr/5bin/echo "export account" > $account_string"$_pid"
/usr/5bin/echo "account=$account\c" >> $account_string"$_pid"
. $account_string"$_pid"
_name=`echo "$account" | tr '/' ' ' | cut -f1-1 -d\ `
echo "$_timestamp Oracle connecting as $_name from $_script_type $_script_name" >>
$_audit_log
s_delete_account $_pid & > /dev/null 2>&1
return 0
}

jobeard
07-07-2007, 12:18 PM
what do you mean by 'security line'? Do you wish to verify that only authorized users
may invoke(run) the script?

the Oracle login will succeed or fail normally so what's your concern?

btw, there are other means to access Oracle, so this usage is marginal anyway.

Ad
07-07-2007, 12:18 PM
  

Post a reply, see related topics & more

Tip: Download Advanced SystemCare 3 Free - Clean, Repair, Protect & Optimize your PC.



 Top Technology News

TechSpot Blog: Disable Windows automatic check for solutions after a program crashes

Weekend Open Forum: Google Chrome OS and the future of cloud computing

Tech Tip of the Week: Unearth Region-Specific Windows 7 Themes

Weekend tech reading: How to run Chrome OS as a virtual machine

Sony: PlayStation 3 to be 3D-capable via firmware update

iSuppli: DDR3 to account for over half of DRAM shipments by Q2 2010

Facebook named third most popular video website behind YouTube and Hulu

Patriot introduces new PS-100 SSD series

More Tech News

  
 Software Downloads

Norton Virus Definitions 2003-07 November 20, 2009

AVG Anti-Virus Updates November 20, 2009

Norton Virus Definitions 2008-09 November 20, 2009

avast! Virus Definitions November 20, 2009

McAfee SuperDAT Update 5808

Kaspersky Anti-Virus Update November 20, 2009

Google SketchUp 7.1.6087

More Downloads



Copyright © 1998-2009 TechSpot.com. TechSpot is a registered trademark. All Rights Reserved.