This commit is contained in:
leif%netscape.com 2000-01-12 06:27:00 +00:00
Родитель f1bc605e80
Коммит a10f950b48
4 изменённых файлов: 67 добавлений и 34 удалений

Просмотреть файл

@ -1,8 +1,8 @@
#################################################################################
# $Id: Makefile,v 1.1 2000-01-12 06:15:42 leif%netscape.com Exp $
###############################################################################
# $Id: Makefile,v 1.2 2000-01-12 06:26:59 leif%netscape.com Exp $
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.0 (the "License"); you may not use this file except in
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
@ -22,10 +22,10 @@
# DESCRIPTION:
# Simple Makefile for the DS-3 (and later) plugins.
#
#################################################################################
###############################################################################
#################################################################################
###############################################################################
# Build configuration is done here!
#
DS = /opt/suitespot/plugins/slapd/slapi
@ -35,14 +35,14 @@ ETAGS = etags
#ETAGS = true
#################################################################################
###############################################################################
# Common configurations
#
CC = gcc
SH_OPTS = -fpic
#################################################################################
###############################################################################
# Configuration specific for solaris-2.x.
#
CC = gcc
@ -59,7 +59,7 @@ OPT = -O6 -mcpu=ultrasparc -Wall -DNDEBUG
OPT = -g -Wall -DDEBUG
#################################################################################
###############################################################################
# You shouldn't have to touch anything below here.
#
INCLUDE = -I. -I$(DS)/include
@ -73,7 +73,7 @@ CFILES = rex_filt.c url_filt.c lulu.c quick_auth.c uid_auth.c
MISCFILES = Makefile
#################################################################################
###############################################################################
# Main targets.
#
all: $(TARGETS) TAGS
@ -97,7 +97,7 @@ uid_auth.so: uid_auth.o lulu.o lulu.h
$(LD) $(LDFLAGS) -o $@ uid_auth.o lulu.o
#################################################################################
###############################################################################
# Misc targets
#
TAGS: $(CFILES) $(INCFILES) Makefile
@ -105,7 +105,7 @@ TAGS: $(CFILES) $(INCFILES) Makefile
@touch TAGS
#################################################################################
###############################################################################
# "clean" and distribution targets.
#
realclean: distclean

Просмотреть файл

@ -1,9 +1,9 @@
/* -*- Mode: C; eval: (c-set-style "GNU") -*-
*******************************************************************************
* $Id: lulu.c,v 1.1 2000-01-12 06:15:43 leif%netscape.com Exp $
******************************************************************************
* $Id: lulu.c,v 1.2 2000-01-12 06:26:59 leif%netscape.com Exp $
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
@ -22,12 +22,12 @@
* DESCRIPTION:
* Lots of Useful Little Utilities
*
*******************************************************************************/
*****************************************************************************/
#include <stdio.h>
#include "lulu.h"
/********************************************************************************
/******************************************************************************
* Free the list of attributes, in case something went south...
*/
PUBLIC BOOL
@ -52,7 +52,7 @@ freeAttributes(PluginAttrs *attrs)
}
/********************************************************************************
/******************************************************************************
* Create a list of attributes, from the string argument. This is a comma
* separated list of attributes, without white spaces! For instance:
*
@ -108,7 +108,7 @@ parseAttributes(char *str)
}
/********************************************************************************
/******************************************************************************
* Check if a particular attribute type is in a Plugin Attribute list. This
* can be used to decide if a plugin/filter should be applied for instance.
*/
@ -135,7 +135,7 @@ listHasAttribute(PluginAttrs *attrs, char *type)
}
/********************************************************************************
/******************************************************************************
* Send a constraint violation error back to the client, with a more
* descriptive error message.
*/
@ -149,7 +149,7 @@ sendConstraintErr(Slapi_PBlock *pb, char *str)
}
/********************************************************************************
/******************************************************************************
* Send a constraint violation error back to the client, with a more
* descriptive error message.
*/
@ -163,7 +163,7 @@ sendOperationsErr(Slapi_PBlock *pb, char *str)
}
/********************************************************************************
/******************************************************************************
* Get the ADD entry, and if it fails we send an error, and return FALSE. As
* a side effect the "entry" argument (a handle) is set to the structure.
*/
@ -186,7 +186,7 @@ getAddEntry(Slapi_PBlock *pb, Slapi_Entry **entry, char *name)
}
/********************************************************************************
/******************************************************************************
* Get the MODS for the current operation, and if it fails we send and error,
* and return FALSE. As a side effect, we set the "mods" argument (a handle)
* to the modifications structure.
@ -210,7 +210,7 @@ getModifyMods(Slapi_PBlock *pb, LDAPMod ***mods, char *name)
}
/********************************************************************************
/******************************************************************************
* Get the "command line arguments", and return TRUE if successful.
*/
PUBLIC BOOL
@ -229,7 +229,7 @@ getSlapiArgs(Slapi_PBlock *pb, int *argc, char ***argv, int exp, char *name)
}
/********************************************************************************
/******************************************************************************
* Set the DN and authtype return values, making sure the pblock_set() did
* actually work.
*/

Просмотреть файл

@ -1,9 +1,9 @@
/* -*- Mode: C; eval: (c-set-style "GNU") -*-
*******************************************************************************
* $Id: lulu.h,v 1.1 2000-01-12 06:15:44 leif%netscape.com Exp $
******************************************************************************
* $Id: lulu.h,v 1.2 2000-01-12 06:27:00 leif%netscape.com Exp $
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
@ -22,7 +22,7 @@
* DESCRIPTION:
* Lots of Useful Little Utilities, defines and stuff.
*
*******************************************************************************/
*****************************************************************************/
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
@ -31,14 +31,14 @@
#include <slapi-plugin.h>
/********************************************************************************
/******************************************************************************
* Configurations, you might want to look at these...
*/
#define LOG_FACILITY SLAPI_LOG_PLUGIN
#define THE_AUTHOR "IS-Architorture"
/********************************************************************************
/******************************************************************************
* Error strings.
*/
#define ERR_ARGS "Can't locate plugin arguments, Panic!\n"
@ -51,7 +51,7 @@
#define ERR_NOSET "Failed to set DN and auth method.\n"
/********************************************************************************
/******************************************************************************
* Misc. defines etc., don't touch anything below this.
*/
#define PRIVATE static
@ -63,7 +63,7 @@
#define ATTR_SEPARATOR ","
/********************************************************************************
/******************************************************************************
* Try to get "inlined" defined, if possible. Currently only supports GCC.
*/
#ifdef __GNUC__
@ -73,7 +73,7 @@
#endif /* __GNUC__ */
/********************************************************************************
/******************************************************************************
* Typedefs and structures.
*/
typedef int BOOL;
@ -91,7 +91,7 @@ typedef struct _PluginAttrs
typedef struct berval BerVal;
/********************************************************************************
/******************************************************************************
* Public functions.
*/
PUBLIC PluginAttrs *parseAttributes(char *);

Просмотреть файл

@ -1,5 +1,38 @@
/* -*- Mode: C; eval: (c-set-style "GNU") -*-
*/
******************************************************************************
* $Id: rex_filt.c,v 1.2 2000-01-12 06:27:00 leif%netscape.com Exp $
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Netscape DS Plugins. The Initial Developer of the
* Original Code is Leif Hedstrom and Netscape Communications Corp.
* Portions created by Netscape are Copyright (C) Netscape Communications
* Corp. All Rights Reserved.
*
* Contributor(s):
*
* DESCRIPTION:
* Apply regular expressions to MOD/ADD operations, if the rule is a match
* deny/allow the modification. You can use this plugin any number of times
* from the slapd.conf file, it will extend the filter rules accordingly.
*
* USAGE:
* plugin preoperation rex_filt.so rexPlugInit attr1,2 0/1 regexp1
* plugin preoperation rex_filt.so rexPlugInit attr3,4 0/1 regexp2
*
* TODO:
* * Support the /.../i syntax, for case insensitive regexps.
*
*****************************************************************************/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>