Add Oracle to the list of supported drivers.
authornbk <nbk>
Thu, 17 Aug 2006 12:20:41 +0000 (12:20 +0000)
committernbk <nbk>
Thu, 17 Aug 2006 12:20:41 +0000 (12:20 +0000)
Thanks to Alexander Serkin <als@cell.ru>

man/man8/radsqlrelay.8
scripts/radsqlrelay

index 41a4dae..801b522 100644 (file)
@@ -29,7 +29,7 @@ must be configured in the \fBradiusd\fP server before you can use
 
 .SH OPTIONS
 .IP "\-d \fIsql_driver\fP"
-Driver to use: mysql, pg.
+Driver to use: mysql, pg, oracle.
 .IP "\-b \fIdatabase\fP"
 Name of the database to use.
 .IP "\-h \fIhost\fP"
@@ -43,6 +43,23 @@ One-shot mode: push the file to database and exit.
 .IP "file_path"
 The pathname of the SQL logfile to use.
 
+.SH NOTES
+.SS Oracle driver
+The command "radsqlrelay -d oracle -b db.domain.tld sql-relay" reads the
+database description stored in $TNS_ADMIN/tnsnames.ora:
+.PP
+.DS
+db.domain.tld =
+  (DESCRIPTION =
+    (ADDRESS_LIST =
+      (ADDRESS = (PROTOCOL = TCP)(HOST = db.domain.tld)(PORT = 1521))
+    )
+    (CONNECT_DATA =
+      (SERVICE_NAME = <DB SID>)
+    )
+  )
+.DE
+
 .SH SEE ALSO
 .BR rlm_sql_log (5)
 
index 8fba8e4..05c3274 100755 (executable)
@@ -24,7 +24,7 @@
 ##
 ##  You should have received a copy of the GNU General Public License
 ##  along with this program; if not, write to the Free Software
-##  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 ##
 
 use DBI;
@@ -72,7 +72,7 @@ options:
        -?              Print this help message.
        -1              One-shot mode: push the file to database and exit.
        -b database     Name of the database to use.
-       -d sql_driver   Driver to use: mysql, pg.
+       -d sql_driver   Driver to use: mysql, pg, oracle.
        -h host         Connect to host.
        -P port         Port number to use for connection.
        -p passord      Password to use when connecting to server.
@@ -156,6 +156,8 @@ if (lc($args{d}) eq 'mysql') {
     $data_source = "DBI:mysql:database=$args{b};host=$args{h}";
 } elsif (lc($args{d}) eq 'pg') {
     $data_source = "DBI:Pg:dbname=$args{b};host=$args{h}";
+} elsif (lc($args{d}) eq 'oracle') {
+    $data_source = "DBI:Oracle:$args{b}";
 } else {
     print STDERR "error: SQL driver not supported yet: $args{d}\n";
     exit 1;