/*
* 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
*/
/*
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pwd.h>
#include <string.h>
#include <deflt.h>
#include <libintl.h>
#include <locale.h>
#include <user_attr.h>
#include <prof_attr.h>
#include <auth_attr.h>
#define EXIT_OK 0
#ifndef TEXT_DOMAIN /* Should be defined by cc -D */
#endif
typedef struct cbs {
int auth_cnt;
int auth_max;
char **auths;
} cbs_t;
static int show_auths(char *, int);
static int add_auth(const char *, void *, void *);
static void free_auths(cbs_t *);
int
{
(void) textdomain(TEXT_DOMAIN);
switch (argc) {
case 1:
break;
case 2:
break;
default:
while (*++argv) {
if (status == EXIT_FATAL) {
break;
}
}
break;
}
return (status);
}
static int
{
int i;
return (status);
}
return (status);
}
if (status == EXIT_NON_FATAL) {
} else {
if (print_name)
/* print out the auths */
/* print out the last entry, without the comma */
/* free memory allocated for authorizations */
free_auths(&cbs);
}
return (status);
}
/*ARGSUSED*/
static int
{
exit(1);
}
}
return (0);
}
static void
{
int i;
}
/* We have always ignored .grant in auths(1) */
static boolean_t
{
return (B_FALSE);
}
static int
mstrptr(const void *a, const void *b)
{
char *const *ap = a;
char *const *bp = b;
}
/*
* Simplify the returned authorizations: sort and match wildcards;
* we're using here that "*" sorts before any other character.
*/
static void
{
int rem, i;
/* First we sort */
/*
* Then we remove the entries which match a later entry.
* We walk the list, with "i + rem + 1" the cursor for the possible
* candidate for removal. With "rem" we count the removed entries
* and we copy while we're looking for duplicate/superfluous entries.
*/
rem++;
} else {
i++;
if (rem > 0)
}
}
}