# HG changeset patch # User Mark Brand # Date 1292578856 -3600 # Node ID 243cffadb16c309a51219006391b2dcd741bfd28 # Parent ad027e5187f100e7061c3bf77845e254023b9a3c upgrade package freetds to cvs diff -r ad027e5187f1 -r 243cffadb16c src/freetds-1-fastforward.patch --- a/src/freetds-1-fastforward.patch Thu Dec 16 10:11:40 2010 +0100 +++ b/src/freetds-1-fastforward.patch Fri Dec 17 10:40:56 2010 +0100 @@ -160681,3 +160681,174 @@ exit(0); break; default: + +commit 0b39abd20a58301320a444cd58ea9ae4ddda3487 +Author: berryc +Date: Fri Dec 17 04:26:21 2010 +0000 + + Base VMS getpass/readline on stdin, not SYS$COMMAND. + +diff --git a/ChangeLog b/ChangeLog +index 125c71c..df78ba0 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,9 @@ ++Thu Dec 16 20:24:00 CST 2010 Craig A. Berry ++ * vms/getpass.c Base VMS getpass/readline on stdin, not SYS$COMMAND. ++ ++Thu Dec 16 20:18:00 CST 2010 Craig A. Berry ++ * src/apps/freebcp.c Fix typo in -i option. ++ + Fri Dec 10 15:42:12 EST 2010 JK Lowden + * include/sqlfront.h include/sybdb.h Better Win32 compatibility + * src/apps/tsql.c report Kerberos compiled-in status +@@ -3057,4 +3063,4 @@ Wed Jan 9 19:54:43 EST 2008 JK Lowden + * ChangeLog-0.82 added because of release + + $FreeTDS$ +-$Id: ChangeLog,v 1.3170 2010/12/10 20:46:19 jklowden Exp $ ++$Id: ChangeLog,v 1.3171 2010/12/17 04:26:21 berryc Exp $ +diff --git a/vms/getpass.c b/vms/getpass.c +index cd7c4a3..58fec77 100644 +--- a/vms/getpass.c ++++ b/vms/getpass.c +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + + #include + #include "readline.h" +@@ -47,7 +48,7 @@ + static FILE *tds_rl_instream = NULL; + static FILE *tds_rl_outstream = NULL; + +-static char software_version[] = "$Id: getpass.c,v 1.6 2010/05/21 14:02:08 freddy77 Exp $"; ++static char software_version[] = "$Id: getpass.c,v 1.7 2010/12/17 04:26:21 berryc Exp $"; + static void *no_unused_var_warn[] = { software_version, no_unused_var_warn }; + + /* +@@ -63,7 +64,7 @@ static void *no_unused_var_warn[] = { software_version, no_unused_var_warn }; + * already stored in the command recall buffer by SMG$READ_COMPOSED_LINE. + */ + +-#define MY_PASSWORD_LEN 1024 ++#define MY_PASSWORD_LEN 8192 + #define RECALL_SIZE 50 /* Lines in recall buffer. */ + #define DEFAULT_TIMEOUT 30 /* Seconds to wait for user input. */ + +@@ -80,15 +81,16 @@ readpassphrase(const char *prompt, char *pbuf, size_t buflen, int flags) + unsigned long ctrl_mask, saved_ctrl_mask = 0; + int timeout_secs = 0; + int *timeout_ptr = NULL; +- unsigned long dvi_item, ttdevclass, status = 0; ++ unsigned long status = 0; + unsigned short iosb[4]; +- unsigned short ttchan, result_len = 0; ++ unsigned short ttchan, result_len = 0, stdin_is_tty; + +- $DESCRIPTOR(ttdsc, "SYS$COMMAND:"); ++ $DESCRIPTOR(ttdsc, ""); + $DESCRIPTOR(pbuf_dsc, ""); + $DESCRIPTOR(prompt_dsc, ""); + char *retval = NULL; + char *myprompt = NULL; ++ char input_fspec[MY_PASSWORD_LEN + 1]; + + if (pbuf == NULL || buflen == 0) { + errno = EINVAL; +@@ -98,24 +100,25 @@ readpassphrase(const char *prompt, char *pbuf, size_t buflen, int flags) + pbuf_dsc.dsc$a_pointer = pbuf; + pbuf_dsc.dsc$w_length = buflen - 1; + ++ + /* +- * Find out if SYS$COMMAND is a terminal. ++ * If stdin is not a terminal and only reading from a terminal is allowed, we ++ * stop here. + */ +- dvi_item = DVI$_DEVCLASS; +- status = LIB$GETDVI(&dvi_item, 0, &ttdsc, &ttdevclass); +- if (!$VMS_STATUS_SUCCESS(status)) { +- /* We might fail for perfectly good reasons, like +- * SYS$COMMAND is not a device. +- */ +- ttdevclass = 0; ++ stdin_is_tty = isatty(fileno(stdin)); ++ if (stdin_is_tty != 1 && (flags & RPP_REQUIRE_TTY)) { ++ errno = ENOTTY; ++ return NULL; + } + + /* +- * If it's not a terminal and only reading from a terminal is allowed, we +- * stop here. ++ * We need the file or device associated with stdin in VMS format. + */ +- if ((ttdevclass != DC$_TERM) && (flags & RPP_REQUIRE_TTY)) { +- errno = ENOTTY; ++ if (fgetname(stdin, input_fspec, 1)) { ++ ttdsc.dsc$a_pointer = (char *)&input_fspec; ++ ttdsc.dsc$w_length = strlen(input_fspec); ++ } else { ++ errno = EMFILE; + return NULL; + } + +@@ -131,7 +134,7 @@ readpassphrase(const char *prompt, char *pbuf, size_t buflen, int flags) + prompt_dsc.dsc$a_pointer = myprompt; + prompt_dsc.dsc$w_length = strlen(myprompt); + +- if (!(flags & RPP_ECHO_ON) && (ttdevclass == DC$_TERM)) { ++ if (!(flags & RPP_ECHO_ON) && (stdin_is_tty)) { + /* Disable Ctrl-T and Ctrl-Y */ + ctrl_mask = LIB$M_CLI_CTRLT | LIB$M_CLI_CTRLY; + status = LIB$DISABLE_CTRL(&ctrl_mask, &saved_ctrl_mask); +@@ -156,7 +159,7 @@ readpassphrase(const char *prompt, char *pbuf, size_t buflen, int flags) + timeout_ptr = &timeout_secs; + } + +- if (!(flags & RPP_ECHO_ON) && (ttdevclass == DC$_TERM)) { ++ if (!(flags & RPP_ECHO_ON) && (stdin_is_tty)) { + /* + * If we are suppressing echoing, get a line of input with $QIOW. + * Non-echoed lines are not stored for recall. (The same thing +@@ -244,7 +247,7 @@ readpassphrase(const char *prompt, char *pbuf, size_t buflen, int flags) + + free(myprompt); + +- if (!(flags & RPP_ECHO_ON) && (ttdevclass == DC$_TERM)) { ++ if (!(flags & RPP_ECHO_ON) && (stdin_is_tty)) { + /* + * Reenable previous control processing. + */ + +commit 9f3df45a17fea9ed4e379b40bc98c92f3db588a5 +Author: berryc +Date: Fri Dec 17 04:31:36 2010 +0000 + + *** empty log message *** + +diff --git a/src/apps/freebcp.c b/src/apps/freebcp.c +index 10b9219..f67ad36 100644 +--- a/src/apps/freebcp.c ++++ b/src/apps/freebcp.c +@@ -54,7 +54,7 @@ + #include + #include "freebcp.h" + +-static char software_version[] = "$Id: freebcp.c,v 1.57 2010/07/22 09:55:37 freddy77 Exp $"; ++static char software_version[] = "$Id: freebcp.c,v 1.58 2010/12/17 04:31:36 berryc Exp $"; + static void *no_unused_var_warn[] = { software_version, no_unused_var_warn }; + + void pusage(void); +@@ -359,7 +359,7 @@ process_parameters(int argc, char **argv, BCPPARAMDATA *pdata) + * is specified, redirecting stdin doesn't do much yet. + */ + if (pdata->inputfile) { +- if (freopen(pdata->inputfile, "rb", stdout) == NULL) { ++ if (freopen(pdata->inputfile, "rb", stdin) == NULL) { + fprintf(stderr, "%s: unable to open %s: %s\n", "freebcp", pdata->inputfile, strerror(errno)); + exit(1); + }