[1399] in Moira
Re: workaround duplicate strings
daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Tue Mar 7 18:39:17 2000
Date: Tue, 7 Mar 2000 18:39:13 -0500 (EST)
Message-Id: <200003072339.SAA14254@sweet-transvestite.mit.edu>
From: Garry Zacheiss <zacheiss@MIT.EDU>
To: Jonathon Weiss <jweiss@MIT.EDU>
Cc: Garry Zacheiss <zacheiss@MIT.EDU>, moiradev@MIT.EDU
In-Reply-To: "[1396] in Moira"
>> This patch is fine, tho I would have suggested that we not check it in
>> until we have a fix/workaround for the mrbackup problem, since it will
>> hurt if we encounter this trying to re-load the database. I guess I
>> missed my chance tho.
I was getting to that. This prevents moirad from creating strings
with leading/trailing whitespace in the first place. Consider this a
workaround, since fixing mrbackup/mrrestore has been been deemed
difficult. Barbie says "Moira is hard".
Garry
Index: qrtn.pc
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository//moira/server/qrtn.pc,v
retrieving revision 2.21
diff -c -r2.21 qrtn.pc
*** qrtn.pc 2000/01/28 00:03:36 2.21
--- qrtn.pc 2000/03/05 08:27:33
***************
*** 146,151 ****
--- 146,152 ----
{
struct query *q;
int status;
+ int i;
struct validate *v;
char *qual = NULL;
EXEC SQL BEGIN DECLARE SECTION;
***************
*** 180,185 ****
--- 181,190 ----
if (!q)
return MR_NO_HANDLE;
v = q->validate;
+
+ /* remove leading and trailing whitespace from all arguments */
+ for (i = 0; i < argc; i++)
+ argv_ro[i] = strtrim(argv_ro[i]);
/* setup argument vector, verify access and arguments */
if ((status = mr_verify_query(cl, q, argc, argv_ro)) != MR_SUCCESS)