JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for MOONSHOT-DEV Archives


MOONSHOT-DEV Archives

MOONSHOT-DEV Archives


MOONSHOT-DEV@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

MOONSHOT-DEV Home

MOONSHOT-DEV Home

MOONSHOT-DEV  May 2017

MOONSHOT-DEV May 2017

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Another confusing piece of code in trustrouter.c

From:

Alejandro Pérez Méndez <[log in to unmask]>

Date:

Fri, 5 May 2017 13:56:21 +0200

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (46 lines)

Hi guys,

while we discuss the other bug, I have another question:
In the "update_required()" call, we have the following check:


         /*
          *    If we've opened in the last 10 minutes, then
          *    open rather than update.
          */
         if ((now - server->last_failed_open) > 600) {
             return false;
         }

Now, this seems to do exactly the opposite as stated in the comment. If 
the server failed in the last 10 minutes (that is, (now - 
server->last_failed_open) <= 600), then the code returns true (well, it 
does not return false, but this is the last check so it will indeed 
return true). True here means update. So probably the comment needs to 
be updated.

The other problem I see is: What happens if the error happened more than 
10 minutes ago? It seems that "update_required()" will return false, and 
the REALM will never be updated (leading to user authentication errors 
with no reason). I know this is unlikely since we probably will try to 
query for a realm again within that 10 minutes, but it seems to be 
possible under certain circumstances.

If the purpose of the code was to check whether there was an error and 
update the REALM in such a case, why not using the following check instead?

         /*
          *    If the REALM did not fail, open rather than update
          */
         if (server->last_packet_recv > server->last_failed_open){
             return false;
         }

Unless I'm wrong, this code seems to have a similar effect but without 
having the 10 minute limitation (note that when a realm is created, 
last_packet_recv is set to the current time, so at creation time, it 
will always be > than last_failed_open).

Regards,
Alejandro

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

April 2024
March 2022
December 2021
October 2021
September 2021
August 2021
June 2021
April 2021
February 2021
January 2021
December 2020
November 2020
October 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
December 2019
November 2019
October 2019
September 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
April 2018
February 2018
January 2018
December 2017
November 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
February 2017
January 2017
December 2016
October 2016
September 2016
August 2016
June 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
August 2015
July 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager