70ad75f worker: sanity test libc passwd entries

Authored and Committed by rstrode 11 years ago
    worker: sanity test libc passwd entries
    
    getpwnam returns a structure filled in by nsswitch modules.
    Those modules aren't always bug free, and can sometimes return
    e.g. an empty user's shell.
    
    When that happens the failure is pretty catastrophic and hard to
    debug.
    
    This commit does a quick sanity check of the user's home directory
    and shell to make sure they're not empty.
    
    If they are empty it picks defaults that are likely to at least
    sort of work.
    
    A better fix would probably be to fail earlier and post a message
    to the user explaining why login won't work, but this is good
    enough for now.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=685423
    (cherry picked from commit c10f6c45bcc610030e127b005544d84a53831edd)
    
        
file modified
+10 -2