[6476] in Moira

home help back first fref pref prev next nref lref last post

Re: odd Moira bug in add_list

daemon@ATHENA.MIT.EDU (Jonathan Reed)
Wed Apr 22 08:42:52 2015

Date: Wed, 22 Apr 2015 08:42:50 -0400 (EDT)
From: Jonathan Reed <jdreed@mit.edu>
To: moiradev@mit.edu
cc: Laura Baldwin <boojum@mit.edu>
In-Reply-To: <D17231BB-EF3E-4B52-A8C4-0CD676E71BD1@mit.edu>
Message-ID: <alpine.DEB.2.10.1504220836010.8013@infinite-loop.mit.edu>
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="-1693316094-2121478353-1429706570=:8013"

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

---1693316094-2121478353-1429706570=:8013
Content-Type: TEXT/PLAIN; charset=windows-1252; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE


Looking at this a bit more, I'm skeptical of the casting on line 404 of=20
qvalidate.pc, and wondering why it's not strcmp(3):

https://github.mit.edu/ops/moira/blob/master/moira/server/qvalidate.pc#L404


On Tue, 21 Apr 2015, Jonathan D Reed wrote:

> I stumbled across a weird bug in add_list. =A0When creating a list, if yo=
u
> specify the owner as a nonexistent list whose first 4 characters match th=
e
> first 4 characters of the list to be created, the query succeeds and the
> list is self-owned. =A0This feels like an obscure string comparison bug i=
n C,
> but I haven=92t tracked it down yet.
> I=92ve only tested this on ttsp so far, because I didn=92t want to pollut=
e moira
> with test lists
>=20
> Example:
>=20
> [root@sois-python-dev-1 listmaker]# qy -db ttsp glin thislistdoesnotexist
> moira (query): No records in database match query=A0
>=20
> [root@sois-python-dev-1 listmaker]# qy -db ttsp glin not_a_real_list
> moira (query): No records in database match query=A0
>=20
> [root@sois-python-dev-1 listmaker]# qy -db ttsp glin thislistalsofake
> moira (query): No records in database match query=A0
>=20
> [root@sois-python-dev-1 listmaker]# qy -db ttsp add_list
> thislistdoesnotexist 1 0 0 1 0 'create unique GID' 0 0 '[NONE]' LIST
> not_a_real_list NONE NONE 'description'
> moira (query): No such list=A0
>=20
> [root@sois-python-dev-1 listmaker]# qy -db ttsp add_list
> thislistdoesnotexist 1 0 0 1 0 'create unique GID' 0 0 '[NONE]' LIST
> thislistalsofake NONE NONE 'description'
>=20
> [root@sois-python-dev-1 listmaker]# qy -s -db ttsp glin thislistdoesnotex=
ist
> thislistdoesnotexist, 1, 0, 0, 1, 0, create unique GID, 0, 0, [NONE], LIS=
T,
> thislistdoesnotexist, NONE, NONE, description, 21-apr-2015 21:26:09,
> daemon/listmaker-dev.mit.edu@ATHENA.MIT.EDU, mrtest
>=20
>=20
> Obviously the second add_list should have failed. =A0Testing revealed tha=
t if
> the first 3 characters match, it correctly returns MR_LIST, but if 4+ mat=
ch,
> it defaults to self-owned.
>=20
>
---1693316094-2121478353-1429706570=:8013--

home help back first fref pref prev next nref lref last post