I've been trying to put together a version of the wtools/xcl for running
xaceclient so that it works with the socket server. This is ACeDB 4.9c
This hasn't been difficult, apart from one thing; there are times that
the script needs your password (or could do, depending on how the server
has been set up).
It turns out that you cannot supply a userid and password to saceclient
through a pipe; saceclient only works in a tty, and bombs out if you try
to run it in a pipe. The patch for this is at the end of this post.
Having got the xcl script working including password authentication, I
tried using the client. Hmm. It strikes me as being pretty unuseably
slow; even small FMAP displays take a huge amount of time. Looking at
the aceserver logging, this looks like it's because of the huge number
of individual query find commands the client issues; one for each object
to be displayed. Particularly with large databases, this strikes me as
very inefficient. Would it not be better to construct keysets of
objects to fetch, send that to the server and grab them all in one go,
and then construct further keysets from the fetched objects if
necessary. This would involve far less querying of the database, I'm
sure, and consequently better performance.
Thoughts?
The following patch fixes the tty problem:
--- wsocket/sclient.c.orig Thu Aug 23 13:33:42 2001
+++ wsocket/sclient.c Thu Aug 23 13:35:04 2001
@@ -63,18 +63,23 @@
/* Now set the terminal non-echoing, get the password and reset the */
/* terminal. */
- if (tcgetattr(fileno(stdin), &term) < 0)
- messcrash("Unable to get terminal attributes for input of password.");
- term.c_lflag &= ~(ECHO) ; /* Turn echo off. */
- if (tcsetattr(fileno(stdin), TCSADRAIN, &term) < 0)
- messcrash("Unable to set terminal attributes for input of password.");
+ if (isatty(fileno(stdin))) {
+ if (tcgetattr(fileno(stdin), &term) < 0)
+ messcrash("Unable to get terminal attributes for input of password.");
+
+ term.c_lflag &= ~(ECHO) ; /* Turn echo off. */
+ if (tcsetattr(fileno(stdin), TCSADRAIN, &term) < 0)
+ messcrash("Unable to set terminal attributes for input of password.");
+ }
*passwd = readline(passwdPrompt) ;
- term.c_lflag |= ECHO ; /* Turn on again. */
- if (tcsetattr(fileno(stdin), TCSADRAIN, &term) < 0)
- messcrash("Unable to reset terminal attributes after input of password.");
+ if (isatty(fileno(stdin))) {
+ term.c_lflag |= ECHO ; /* Turn on again. */
+ if (tcsetattr(fileno(stdin), TCSADRAIN, &term) < 0)
+ messcrash("Unable to reset terminal attributes after input of password.");
+ }
printf("\n") ; /* newline after password is not
echoed to terminal so send one. */
--
"It is the job of Sales and Marketing to insulate those who know what
they're talking about from each other"
-- I know who said this, but I'm not telling.