Skip to content

Commit

Permalink
Fixed bug in acquisition name check in cases where the name is not a …
Browse files Browse the repository at this point in the history
…string.
  • Loading branch information
Jim Fulton committed Apr 30, 1999
1 parent 627648c commit accf416
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions cDocumentTemplate.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
****************************************************************************/
static char cDocumentTemplate_module_documentation[] =
""
"\n$Id: cDocumentTemplate.c,v 1.23 1999/04/28 16:29:22 jim Exp $"
"\n$Id: cDocumentTemplate.c,v 1.24 1999/04/30 19:01:58 jim Exp $"
;

#include "ExtensionClass.h"
Expand Down Expand Up @@ -866,12 +866,15 @@ validate(PyObject *self, PyObject *args)
UNLESS(PyArg_ParseTuple(args,"OOOOO",&inst,&parent,&name,&value,&md))
return NULL;

UNLESS(cname=PyString_AsString(name)) return NULL;
if (*cname=='a' && cname[1]=='q' && cname[2]=='_'
&& strcmp(cname, "aq_explicit") && strcmp(cname, "aq_parent"))
/* We disallow names beginning with "aq_" unless they are
aq_parent or aq_explicit */
return PyInt_FromLong(0);
if (PyString_Check(name))
{
UNLESS(cname=PyString_AsString(name)) return NULL;
if (*cname=='a' && cname[1]=='q' && cname[2]=='_'
&& strcmp(cname, "aq_explicit") && strcmp(cname, "aq_parent"))
/* We disallow names beginning with "aq_" unless they are
aq_parent or aq_explicit */
return PyInt_FromLong(0);
}

/*
if hasattr(value, '__roles__'): roles=value.__roles__
Expand Down Expand Up @@ -1022,7 +1025,7 @@ void
initcDocumentTemplate()
{
PyObject *m, *d;
char *rev="$Revision: 1.23 $";
char *rev="$Revision: 1.24 $";
PURE_MIXIN_CLASS(cDocument,
"Base class for documents that adds fast validation method",
Document_methods);
Expand Down

0 comments on commit accf416

Please sign in to comment.