[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] hiding the SQR password on the command line



Hi Ray,
Its really a good one,till now i was passing the username/password into a
file
and then running the sqr using @file option
but this one was different one and quite useful , something similar to wat
we can do for ISQL ...etc
regds,
kajal

------------------------------------
Xoriant Solutions Pvt Ltd.
Kajal Somaiya
Sofware Engineer
Kajal.Somaiya@xoriant.com
------------------------------------


-----Original Message-----
From: Ray Ontko [mailto:rayo@ontko.com]
Sent: Tuesday, March 23, 2004 7:33 PM
To: sqr-users@sqrug.org
Subject: [sqr-users] hiding the SQR password on the command line


SQR-USERS,

Here's a little shell script for *nix SQR shops that want to keep
the database username and password from showing up in the output
of the "ps" command.  I didn't see anything like this in the 
archives, so I thought I'd throw it out there.  If there are 
other approaches or suggestions, please chime in.

Ray

#!/bin/sh

# sqr.sh
#
# A shell script to run SQR under *nix without disclosing the 
# connectivity string on the command line.   In this example, the 
# USRPWD is hard-coded in this script, but it could just as 
# easily be defined in a shell variable, or in an external file, 
# the name of which is passed as the second parameter.
#

# Define the path to the SQR executable
SQR=$SQRDIR/sqr

# Define the connectivity string.
USRPWD=username/password@database

# Define PROG as the first parameter (the name of the sqr program) 
# and shift the remaining parameters to the left by one.
PROG=$1
shift 1

# Invoke SQR, passing "?" as the password, causing SQR to prompt
# us for it.  We then provide $USRPWD on standard input.
$SQR $PROG "?" "$@" <<EODSQR
$USRPWD
EODSQR

----------------------------------------------------------------------
Ray Ontko   rayo@ontko.com   Phone 1.765.935.4283   Fax 1.765.962.9788
Ray Ontko & Co.   Software Consulting Services   http://www.ontko.com/

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users