- username[0] = 0;
- if ( ++count == 3 ) {
- syslog ( LOG_WARNING, "invalid password for `%s'%s\n", pw->pw_name, fromhost);
- return EXIT_FAILURE;
- }
- }
-
- alarm ( 0 );
- if ( check_nologin ( pw-> pw_uid == 0 ))
- return EXIT_FAILURE;
-
-#ifdef CONFIG_FEATURE_U_W_TMP
- setutmp ( username, tty );
-#endif
-#ifdef CONFIG_SELINUX
- if (flask_enabled)
- {
- struct stat st;
-
- if (get_default_sid(username, 0, &sid))
- {
- fprintf(stderr, "Unable to get SID for %s\n", username);
- exit(1);
- }
- if (stat_secure(tty, &st, &old_tty_sid))
- {
- fprintf(stderr, "stat_secure(%.100s) failed: %.100s\n", tty, strerror(errno));
- return EXIT_FAILURE;
- }
- if (security_change_sid (sid, old_tty_sid, SECCLASS_CHR_FILE, &new_tty_sid) != 0)
- {
- fprintf(stderr, "security_change_sid(%.100s) failed: %.100s\n", tty, strerror(errno));
- return EXIT_FAILURE;
- }
- if(chsid(tty, new_tty_sid) != 0)
- {
- fprintf(stderr, "chsid(%.100s, %d) failed: %.100s\n", tty, new_tty_sid, strerror(errno));