/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "uucp.h"
#include <grp.h>
#define G_EXT 0
#define TYPE 0
extern void wfcommit();
static void mailAdmin(); /* Send mail to administrator. */
/*
* chkgrp - checks to see the group has permission
* to use a service grade queue.
*
* returns
*
* SUCCESS - if the group has permissions
* FAIL - if group does not
*
*/
static int
char **carray;
int na;
{
int i;
return(SUCCESS);
return(FAIL);
}
/*
* chkusr - checks the permission fields of the Grades file
* to determine if the user can queue to a particular service grade.
*
* returns
*
* SUCCESS - if the user can queue to the service grade.
* FAIL - if the user can not queue to this service grade.
*
*/
static int
char **carray;
int na;
{
int i;
/*
* start at the point where the users are supposed to be in the
* Grades file. Loop thru until the end of the user list is
* found or the user name is found. If the user name is found then
* return TRUE. If the end of the list is found, return FAIL.
*/
/* check for any user and return if so */
return(SUCCESS);
return(SUCCESS);
}
return(FAIL);
}
/*
* fgrade - finds the appropiate queue to queue a job into
*
* returns
* SUCCESS -> found a queue
* FAIL -> can't find a queue
*/
int
{
char fdgrade();
long climit;
/* Check for the default service grade first */
return(SUCCESS);
}
/* open grades file to begin a linear for the grade requested */
/* loop until the file is empty or we find the grade we want */
/* check to see if this is the grade we want */
continue;
return(SUCCESS);
}
}
" exceeds maximum number of bytes (%ld bytes)"
" allowed into this service grade (%s).\n"
"Job queued to default grade.\n"),
return(SUCCESS);
}
/*
* fdgrade - finds the default queue for this system
*
* returns
* a one char name for the default queue
*
*/
char
fdgrade()
{
/* Check for the default grade first */
/* loop until the end of the file is read */
/* parse the fields of this line */
/* check to see if the administrator has defined
* a default grade for the machine.
*/
continue;
/* default must be defined in the file
* close the file, get the queue name, and return.
*/
}
/* no default defined in this file. close file.
* get our default queue and return.
*/
return(D_QUEUE);
}
/*
* job_size - determines the size of a job
*
* returns
*
* SUCCESS - if the size of the job can be determined
* FAIL - otherwise
*/
int
{
extern int Dfileused;
struct stat s;
int na;
int ret;
}
if (na < 6) {
}
/* if the type of a transfer is not a push
* then don't try to determine the size of
* the data file, because you can't.
*/
continue;
/* find the data dile that is to be transferred */
}
}
else
/*
* check to see if the return code from stat was 0
* if return code was not 0, write message to error
* log and quit. Otherwise, add size of file to job
* size and continue looping.
*/
if (ret != 0) {
}
}
return(SUCCESS);
}
static void lcase();
/*
* jsize - determines whether if a job is small enough to
* be placed in the appropiate queue.
*
* returns
*
* SUCCESS - if the size of the job is less than or
* equal to the number of bytes in the restriction
* of the GRADES file.
*
* FAIL - otherwise
*/
int
char *climit;
long *nlimit;
{
return(SUCCESS);
for(p = climit; *p; ++p) {
if (isdigit(*p))
continue;
/* corrupt restriction field in the Grades file.
* report it to the uucp administrator.
*/
gettext("Error encountered in the"
" restrictions field of the Grades file."
" Field contents (%s)."), climit);
return(SUCCESS);
}
}
else if (*p == 'k') {
*p = '\0';
}
else {
*p = '\0';
}
return(SUCCESS);
else
return(FAIL);
}
static void
char s[], t[];
int lim;
{
char *p;
int i;
p = s;
for (i = 0; i < lim-1 && *p; i++)
if (isupper(*p))
t[i] = tolower(*p++);
else
t[i] = *p++;
t[i] = '\0';
return;
}
/*
* mailAdmin - mail a message to the uucp administrator.
*
* returns:
*
* nothing
*/
static void
char * msg;
{
{
}
/*
* Ignore popen failure. There is not much that we can do if
* it fails, since we are already trying to notify the administrator
* of a problem.
*/
return;
}
/*
* putdfiles - moves any and all of the D. to the spool directory for
* a C. file.
*
* returns
*
* nothing
*/
void
{
int na;
struct stat s;
}
if (na < 6) {
}
continue;
/* move D. file to the spool area */
}
return;
}
/*
* reads a line from a file and takes care of comment lines
* and continuations (\) in last column.
*
* return:
* the number of chars that are placed in line.
*/
int
char *line;
int lim;
{
register char *p, *c;
p = line;
/* check to see if it is a comment */
if (buf[0] == '#')
continue;
/* remove trailing white space */
*c-- = NULLCHAR;
continue;
if (btox <= 0)
break;
p += btox - 1;
if ( *(p-1) == '\\')
p--;
else
break;
}
*++p = '\0';
return(p-line-1);
}
/* upermit - checks to determine if the user has permissions
* to use administrator defined service grade.
*
* returns
* SUCCESS -> if the user can queue to this service grade.
* FAIL -> if the user cannot queue to this service grade.
*/
int
char **carray;
int na;
{
gettext("Error encountered in action field of"
return(FAIL);
}
/*
* vergrd - verify if the grade name is a valid administrator
* defined service grade name and if the user has the
* appropiate permission to use this grade.
*
* returns
* SUCCESS -> grade is valid and user is
* permitted to use this grade.
* FAIL -> otherwise
*
*/
int
char *grade;
{
int na;
/* Check for the default grade first */
return(SUCCESS);
/* open grades file to begin a linear for the grade requested */
/* loop until the file is empty or we find the grade we want */
/* check to see if this is the grade we want */
continue;
/* check for the permission on this grade */
return(SUCCESS);
}
else {
" permission to use this service grade (%s).\n"
"Job has not been queued.\n"
"Use (uuglist) to find which service grades"
" you can queue to.\n"), grade);
return(FAIL);
}
}
"Service grade (%s) does not exist on this machine."
" Job not queued.\n"
"Use (uuglist) to find which service grades are available on"
" this machine.\n"), grade);
return(FAIL);
}
/*
* wfremove - removes a C. file from the Workspace directory and all of its
* D. files.
*/
void
char *file;
{
int na;
struct stat s;
}
if (na < 6) {
}
continue;
/* remove D. file */
__LINE__);
}
}
}
return;
}
/*
* findgrade - finds the highest priority job grade that is not locked
* and that has jobs.
*
* job grade name is null, if no job grade is found.
*/
void
{
DIR *p, *q;
continue;
break;
}
}
}
closedir(q);
}
closedir(p);
return;
}