chalcy0n/pam_tacplus — pull request #6 by walterdejong (2013-03-28 23:51:52+00:00)
Title: cleanup stuff

Hi Jeroen,

I did some work, like:
* things like extern decls and function prototypes go best in a header file
* platform-dependent ifdefs are really bad because they are dreadful to maintain. They don't hold up well because platforms change all the time. For example, OSX (FreeBSD/darwin based) does have /dev/urandom but pam_tacplus is not using it. (And it's doubtful that using /dev/urandom rather than random() makes a significant difference at all). Anyway, you can usually work around platform-dependant ifdefs in another way. Avoid at all costs
* there were two xcalloc() functions both doing the same thing
* allocating memory and not free-ing it causes leaks ... I changed some vars to static buffers just to make the code easier + more robust
* tac_srv[] and tac_srv_key[] worked "in tandem", so they are now combined in an array tac_srv[] of struct tacplus_server_t { address, key }

Please pull, enjoy && greets,

--Walter