From d29092f4048628c249bff9025550f8ab243a0904 Mon Sep 17 00:00:00 2001 From: Thomas Osterried Date: Sat, 15 Apr 2006 17:26:36 +0000 Subject: \n problem in in the bcpasswd part while sending messages intr = ^C as stty setting --- ax25/access.c | 32 ++++++++++++++++---------------- ax25/axspawn.c | 12 ++++++------ 2 files changed, 22 insertions(+), 22 deletions(-) (limited to 'ax25') diff --git a/ax25/access.c b/ax25/access.c index 0a54bd4..51e75ce 100644 --- a/ax25/access.c +++ b/ax25/access.c @@ -130,7 +130,7 @@ void ask_pw_sys(char *prompt, char *pass_want, char *pw) // and terminate the string pass_want[i] = 0; - sprintf(buffer, "\n%s> %d %d %d %d %d\n", prompt, five_digits[0], five_digits[1], five_digits[2], five_digits[3], five_digits[4]); + sprintf(buffer, "\r%s> %d %d %d %d %d\r", prompt, five_digits[0], five_digits[1], five_digits[2], five_digits[3], five_digits[4]); write_ax25(buffer, strlen(buffer), 1); } @@ -162,7 +162,7 @@ void ask_pw_md5(char *prompt, char *pass_want, char *pw) challenge = generate_rand_pw(SALT_LEN); // ask for proper response to this challenge: - sprintf(buffer, "\n%s> [%s]\n", prompt, challenge); + sprintf(buffer, "\r%s> [%s]\r", prompt, challenge); write_ax25(buffer, strlen(buffer), 1); // compute md5 challenge calc_md5_pw(challenge, key, cipher); @@ -259,39 +259,39 @@ char *read_pwd (struct passwd *pw, int *pwtype) pwfile[sizeof(pwfile)-1] = 0; if (stat(pwfile, &statbuf)) { - sprintf(buf, "Notice: No .%s file found in your homedirectory (for more secure\n", PWFILE); + sprintf(buf, "Notice: No .%s file found in your homedirectory (for more secure\r", PWFILE); write_ax25(buf, strlen(buf), 1); - sprintf(buf, " password authentication than plaintext). Generating example file,\n"); + sprintf(buf, " password authentication than plaintext). Generating example file,\r"); write_ax25(buf, strlen(buf), 1); - sprintf(buf, " with unique passwords (which may be changed).\n"); + sprintf(buf, " with unique passwords (which may be changed).\r"); write_ax25(buf, strlen(buf), 1); - sprintf(buf, " Please edit ~/.%s, and enable your prefered authentication type;\n", PWFILE); + sprintf(buf, " Please edit ~/.%s, and enable your prefered authentication type;\r", PWFILE); write_ax25(buf, strlen(buf), 1); - sprintf(buf, " MD5 is recommended.\n"); + sprintf(buf, " MD5 is recommended.\r"); write_ax25(buf, strlen(buf), 1); write_example_passwd(pwfile, pwlocation, pw); goto end; } if (!S_ISREG(statbuf.st_mode)) { - sprintf(buf, "Error: password file .%s should be a regular file. Skiping..\n", PWFILE); + sprintf(buf, "Error: password file .%s should be a regular file. Skiping..\r", PWFILE); write_ax25(buf, strlen(buf), 1); goto end; } if (statbuf.st_uid != 0 && statbuf.st_uid != pw->pw_uid) { - sprintf(buf, "Error: your password file .%s is not owned by you. Skiping..\n", PWFILE); + sprintf(buf, "Error: your password file .%s is not owned by you. Skiping..\r", PWFILE); write_ax25(buf, strlen(buf), 1); goto end; } if ((statbuf.st_mode & (S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH))) { - sprintf(buf, "WARNING: your password file .%s has wrong permissions.\n", PWFILE); + sprintf(buf, "WARNING: your password file .%s has wrong permissions.\r", PWFILE); write_ax25(buf, strlen(buf), 1); - sprintf(buf, " Please change it with\n"); + sprintf(buf, " Please change it with\r"); write_ax25(buf, strlen(buf), 1); - sprintf(buf, " chmod 600 .%s\n", PWFILE); + sprintf(buf, " chmod 600 .%s\r", PWFILE); write_ax25(buf, strlen(buf), 1); - sprintf(buf, " and don't forget to change your password stored in .%s\n", PWFILE); + sprintf(buf, " and don't forget to change your password stored in .%s\r", PWFILE); write_ax25(buf, strlen(buf), 1); - sprintf(buf, " because it may be compromised.\n"); + sprintf(buf, " because it may be compromised.\r"); write_ax25(buf, strlen(buf), 1); /* go on.. if user takes no action, he always gets this message */ } @@ -311,7 +311,7 @@ char *read_pwd (struct passwd *pw, int *pwtype) is disabled by administrative configuration. */ if (!((*pwtype) & PW_CLEARTEXT)) { - sprintf(buf, "Failed to find a suitable password in %s\n", pwfile); + sprintf(buf, "Failed to find a suitable password in %s\r", pwfile); write_ax25(buf, strlen(buf), 1); } goto end; @@ -363,7 +363,7 @@ found: len = strlen(pass); if ((*pwtype == PW_SYS && len < MINPWLEN_SYS) || (*pwtype == PW_MD5 && len < MINPWLEN_MD5)) { - sprintf(buf, "Password in in password file too short\n"); + sprintf(buf, "Password in in password file too short\r"); write_ax25(buf, strlen(buf), 1); goto end; } diff --git a/ax25/axspawn.c b/ax25/axspawn.c index 0f55abc..1067599 100644 --- a/ax25/axspawn.c +++ b/ax25/axspawn.c @@ -1,6 +1,6 @@ /* * - * $Id: axspawn.c,v 1.5 2006/04/09 11:49:21 dl9sau Exp $ + * $Id: axspawn.c,v 1.6 2006/04/15 17:26:36 dl9sau Exp $ * * axspawn.c - run a program from ax25d. * @@ -1521,7 +1521,7 @@ again: cnt = read_ax25(buf, sizeof(buf)-1); if (cnt <= 0) { - sprintf(buf,"no response\n"); + sprintf(buf,"no response\r"); write_ax25(buf, strlen(buf),1); sleep (EXITDELAY); return -11; @@ -1534,7 +1534,7 @@ again: goto again; } if (!strstr(buf, pass_want)) { - sprintf(buf,"authentication failed\n"); + sprintf(buf,"authentication failed\r"); write_ax25(buf, strlen(buf), 1); sleep (EXITDELAY); return -11; @@ -1542,7 +1542,7 @@ again: free(pwd); } else { if (pw->pw_uid == 0 || pw->pw_gid == 0) { - sprintf(buf, "Sorry, root logins are only allowed with md5- or baycom-password!\n"); + sprintf(buf, "Sorry, root logins are only allowed with md5- or baycom-password!\r"); write_ax25(buf, strlen(buf), 1); syslog(LOG_NOTICE, "root login of %s (callsign: %s) denied (only with md5- or baycom-Login)!\n", user, call); sleep(EXITDELAY); @@ -1592,7 +1592,7 @@ again: termios.c_oflag = OPOST | ONLCR; termios.c_cflag = CS8 | CREAD | CLOCAL; termios.c_lflag = ISIG | ICANON; - termios.c_cc[VINTR] = 127; + termios.c_cc[VINTR] = /* 127 */ 0x03; termios.c_cc[VQUIT] = 28; termios.c_cc[VERASE] = 8; termios.c_cc[VKILL] = 24; @@ -1757,8 +1757,8 @@ again: } else { - syslog(LOG_ERR, "cannot fork %m, closing connection to %s\n", call); write_ax25(MSG_CANNOTFORK, sizeof(MSG_CANNOTFORK), 1); + syslog(LOG_ERR, "cannot fork %m, closing connection to %s\n", call); sleep(EXITDELAY); return 1; } -- cgit v1.2.3