change.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 1993 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" /* SVr4.0 1.8 */
/* EMACS_MODES: !fill, lnumb, !overwrite, !nodelete, !picture */
#include "errno.h"
#include "string.h"
#include "stdlib.h"
#include "lp.h"
#include "access.h"
static int chgaccess ( int , char ** , char * , char * , char * );
static char ** empty_list ( void );
/**
** deny_user_form() - DENY USER ACCESS TO FORM
**/
int
{
}
/**
** allow_user_form() - ALLOW USER ACCESS TO FORM
**/
int
{
}
/**
** deny_user_printer() - DENY USER ACCESS TO PRINTER
**/
int
{
}
/**
** allow_user_printer() - ALLOW USER ACCESS TO PRINTER
**/
int
{
}
/**
** deny_form_printer() - DENY FORM USE ON PRINTER
**/
int
{
}
/**
** allow_form_printer() - ALLOW FORM USE ON PRINTER
**/
int
{
}
/**
** remove_paper_from_printer() - DENY FORM USE ON PRINTER
**/
int
{
}
/**
** add_paper_to_printer() - ALLOW FORM USE ON PRINTER
**/
int
{
}
/**
**/
static int
{
register char ***padd_list,
***prem_list,
**pl;
char **allow_list,
**deny_list;
return (-1);
if (isallow) {
padd_list = &allow_list;
} else {
prem_list = &allow_list;
}
/*
* Do the ``all'' and ``none'' cases explicitly,
* so that we can clean up the lists nicely.
*/
goto AllCase;
}
if (
) {
if (isallow) {
allow_list = 0;
deny_list = empty_list();
} else {
allow_list = 0;
deny_list = 0;
}
break;
} else {
/*
* For each regular item in the list,
* we add it to the ``add list'' and remove it
* from the ``remove list''. This is not
* efficient, especially if there are a lot of
* items in the caller's list; doing it the
* way we do, however, has the side effect
* of skipping duplicate names in the caller's
* list.
*
* Do a regular "addlist()"--the resulting
* list may have redundancies, but it will
* still be correct.
*/
return (-1);
return (-1);
}
}
}
/**
** empty_list() - CREATE AN EMPTY LIST
**/
static char **
empty_list(void)
{
register char **empty;
return (0);
}
*empty = 0;
return (empty);
}