/*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*
* Openvision retains the copyright to derivative works of
* this source code. Do *NOT* create a derivative of this
* source code before consulting with your legal department.
* Do *NOT* integrate *ANY* of this source code into another
* product before consulting with your legal department.
*
* For further information, read the top-level Openvision
* copyright which is contained in the top-level MIT Kerberos
* copyright.
*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*
*/
/*
* Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
*
* $Header$
*/
#if !defined(lint) && !defined(__CODECENTER__)
#endif
#include "autoconf.h"
#if defined(HAVE_COMPILE) && defined(HAVE_STEP)
#define SOLARIS_REGEXPS
#define POSIX_REGEXPS
#define BSD_REGEXPS
#else
#endif
#include <string.h>
#include "server_internal.h"
#ifdef SOLARIS_REGEXPS
#include <regexpr.h>
#endif
#ifdef POSIX_REGEXPS
#include <regex.h>
#endif
#include <stdlib.h>
struct iter_data {
char **names;
unsigned int malloc_failed;
char *exp;
#ifdef SOLARIS_REGEXPS
char *expbuf;
#endif
#ifdef POSIX_REGEXPS
#endif
};
/*
* Function: glob_to_regexp
*
* Arguments:
*
* glob (r) the shell-style glob (?*[]) to convert
* realm (r) the default realm to append, or NULL
* regexp (w) the ed-style regexp created from glob
*
* Effects:
*
* regexp is filled in with allocated memory contained a regular
* shell-style glob would match. If glob does not contain an "@"
* character and realm is not NULL, "@*" is appended to the regexp.
*
* Conversion algorithm:
*
* quoted characters are copied quoted
* ? is converted to .
* * is converted to .*
* active characters are quoted: ^, $, .
* [ and ] are active but supported and have the same meaning, so
* they are copied
* other characters are copied
* regexp is anchored with ^ and $
*/
{
int append_realm;
char *p;
/* validate the glob */
return EINVAL;
/* A character of glob can turn into two in regexp, plus ^ and $ */
/* and trailing null. If glob has no @, also allocate space for */
/* the realm. */
if (p == NULL)
return ENOMEM;
*regexp = p;
*p++ = '^';
while (*glob) {
switch (*glob) {
case '?':
*p++ = '.';
break;
case '*':
*p++ = '.';
*p++ = '*';
break;
case '.':
case '^':
case '$':
*p++ = '\\';
*p++ = *glob;
break;
case '\\':
*p++ = '\\';
*p++ = *++glob;
break;
default:
*p++ = *glob;
break;
}
glob++;
}
if (append_realm) {
*p++ = '@';
*p++ = '*';
}
*p++ = '$';
*p++ = '\0';
return KADM5_OK;
}
{
int match;
#ifdef SOLARIS_REGEXPS
#endif
#ifdef POSIX_REGEXPS
#endif
#ifdef BSD_REGEXPS
#endif
if (match) {
new_sz * sizeof(char *));
if (new_names) {
} else {
return;
}
}
} else
}
{
char *name;
return;
}
{
char *name;
return;
}
void *server_handle,
char *exp,
char ***princs,
int *count)
{
#ifdef BSD_REGEXPS
char *msg;
#endif
char *regexp;
int i, ret;
*count = 0;
exp = "*";
return ret;
if (
#ifdef SOLARIS_REGEXPS
#endif
#ifdef POSIX_REGEXPS
#endif
#ifdef BSD_REGEXPS
#endif
)
{
/* XXX syslog msg or regerr(regerrno) */
return EINVAL;
}
data.malloc_failed = 0;
return ENOMEM;
}
if (princ) {
} else {
}
#ifdef POSIX_REGEXPS
#endif
if ( ret ) {
return ret;
}
return KADM5_OK;
}
char *exp,
char ***princs,
int *count)
{
}
char *exp,
char ***pols,
int *count)
{
}