+Wed Sep 27 18:36:06 1995 Theodore Y. Ts'o <tytso@dcl>
+
+ * gss-client.c (main): Set display_file to be stdout.
+
+ * gss-server.c (main): Set display_file to 0 if using inetd;
+ otherwise, set it to be stdout.
+
+ * gss-misc.c (send_token, recv_token, display_status): If
+ display_file is null, don't set it to stderr; just don't
+ print the log message instead. Needed for inetd operation.
+
Sat Sep 16 03:34:59 1995 Theodore Y. Ts'o <tytso@dcl>
* gss-server.c (sign_server): Only try using gss_export_context
{
int len, ret;
- if (display_file == 0)
- display_file = stderr;
-
len = htonl(tok->length);
ret = write(s, (char *) &len, 4);
perror("sending token length");
return -1;
} else if (ret != 4) {
- fprintf(display_file,
- "sending token length: %d of %d bytes written\n",
- ret, 4);
+ if (display_file)
+ fprintf(display_file,
+ "sending token length: %d of %d bytes written\n",
+ ret, 4);
return -1;
}
perror("sending token data");
return -1;
} else if (ret != tok->length) {
- fprintf(display_file,
- "sending token data: %d of %d bytes written\n",
- ret, tok->length);
- return -1;
+ if (display_file)
+ fprintf(display_file,
+ "sending token data: %d of %d bytes written\n",
+ ret, tok->length);
+ return -1;
}
return 0;
int ret;
int readsofar = 0;
- if (display_file == 0)
- display_file = stderr;
-
ret = read(s, (char *) &tok->length, 4);
if (ret < 0) {
perror("reading token length");
return -1;
} else if (ret != 4) {
- fprintf(display_file,
- "reading token length: %d of %d bytes read\n",
- ret, 4);
- return -1;
+ if (display_file)
+ fprintf(display_file,
+ "reading token length: %d of %d bytes read\n",
+ ret, 4);
+ return -1;
}
tok->length = ntohl(tok->length);
tok->value = (char *) malloc(tok->length);
if (tok->value == NULL) {
- fprintf(display_file,
- "Out of memory allocating token data\n");
+ if (display_file)
+ fprintf(display_file,
+ "Out of memory allocating token data\n");
return -1;
}
int msg_ctx;
#endif /* GSSAPI_V2 */
- if (display_file == 0)
- display_file = stderr;
-
msg_ctx = 0;
while (1) {
maj_stat = gss_display_status(&min_stat, code,
type, GSS_C_NULL_OID,
&msg_ctx, &msg);
- fprintf(display_file, "GSS-API error %s: %s\n", m,
- (char *)msg.value);
+ if (display_file)
+ fprintf(display_file, "GSS-API error %s: %s\n", m,
+ (char *)msg.value);
(void) gss_release_buffer(&min_stat, &msg);
if (!msg_ctx)
int once = 0;
log = stdout;
+ display_file = stdout;
argc--; argv++;
while (argc) {
if (strcmp(*argv, "-port") == 0) {
port = atoi(*argv);
} else if (strcmp(*argv, "-inetd") == 0) {
do_inetd = 1;
+ display_file = 0;
} else if (strcmp(*argv, "-v2") == 0) {
dov2 = 1;
} else if (strcmp(*argv, "-once") == 0) {