cprintf("1\n"); /* 1 = yes, this system supports floors */
cprintf("1\n"); /* 1 = we support the extended paging options */
cprintf("%s\n", CC->cs_nonce);
+ cprintf("1\n"); /* 1 = yes, this system supports the QNOP command */
cprintf("000\n");
}
/*
* Let other clients see the last command we executed, and
- * update the idle time, but not NOOP, PEXP, or GEXP.
+ * update the idle time, but not NOOP, QNOP, PEXP, or GEXP.
*/
if ( (strncasecmp(cmdbuf, "NOOP", 4))
+ && (strncasecmp(cmdbuf, "QNOP", 4))
&& (strncasecmp(cmdbuf, "PEXP", 4))
&& (strncasecmp(cmdbuf, "GEXP", 4)) ) {
strcpy(CC->lastcmdname, " ");
if (!strncasecmp(cmdbuf,"NOOP",4)) {
cprintf("%d%cok\n",CIT_OK,CtdlCheckExpress());
}
+
+ else if (!strncasecmp(cmdbuf,"QNOP",4)) {
+ /* do nothing, this command returns no response */
+ }
else if (!strncasecmp(cmdbuf,"QUIT",4)) {
cprintf("%d Goodbye.\n",CIT_OK);
extern int rc_ansi_color;
extern int rc_prompt_control;
-void back(int spaces) /* Destructive backspace */
- {
+/* Destructive backspace */
+void back(int spaces) {
int a;
- for (a=1; a<=spaces; ++a) {
- scr_putc(8); scr_putc(32); scr_putc(8);
- }
+ for (a=0; a<spaces; ++a) {
+ scr_putc(8);
+ scr_putc(32);
+ scr_putc(8);
}
+}
void hit_any_key(void) { /* hit any key to continue */
int a,b;
serv_gets(buf);
if (buf[0]!='2') {
scr_printf("%s\n",&buf[4]);
- }
}
+}
int set_attr(int sval, char *prompt, unsigned int sbit)
temp=(temp|sbit);
if (!a) temp=(temp^sbit);
return(temp);
- }
+}
/*
* modes are: 0 - .EC command, 1 - .EC for new user,
if (buf[0]!='2') {
scr_printf("%s\n",&buf[4]);
return;
- }
+ }
width = extract_int(&buf[4],0);
height = extract_int(&buf[4],1);
if (c<0) {
string[a]=0;
return(-1);
- }
+ }
string[a++]=c;
- } while(c!=10);
+ } while(c!=10);
string[a-1]=0;
- } while(string[0]=='#');
+ } while(string[0]=='#');
return(strlen(string));
- }
+}
-int pattern(char *search, char *patn) /* Searches for patn in search string */
-
-
-{
+
+/* Searches for patn in search string */
+int pattern(char *search, char *patn) {
int a,b;
- for (a=0; a<strlen(search); ++a)
- { b=strncasecmp(&search[a],patn,strlen(patn));
+
+ for (a=0; a<strlen(search); ++a) {
+ b=strncasecmp(&search[a],patn,strlen(patn));
if (b==0) return(b);
- }
+ }
return(-1);
}
-void interr(int errnum) /* display internal error as defined in errmsgs */
- {
+
+/* display internal error as defined in errmsgs */
+void interr(int errnum) {
scr_printf("*** INTERNAL ERROR %d\n"
"(Press any key to continue)\n", errnum);
inkey();
logoff(errnum);
}
-
-
void strproc(char *string)
{
int a;
for (a=0; a<strlen(string); ++a) {
if (string[a]<32) string[a]=32;
if (string[a]>126) string[a]=32;
- }
+ }
/* Remove leading and trailing blanks */
while(string[0]<33) strcpy(string,&string[1]);
if ((string[a]==32)&&(string[a+1]==32)) {
strcpy(&string[a],&string[a+1]);
a=0;
- }
}
+ }
/* remove characters which would interfere with the network */
for (a=0; a<strlen(string); ++a) {
if (string[a]==',') strcpy(&string[a],&string[a+1]);
if (string[a]=='%') strcpy(&string[a],&string[a+1]);
if (string[a]=='|') strcpy(&string[a],&string[a+1]);
- }
-
}
+}
+
#ifndef HAVE_STRERROR
/*
snprintf(buf, sizeof buf, "errno = %d",e);
return(buf);
- }
+}
#endif
scr_printf(".......................................\r");
scr_flush();
dots_printed = 0;
- }
+ }
else if (curr==cmax) {
scr_printf("\r%79s\n","");
- }
+ }
else {
a=(curr * 100) / cmax;
a=a*78; a=a/100;
scr_printf("*");
++dots_printed;
scr_flush();
- }
}
}
+}
/*
if (who==NULL) {
strcpy(hbuf,serv_info.serv_fqdn);
return;
- }
+ }
fgets(buf,sizeof buf,who);
pclose(who);
b = 0;
for (a=0; a<strlen(buf); ++a) {
if ((buf[a]=='(')||(buf[a]==')')) ++b;
- }
+ }
if (b<2) {
strcpy(hbuf,serv_info.serv_fqdn);
return;
- }
+ }
for (a=0; a<strlen(buf); ++a) {
if (buf[a]=='(') {
strcpy(buf,&buf[a+1]);
- }
}
+ }
for (a=0; a<strlen(buf); ++a) {
if (buf[a]==')') buf[a] = 0;
- }
+ }
if (strlen(buf)==0) strcpy(hbuf,serv_info.serv_fqdn);
else strncpy(hbuf,buf,24);
fail:
safestrncpy(hbuf, serv_info.serv_fqdn, 24);
return;
- }
+ }
if (strncmp(tty, "/dev/", 5))
goto fail;
#endif
safestrncpy(hbuf, put->ut_line, 24);
#if defined(HAVE_UT_TYPE) || defined(HAVE_GETUTXLINE)
- }
+ }
else goto fail;
#endif
#endif /* HAVE_UTMP_H */
- }
+}
/*
* miscellaneous server commands (testing, etc.)
serv_gets(buf);
scr_printf("%s\n",buf);
if (buf[0]=='1') {
- set_keepalives(KA_NO);
+ set_keepalives(KA_HALF);
while (serv_gets(buf), strcmp(buf,"000")) {
scr_printf("%s\n",buf);
- }
+ }
set_keepalives(KA_YES);
return;
- }
+ }
if (buf[0]=='4') {
do {
newprompt("> ",buf,255);
serv_puts(buf);
- } while(strcmp(buf,"000"));
+ } while(strcmp(buf,"000"));
return;
- }
}
+}
/*
*/
while (ch=getc(fp), ch>=0) {
cksum = (cksum + ch);
- }
+ }
fclose(fp);
return(cksum);
- }
+}
/*
* nuke a directory and its contents
dp = opendir(dirname);
if (dp == NULL) {
return(errno);
- }
+ }
while (d = readdir(dp), d != NULL) {
- snprintf(filename, sizeof filename, "%s/%s", dirname, d->d_name);
+ snprintf(filename, sizeof filename, "%s/%s",
+ dirname, d->d_name);
unlink(filename);
- }
+ }
closedir(dp);
return(rmdir(dirname));
- }
+}
Line 13 - The "nonce" for this session, for support of APOP-style
authentication. If this field is present, clients may authenticate
in this manner.
+ Line 14 - Set to nonzero if this server supports the QNOP command.
*** NOTE! *** The "server type" code is intended to promote global
compatibility in a scenario in which developers have added proprietary
is the type of view requested. VIEW returns OK on success or ERROR on failure.
+ QNOP (Quiet No OPeration)
+
+ This command does nothing, similar to the NOOP command. However, unlike the
+NOOP command, it returns *absolutely no response* at all. The client has no
+way of knowing that the command executed. It is intended for sending
+"keepalives" in situations where a full NOOP would cause the client protocol
+to get out of sync.
+
+ Naturally, sending this command to a server that doesn't support it is an
+easy way to mess things up. Therefore, client software should first check
+the output of an INFO command to ensure that the server supports quiet noops.
+
+
ASYN (ASYNchronous message support)
Negotiate the use of asynchronous, or unsolicited, protocol messages. The