/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI"
#include <unistd.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include <string.h>
#include <fcntl.h>
#include "ttymon.h"
#include "tmstruct.h"
#include "tmextern.h"
/*
* check_device - check to see if the device exists,
* - and if it is a character device
* - return 0 if everything is ok. Otherwise, return -1
*/
int
{
log("error -- device field is missing");
return(-1);
}
if (*device != '/') {
return(-1);
}
return(-1);
}
log("error -- \"%s\" not character special device",
device);
return(-1);
}
}
else {
return(-1);
}
return(0);
}
/*
* check_cmd - check to see if the cmd file exists,
* - and if it is executable
* - return 0 if everything is ok. Otherwise, return -1
*/
int
{
log("error -- server command is missing");
return(-1);
}
if (*tp != '/') {
return(-1);
}
return(-1);
}
return(-1);
}
return(-1);
}
}
else {
return(-1);
}
return(0);
}
/*
* strcheck(sp, flag) - check string
* - if flag == ALNUM, all char. are expected to
* be alphanumeric
* - if flag == NUM, all char. are expected to
* be digits and the number must be >= 0
* - return 0 if successful, -1 if failed.
*/
int
char *sp; /* string ptr */
int flag; /* either NUM or ALNUM */
{
register char *cp;
return(-1);
}
}
}
else { /* (flag == ALNUM) */
return(-1);
}
}
}
return(0);
}
/*
* vml(modules) - validate a list of modules
* - return 0 if successful, -1 if failed
*/
int
char *modules;
{
int i, fd;
return(0);
log("vml: malloc failed");
return (-1);
};
/*
* pull mod names out of comma-separated list
*/
if ( i >= NSTRPUSH) {
i = -1;
break;
}
}
if (i == -1)
return (-1);
/*
* Is it a valid list of modules?
*/
return(0);
}
return(-1);
}
log("Validate modules ioctl failed, modules = <%s>: %s",
return(-1);
}
if ( i != 0 ) {
return(-1);
}
return(0);
}
/*
* copystr(s1, s2) - copy string s2 to string s1
* - also put '\' in front of ':'
*/
void
{
while (*s2) {
if (*s2 == ':') {
*s1++ = '\\';
}
}
*s1 = '\0';
}
/*PRINTFLIKE1*/
void
{
int fd;
}