コード例 #1
0
ファイル: pure-pw.c プロジェクト: jhoblitt/pure-ftpd-old
static char *do_get_passwd(void)
{
    static char pwd[LINE_MAX];
    char pwd2[LINE_MAX];    
    int tries = MAX_PASSWD_CHANGE_TRIES;
       
    *pwd = 0;
    *pwd2 = 0;
    
    again:
    printf("Password: "******"\nEnter it again: ");
    fflush(stdout);
    disable_echo();
    if (fgets(pwd2, (int) (sizeof pwd2 - 1U), stdin) == NULL) {
        enable_echo();
        return NULL;
    }
    strip_lf(pwd2);
    puts("");
    if (strcmp(pwd, pwd2) != 0) {
        if (*pwd2 != 0) {
            memset(pwd2, 0, strlen(pwd2));
        }
        if (*pwd != 0) {
            memset(pwd, 0, strlen(pwd));
        }
        puts("You didn't enter the same password");
        if (--tries > 0) {
            goto again;
        }
        enable_echo();
        
        return NULL;
    }
    if (*pwd2 != 0) {
        memset(pwd2, 0, strlen(pwd2));
    }
    enable_echo();
    
    return pwd;
}
コード例 #2
0
ファイル: helpers.c プロジェクト: 01BTC10/blobcrypt
int
get_password(char *pwd, size_t max_len, const char *prompt)
{
    int ret;

    disable_echo();
    ret = get_line(pwd, max_len, prompt);
    enable_echo();

    return ret;
}
コード例 #3
0
ファイル: console.c プロジェクト: amrsekilly/quafios
void console_black() {

    int i, j;
    for (i = 0; i < rows; i++) {
        for (j = 0; j < cols; j++) {
            setCharAtOff(i, j, ' ');
            setAttrAtOff(i, j, 0x0F);
        }
    }
    setCursor(0, 0);
    enable_echo();
    enable_buf();
}
コード例 #4
0
ファイル: library.c プロジェクト: D-Land/operating-systems
void exit_graphics(){
  munmap(addr, map_size);
  close(fd);
  enable_echo();
}