return 1;
}
-int
+static void
dumpBytes (unsigned short len, char *data)
{
unsigned short i;
dumpAuth (auth); /* does Debug only */
}
- if (doWrite)
+ if (doWrite) {
if (!XauWriteAuth (file, auth) || fflush (file) == EOF) {
LogError(
ReadCatalog(MC_LOG_SET,MC_LOG_SRV_WRT,MC_DEF_LOG_SRV_WRT),
return 0;
}
else
+ {
return 1;
+ }
+ }
+ return 1;
}
static void
}
close (client_fd);
+ return 1;
}
void
}
if (!XdmcpAllocARRAY8 (&new->hostaddr, hostAddr.length))
{
- free ((char *) new->fullname);
free ((char *) new);
return 0;
}
addr = (struct sockaddr *) &in_addr;
len = sizeof (in_addr);
break;
+ default:
+ fprintf (stderr, "Unhandled protocol family %d\n", family);
+ exit (REMANAGE_DISPLAY);
}
if ((fd = socket (family, SOCK_STREAM, 0)) == -1)
{
TrimErrorFile( void )
{
- int f1, f2;
+ int f1 = -1;
+ int f2 = -1;
int deleteBytes;
char buf[BUFSIZ];
LogError(ReadCatalog(MC_LOG_SET,MC_LOG_MISS_TYPE,MC_DEF_LOG_MISS_TYPE),
args[0]);
freeArgs (args);
+ free(name);
return 0;
}
}
cryptoInited = 1;
+
+ return 1;
}
#endif /* HASXDMAUTH */
#endif
ret = AcceptableDisplayAddress (addr, connectionType, type);
if (!ret)
- sprintf (statusBuf, "Display not authorized to connect");
+ snprintf (statusBuf, sizeof(statusBuf), "Display not authorized to connect");
else
- sprintf (statusBuf, "%s", WillingMsg());
+ snprintf (statusBuf, sizeof(statusBuf), "%s", WillingMsg());
#if 0
- sprintf (statusBuf, "host %s", localHostname());
+ snprintf (statusBuf, sizeof(statusBuf), "host %s", localHostname());
#endif
+ /* enforce termination */
+ statusBuf[255] = '\0';
- status->length = strlen (statusBuf);
+ status->length = strlen(statusBuf);
status->data = (CARD8Ptr) malloc (status->length);
if (!status->data)
status->length = 0;
LoadXloginResources( struct display *d )
{
char cmd[1024];
- char *language="";
+ char *language = NULL;
char *lang_key="";
char *authority="";
char *auth_key="";
char *path;
struct greet_state state = {};
int notify_dt;
+ int dupfp = -1;
+ int dupfp2 = -1;
#ifdef __PASSWD_ETC
# ifndef U_NAMELEN
* Writing to file descriptor 1 goes to response pipe instead.
*/
close(1);
- if(-1 == dup(response[1])) {
+ dupfp = dup(response[1]);
+ if(-1 == dupfp) {
perror(strerror(errno));
}
close(response[0]);
* Reading from file descriptor 0 reads from request pipe instead.
*/
close(0);
- if(-1 == dup(request[0])) {
+ dupfp2 = dup(request[0]);
+ if(-1 == dupfp2) {
perror(strerror(errno));
}
close(request[0]);
XmFONTLIST_DEFAULT_TAG));
string = XmStringConcat(xmstr, XmStringSeparatorCreate());
}
+
+ fclose(fp);
}
else
{