What's the rationale for needing these ?  I can make sense of the need for shadow, given that it does vary; but passwd and group are either in the usual place or unknown/absent, so I don't see a need to make variables of them.  Is it easier to test empty string rather than absent file ?