On Saturday 14 November 2009, Jérémy Bobbio wrote: > get_release() calls validate_codename() and validate_codename() calls > get_release(). I like mutually recursive functions in Haskell, but > it might be better to avoid them in C, I'd say. ;)
I've looked if this can be a problem. Below the cases I've identified (and tested). The notation is as follows: - A -> B : A is a symlink to directory B - A : X/Y : directory A has a Release file with Suite: X, Codename: Y 1) stable -> lenny; lenny : stable/lenny => normal situation, cannot recurse 2) lenny : (old)stable/lenny => normal situation for archive.d.o, no problem 3) karmic : karmic/karmic => valid mirror; will never call validate_codename() 4) testing -> lenny; lenny : stable/lenny => bad mirror from reading testing/Release; will never call validate_codename() 5) testing -> lenny; lenny : testing/XXXXX => bad mirror from reading lenny/Release after calling validate_codename() 6) testing : XXXXX/testing => will use testing as codename; will never call validate_codename() 7) stable : XXXXX/testing => bad mirror from reading stable/Release; will never call validate_codename() The next two cases are for extremely (deliberately) broken mirrors. Only the last one is problematic, but that is so broken that I don't think we need to allow for that. 8) stable : stable/testing; testing -> squeeze; squeeze : testing/squeeze => will recurse into validate_codename() twice; fails after reading squeeze/Release 9) stable : stable/testing; testing -> testing/stable => this produces an endless recursion! Cases where either Suite or Codename are missing ================================================ In these case validate_codename() can never be called. 1) XXXXX: XXXXX/--- or XXXXX: ---/XXXXX => no problem: will set 'XXXXX' as both suite and codename 3) XXXXX: YYYYY/--- or XXXXX: ---/YYYYY => bad mirror If anyone can think of any cases I've missed, let me know. Cheers, FJP
signature.asc
Description: This is a digitally signed message part.