allocate.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 1992-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <errno.h>
#include <locale.h>
#include <pwd.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "allocate.h"
#if !defined(TEXT_DOMAIN)
#define TEXT_DOMAIN "SUNW_OST_OSCMD"
#endif
extern void audit_allocate_argv(int, int, char *[]);
extern int audit_allocate_record(int);
static void
{
char *use[5];
switch (func) {
case 0:
break;
case 1:
break;
case 2:
break;
default:
}
}
static void
{
char *msg;
switch (error) {
case SYSERROR:
break;
case IMPORT_ERR:
"User lacks authorization required for this operation.");
break;
case NODAENT:
"No device allocate file entry for specified device.");
break;
case NODMAPENT:
"No device maps file entry for specified device.");
break;
case DACLCK:
"try later.");
break;
case DACACC:
"Can't access DAC file for the device specified.");
break;
case DEVLST:
"Could not use device list for the device specified.");
break;
case NALLOCU:
break;
case NOTAUTH:
break;
case CNTFRC:
break;
case CNTDEXEC:
"Can't exec device-clean program for specified device.");
break;
case NO_DEVICE:
"Can't find a device of type requested to allocate.");
break;
case DSPMISS:
"Device special file(s) missing for specified device.");
break;
case ALLOCERR:
break;
case CHOWN_PERR:
break;
case ALLOC:
break;
case ALLOC_OTHER:
break;
case NALLOC:
break;
case AUTHERR:
break;
case CLEAN_ERR:
break;
case SETACL_PERR:
break;
case DEVNAME_ERR:
break;
case DEVNAME_TOOLONG:
break;
default:
break;
}
}
NULL, /* for LC_ALL */
NULL, /* for LC_COLLATE */
NULL, /* for LC_CTYPE */
NULL, /* for LC_MESSAGES */
NULL, /* for LC_NUMERIC */
NULL, /* for LC_TIME */
NULL, /* for LANG */
};
static char *
{
return (*env);
}
return (NULL);
}
int
{
(void) textdomain(TEXT_DOMAIN);
/*
* get all enviroment variables
* which affect on internationalization.
*/
else
name++;
func = 0;
func = 1;
func = 2;
else {
exit(1);
}
switch (c) {
case 's':
break;
case 'U':
break;
case 'g':
break;
case 'l':
break;
case 'n':
break;
case 'u':
break;
case 'F':
break;
case 'I':
break;
case '?':
errflg++;
break;
default :
}
}
errflg++;
if (errflg) {
exit(2);
}
"Invalid user name -- %s -- \n"), uname);
exit(4);
}
}
if (func == 0) {
if (optflg & ~ALLOC_OPTS) {
exit(3);
} else {
}
} else if (func == 1) {
if (optflg & ~DEALLOC_OPTS) {
exit(3);
} else {
}
} else if (func == 2) {
exit(3);
} else {
}
}
(void) audit_allocate_record(error);
if (error) {
}
return (0);
}