<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000066">
<font size="-1"><font face="Helvetica, Arial, sans-serif">Hi Mike,<br>
<br>
I use a similar setup (PG Functions for auth/acct) and I never had an
issue with the query ordering.<br>
<br>
Padam<br>
</font></font><br>
<a class="moz-txt-link-abbreviated" href="mailto:freeradius@duxtel.com">freeradius@duxtel.com</a> wrote:
<blockquote cite="mid:014a01ca6c20$36e2b1a0$a4a814e0$@com" type="cite">
  <pre wrap="">Hi Alan,

Thanks heaps for your reply! :-)

  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">So my basic question is:  Does "authorize_check_query" complete fully
      </pre>
    </blockquote>
    <pre wrap="">before
    </pre>
    <blockquote type="cite">
      <pre wrap="">starting the call to "authorize_reply_query"?
      </pre>
    </blockquote>
    <pre wrap="">  To re-phrase your question:

Q: What work does the database perform after it's returned an answer
from a SELECT?

A: Nothing.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
That is true for a select statement, but my authorize_check_query is /not/ a
simple select.

It is this:

        authorize_check_query = "select id, username, attribute, value, op
from\
                                 auth('%{SQL-User-Name}',
'%{NAS-IP-Address}')\
                                 as (id integer, username varchar, attribute
varchar, value varchar, op varchar)"

the 'auth()' function is a plpgsql function that does a variety of lookups
and other checks, and then depending on the results returned from that
query, it *might* update database records, or it might insert additional
data.

Therefore, it is important to know whether authorize_check_query and
authorize_reply_query execute synchronously or not.

  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">If they happen at the same time, then I expect that
      </pre>
    </blockquote>
    <pre wrap="">'authorize_reply_query'
    </pre>
    <blockquote type="cite">
      <pre wrap="">may execute before I get a chance to create the relevant records for the
'guest' user...

I know I can just go ahead and find out my answer by 'empirical method',
      </pre>
    </blockquote>
    <pre wrap="">but
    </pre>
    <blockquote type="cite">
      <pre wrap="">I figure that just because it seems to work every time, there is no
      </pre>
    </blockquote>
    <pre wrap="">definite
    </pre>
    <blockquote type="cite">
      <pre wrap="">guarantee that it will work *every* time unless I can be certain that
      </pre>
    </blockquote>
    <pre wrap="">these
    </pre>
    <blockquote type="cite">
      <pre wrap="">functions execute in sequence :-}
      </pre>
    </blockquote>
    <pre wrap="">  Databases ensure transactional consistency.  This is the job of a
database.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Yes, very true - so it is conveivably possible that authorize_reply_query is
completed before my authorize_check_query has updated or inserted records.

I'm sure that there is a definitive answer to this question "Does freeradius
wait for the result of auth-check before running auth-reply?" and I am aware
that it may not be the answer that I'd hope to hear ;-)  but I'd still like
to know it, noneteheless :-D

Thanks - I really do appreciate any comments!

Regards,  Mike.




-
List info/subscribe/unsubscribe? See <a class="moz-txt-link-freetext" href="http://www.freeradius.org/list/users.html">http://www.freeradius.org/list/users.html</a>

  </pre>
</blockquote>
</body>
</html>