* SUCH DAMAGE.
*/
-#ifndef lint
-static char sccsid[] = "@(#)utilities.c 8.1 (Berkeley) 6/6/93";
-#endif /* not lint */
+/* based on @(#)utilities.c 8.1 (Berkeley) 6/6/93 */
#define TELOPTS
#define TELCMDS
if (file && (strcmp(file, "-") != 0)) {
NetTrace = fopen(file, "w");
if (NetTrace) {
- strcpy((char *)NetTraceFile, file);
+ strncpy((char *)NetTraceFile, file, sizeof(NetTraceFile) - 1);
+ NetTraceFile[sizeof(NetTraceFile) - 1] = '\0';
return;
}
fprintf(stderr, "Cannot open %s.\n", file);
}
NetTrace = stdout;
- strcpy((char *)NetTraceFile, "(standard output)");
+ strncpy((char *)NetTraceFile, "(standard output)", sizeof(NetTraceFile) - 1);
+ NetTraceFile[sizeof(NetTraceFile) - 1] = '\0';
}
void
# define min(x,y) ((x<y)? x:y)
unsigned char *pThis;
int offset;
- extern pettydump;
offset = 0;
fprintf(NetTrace, "(partial suboption??\?)");
break;
}
- fprintf(NetTrace, "%s|%s",
+ fprintf(NetTrace, "%s|%s%s",
((pointer[3] & AUTH_WHO_MASK) == AUTH_WHO_CLIENT) ?
"CLIENT" : "SERVER",
((pointer[3] & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL) ?
- "MUTUAL" : "ONE-WAY");
-
+ "MUTUAL" : "ONE-WAY",
+ ((pointer[3] & AUTH_ENCRYPT_MASK) == AUTH_ENCRYPT_ON) ?
+ "|ENCRYPT" : "");
auth_printsub(&pointer[1], length - 1, buf, sizeof(buf));
fprintf(NetTrace, "%s", buf);
break;
fprintf(NetTrace, "(partial suboption??\?)");
break;
}
- fprintf(NetTrace, "%s|%s ",
+ fprintf(NetTrace, "%s|%s%s ",
((pointer[i] & AUTH_WHO_MASK) == AUTH_WHO_CLIENT) ?
"CLIENT" : "SERVER",
((pointer[i] & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL) ?
- "MUTUAL" : "ONE-WAY");
+ "MUTUAL" : "ONE-WAY",
+ ((pointer[i] & AUTH_ENCRYPT_MASK) == AUTH_ENCRYPT_ON) ?
+ "|ENCRYPT" : "");
++i;
}
break;
break;
default:
- def_case:
if (isprint(pointer[i]) && pointer[i] != '"') {
if (noquote) {
putc('"', NetTrace);