[Tinymux] Avoiding soft code exploits (with semaphores?)

Sandi Fallon sandif at townisp.com
Mon Jun 27 13:27:04 EDT 2005


<SNIP>

Same answer as Alex. Slightly different code. :)


&DO_GOOSE MTO=
    $+goose *:think pemit(%#,

        ifelse(get(%#/gooses_left),
        
           ifelse(setr(0,pmatch(%0)),
        
               iflese(match(get(%#/already_goosed),%q0),

                   You already goosed name(%q0).  You can only goose someone once.,
      
               [set(%#,already_goosed:[get(%#/already_goosed)] %q0)]
               [set(%#,gooses_left:[dec(get(%#/gooses_left))])]
               [pemit(%q0,%N just goosed you!)]
               You goose name(%q0).),
      
           I can't find anyone by that name.),
 
       You are out of gooses.))


Note, I don't have a MUX2 handy, this is off the top of my head and likely dated,
so something there may not work (like, name() might want []'s). I kept the duped
get()s for readability, but in anything more complicated, use setr's as Alex did.


HTH,
Sandi



More information about the Tinymux mailing list