/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* plabel - gets process label.
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <locale.h>
#include <procfs.h>
#include <zone.h>
static int look(char *);
static int perr(char *);
static void usage(void);
static unsigned int opt_flag = 0;
int
{
int opt;
#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
#endif
(void) textdomain(TEXT_DOMAIN);
else
cmd++;
/* Error if labeling is not active. */
if (!is_system_labeled()) {
return (1);
}
switch (opt) {
case 's':
usage();
return (1);
}
break;
case 'S':
usage();
return (1);
}
break;
default:
usage();
return (1);
}
}
if (argc == 0) {
} else {
while (argc-- > 0) {
if (rc == 0)
}
}
return (rc);
}
static int
{
int fd;
char *str;
else {
}
/*
* Open the process to be examined.
*/
/*
* Make clean message for non-existent process.
*/
return (1);
}
}
/*
* Get the info structure for the process and close quickly.
*/
goto retry;
return (1);
}
return (1);
return (1);
}
/*
* The process label for global zone is admin_high
*/
}
return (2);
}
return (0);
}
/*
* usage()
*
* This routine is called whenever there is a usage type of error has
* occured. For example, when a invalid option has has been specified.
*
*/
static void
usage(void)
{
}
static int
perr(char *s) {
if (s)
else
s = procname;
perror(s);
return (1);
}