mirror of
https://github.com/samba-team/samba.git
synced 2025-03-01 04:58:35 +03:00
Remove policy library - it's now in a separate git repository.
(This used to be commit 9b364bf390524fa34db1b3d7e6f875a6b8f35f24)
This commit is contained in:
parent
f540669c48
commit
68b2d9372f
@ -5,7 +5,6 @@ mkinclude charset/config.mk
|
||||
mkinclude ldb-samba/config.mk
|
||||
mkinclude tls/config.mk
|
||||
mkinclude registry/config.mk
|
||||
mkinclude policy/config.mk
|
||||
mkinclude messaging/config.mk
|
||||
mkinclude events/config.mk
|
||||
mkinclude cmdline/config.mk
|
||||
|
@ -1,47 +0,0 @@
|
||||
/*
|
||||
Unix SMB/CIFS implementation.
|
||||
Copyright (C) 2006 Wilco Baan Hofman <wilco@baanhofman.nl>
|
||||
Copyright (C) 2006 Jelmer Vernooij <jelmer@samba.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __ADM_H__
|
||||
#define __ADM_H__
|
||||
|
||||
struct adm_file {
|
||||
struct adm_class *classes;
|
||||
};
|
||||
|
||||
struct adm_class {
|
||||
struct adm_category *categories;
|
||||
};
|
||||
|
||||
struct adm_category {
|
||||
struct adm_category *subcategories;
|
||||
struct adm_policy *policies;
|
||||
};
|
||||
|
||||
struct adm_policy {
|
||||
struct adm_part *parts;
|
||||
};
|
||||
|
||||
struct adm_part {
|
||||
int dummy;
|
||||
};
|
||||
|
||||
struct adm_file *adm_read_file(const char *);
|
||||
|
||||
#endif /* __ADM_H__ */
|
@ -1,14 +0,0 @@
|
||||
[SUBSYSTEM::LIBPOLICY]
|
||||
CFLAGS = -Iheimdal/lib/roken
|
||||
PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL LIBSAMBA-HOSTCONFIG LIBTALLOC CHARSET
|
||||
|
||||
LIBPOLICY_OBJ_FILES = lib/policy/lex.o lib/policy/parse_adm.o
|
||||
|
||||
lib/policy/lex.l: lib/policy/parse_adm.h
|
||||
|
||||
lib/policy/parse_adm.h: lib/policy/parse_adm.c
|
||||
|
||||
[BINARY::dumpadm]
|
||||
PRIVATE_DEPENDENCIES = LIBPOLICY LIBPOPT LIBSAMBA-HOSTCONFIG LIBTALLOC LIBSAMBA-UTIL CHARSET
|
||||
|
||||
dumpadm_OBJ_FILES = lib/policy/dumpadm.o
|
@ -1,54 +0,0 @@
|
||||
/*
|
||||
Unix SMB/CIFS implementation.
|
||||
Copyright (C) 2006 Wilco Baan Hofman <wilco@baanhofman.nl>
|
||||
Copyright (C) 2006 Jelmer Vernooij <jelmer@samba.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/popt/popt.h"
|
||||
#include "lib/policy/adm.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
bool ret = true;
|
||||
poptContext pc;
|
||||
struct poptOption long_options[] = {
|
||||
POPT_AUTOHELP
|
||||
{ 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
pc = poptGetContext(argv[0], argc, (const char **)argv, long_options, 0);
|
||||
|
||||
poptSetOtherOptionHelp(pc, "<ADM-FILE> ...");
|
||||
|
||||
while ((poptGetNextOpt(pc) != -1))
|
||||
|
||||
if(!poptPeekArg(pc)) {
|
||||
poptPrintUsage(pc, stderr, 0);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
while (poptPeekArg(pc)) {
|
||||
const char *name = poptGetArg(pc);
|
||||
|
||||
adm_read_file(name);
|
||||
}
|
||||
|
||||
poptFreeContext(pc);
|
||||
|
||||
return ret;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,142 +0,0 @@
|
||||
/*
|
||||
Unix SMB/CIFS implementation.
|
||||
Copyright (C) 2006 Wilco Baan Hofman <wilco@baanhofman.nl>
|
||||
Copyright (C) 2006 Jelmer Vernooij <jelmer@samba.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
%{
|
||||
#include "includes.h"
|
||||
#include "lib/policy/parse_adm.h"
|
||||
void error_message (const char *format, ...);
|
||||
int yyparse (void);
|
||||
|
||||
static int lineno = 1;
|
||||
static bool utf16 = false;
|
||||
|
||||
#define YY_INPUT(buf,result,max_size) \
|
||||
{ \
|
||||
if (utf16) { \
|
||||
uint16_t v; \
|
||||
if (fread(&v, 2, 1, yyin) < 1) \
|
||||
result = YY_NULL; \
|
||||
else \
|
||||
result = push_codepoint(buf, v); \
|
||||
} else { \
|
||||
int c = getc(yyin); \
|
||||
result = (c == EOF) ? YY_NULL : (buf[0] = c, 1); \
|
||||
} \
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
%%
|
||||
|
||||
ACTIONLIST { return ACTIONLIST; }
|
||||
CATEGORY { return CATEGORY; }
|
||||
CHECKBOX { return CHECKBOX; }
|
||||
CLASS { return CLASS; }
|
||||
DELETE { return DEL; }
|
||||
DEFAULT { return DEFAULT; }
|
||||
DROPDOWNLIST { return DROPDOWNLIST; }
|
||||
EDITTEXT { return EDITTEXT; }
|
||||
END { return END; }
|
||||
EXPLAIN { return EXPLAIN; }
|
||||
ITEMLIST { return ITEMLIST; }
|
||||
KEYNAME { return KEYNAME; }
|
||||
MACHINE { return CLASS_MACHINE; }
|
||||
MIN { return MINIMUM; }
|
||||
MAX { return MAXIMUM; }
|
||||
NAME { return NAME; }
|
||||
NUMERIC { return NUMERIC; }
|
||||
PART { return PART; }
|
||||
POLICY { return POLICY; }
|
||||
REQUIRED { return REQUIRED; }
|
||||
SPIN { return SPIN; }
|
||||
SUPPORTED { return SUPPORTED; }
|
||||
TEXT { return TEXT; }
|
||||
USER { return CLASS_USER; }
|
||||
VALUE { return VALUE; }
|
||||
VALUENAME { return VALUENAME; }
|
||||
VALUEON { return VALUEON; }
|
||||
VALUEOFF { return VALUEOFF; }
|
||||
= { return EQUALS; }
|
||||
\[strings\] { return STRINGSSECTION; }
|
||||
|
||||
[0-9]+ {
|
||||
char *e, *y = yytext;
|
||||
yylval.integer = strtol((const char *)yytext, &e, 0);
|
||||
if(e == y)
|
||||
error_message("malformed constant (%s)", yytext);
|
||||
else
|
||||
return INTEGER;
|
||||
}
|
||||
|
||||
[A-Za-z\\{}][{}\-\\A-Za-z0-9_]* {
|
||||
yylval.text = strdup ((const char *)yytext);
|
||||
return LITERAL;
|
||||
}
|
||||
|
||||
"!!"[A-Za-z][-A-Za-z0-9_]* {
|
||||
yylval.text = strdup ((const char *)yytext);
|
||||
return LOOKUPLITERAL;
|
||||
}
|
||||
[ \t]+
|
||||
\n { lineno++; }
|
||||
;[^\n]*\n { lineno++; }
|
||||
\"([^\n]+)\n { lineno++; yylval.text = strdup((const char *)yytext); return LITERAL; }
|
||||
%%
|
||||
|
||||
#ifndef yywrap /* XXX */
|
||||
int
|
||||
yywrap ()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void
|
||||
error_message (const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start (args, format);
|
||||
fprintf (stderr, "%d:", lineno);
|
||||
vfprintf (stderr, format, args);
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
struct adm_file *adm_read_file(const char *file)
|
||||
{
|
||||
uint8_t c[2];
|
||||
yyin = fopen(file, "r");
|
||||
if (yyin == NULL)
|
||||
return NULL;
|
||||
|
||||
c[0] = getc(yyin);
|
||||
c[1] = getc(yyin);
|
||||
if (c[0] == 0xff && c[1] == 0xfe) {
|
||||
utf16 = true;
|
||||
} else {
|
||||
rewind(yyin);
|
||||
}
|
||||
|
||||
yyparse();
|
||||
|
||||
return NULL; /* FIXME */
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,135 +0,0 @@
|
||||
/* A Bison parser, made by GNU Bison 2.3. */
|
||||
|
||||
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, you may create a larger work that contains
|
||||
part or all of the Bison parser skeleton and distribute that work
|
||||
under terms of your choice, so long as that work isn't itself a
|
||||
parser generator using the skeleton or a modified version thereof
|
||||
as a parser skeleton. Alternatively, if you modify or redistribute
|
||||
the parser skeleton itself, you may (at your option) remove this
|
||||
special exception, which will cause the skeleton and the resulting
|
||||
Bison output files to be licensed under the GNU General Public
|
||||
License without this special exception.
|
||||
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||
know about them. */
|
||||
enum yytokentype {
|
||||
CATEGORY = 258,
|
||||
CLASS = 259,
|
||||
CLASS_USER = 260,
|
||||
CLASS_MACHINE = 261,
|
||||
POLICY = 262,
|
||||
KEYNAME = 263,
|
||||
EXPLAIN = 264,
|
||||
VALUENAME = 265,
|
||||
VALUEON = 266,
|
||||
VALUEOFF = 267,
|
||||
PART = 268,
|
||||
ITEMLIST = 269,
|
||||
NAME = 270,
|
||||
VALUE = 271,
|
||||
NUMERIC = 272,
|
||||
EDITTEXT = 273,
|
||||
TEXT = 274,
|
||||
DROPDOWNLIST = 275,
|
||||
CHECKBOX = 276,
|
||||
MINIMUM = 277,
|
||||
MAXIMUM = 278,
|
||||
DEFAULT = 279,
|
||||
END = 280,
|
||||
ACTIONLIST = 281,
|
||||
DEL = 282,
|
||||
SUPPORTED = 283,
|
||||
LITERAL = 284,
|
||||
INTEGER = 285,
|
||||
LOOKUPLITERAL = 286,
|
||||
CLIENTEXT = 287,
|
||||
REQUIRED = 288,
|
||||
NOSORT = 289,
|
||||
SPIN = 290,
|
||||
EQUALS = 291,
|
||||
STRINGSSECTION = 292
|
||||
};
|
||||
#endif
|
||||
/* Tokens. */
|
||||
#define CATEGORY 258
|
||||
#define CLASS 259
|
||||
#define CLASS_USER 260
|
||||
#define CLASS_MACHINE 261
|
||||
#define POLICY 262
|
||||
#define KEYNAME 263
|
||||
#define EXPLAIN 264
|
||||
#define VALUENAME 265
|
||||
#define VALUEON 266
|
||||
#define VALUEOFF 267
|
||||
#define PART 268
|
||||
#define ITEMLIST 269
|
||||
#define NAME 270
|
||||
#define VALUE 271
|
||||
#define NUMERIC 272
|
||||
#define EDITTEXT 273
|
||||
#define TEXT 274
|
||||
#define DROPDOWNLIST 275
|
||||
#define CHECKBOX 276
|
||||
#define MINIMUM 277
|
||||
#define MAXIMUM 278
|
||||
#define DEFAULT 279
|
||||
#define END 280
|
||||
#define ACTIONLIST 281
|
||||
#define DEL 282
|
||||
#define SUPPORTED 283
|
||||
#define LITERAL 284
|
||||
#define INTEGER 285
|
||||
#define LOOKUPLITERAL 286
|
||||
#define CLIENTEXT 287
|
||||
#define REQUIRED 288
|
||||
#define NOSORT 289
|
||||
#define SPIN 290
|
||||
#define EQUALS 291
|
||||
#define STRINGSSECTION 292
|
||||
|
||||
|
||||
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef union YYSTYPE
|
||||
#line 33 "lib/policy/parse_adm.y"
|
||||
{
|
||||
char *text;
|
||||
int integer;
|
||||
}
|
||||
/* Line 1489 of yacc.c. */
|
||||
#line 128 "lib/policy/parse_adm.y"
|
||||
YYSTYPE;
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
|
||||
extern YYSTYPE yylval;
|
||||
|
@ -1,138 +0,0 @@
|
||||
/*
|
||||
Unix SMB/CIFS implementation.
|
||||
Copyright (C) 2006 Wilco Baan Hofman <wilco@baanhofman.nl>
|
||||
Copyright (C) 2006 Jelmer Vernooij <jelmer@samba.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
For more information on the .ADM file format:
|
||||
http://msdn2.microsoft.com/en-us/library/aa372405.aspx
|
||||
*/
|
||||
|
||||
%{
|
||||
#include "config.h"
|
||||
void error_message (const char *format, ...);
|
||||
int yyparse (void);
|
||||
void yyerror (const char *s);
|
||||
extern int yylex (void);
|
||||
|
||||
%}
|
||||
|
||||
%union {
|
||||
char *text;
|
||||
int integer;
|
||||
}
|
||||
|
||||
%token CATEGORY
|
||||
%token CLASS
|
||||
%token CLASS_USER
|
||||
%token CLASS_MACHINE
|
||||
%token POLICY
|
||||
%token KEYNAME
|
||||
%token EXPLAIN
|
||||
%token VALUENAME
|
||||
%token VALUEON VALUEOFF
|
||||
%token PART
|
||||
%token ITEMLIST
|
||||
%token NAME
|
||||
%token VALUE
|
||||
%token NUMERIC EDITTEXT TEXT DROPDOWNLIST CHECKBOX
|
||||
%token MINIMUM MAXIMUM DEFAULT
|
||||
%token END
|
||||
%token ACTIONLIST
|
||||
%token DEL
|
||||
%token SUPPORTED
|
||||
%token <text> LITERAL
|
||||
%token <integer> INTEGER
|
||||
%token <text> LOOKUPLITERAL
|
||||
%token CLIENTEXT
|
||||
%token REQUIRED
|
||||
%token NOSORT
|
||||
%token SPIN
|
||||
%token EQUALS
|
||||
%token STRINGSSECTION
|
||||
|
||||
%start admfile
|
||||
|
||||
%%
|
||||
|
||||
admfile: classes strings;
|
||||
|
||||
classes: /* empty */ | class classes;
|
||||
|
||||
class: CLASS classvalue categories;
|
||||
classvalue: CLASS_USER|CLASS_MACHINE;
|
||||
|
||||
categories: /* empty */ | category categories;
|
||||
|
||||
string: LITERAL | LOOKUPLITERAL;
|
||||
|
||||
category: CATEGORY string categoryitems END CATEGORY;
|
||||
|
||||
categoryitem: explain | category | policy | keyname;
|
||||
categoryitems: categoryitem categoryitems | /* empty */ ;
|
||||
|
||||
policy: POLICY string policyitems END POLICY;
|
||||
policyitem: explain | keyname | valuename | valueon | valueoff | min | max | defaultvalue | supported | part;
|
||||
policyitems: policyitem policyitems | /* empty */;
|
||||
|
||||
valuetype: NUMERIC | EDITTEXT | TEXT | DROPDOWNLIST | CHECKBOX;
|
||||
|
||||
part: PART string valuetype partitems END PART;
|
||||
|
||||
spin: SPIN INTEGER;
|
||||
|
||||
partitem: keyname | valuename | valueon | valueoff | min | max | defaultvalue | itemlist | REQUIRED | spin;
|
||||
partitems: partitem partitems | /* empty */;
|
||||
|
||||
min: MINIMUM INTEGER;
|
||||
max: MAXIMUM INTEGER;
|
||||
defaultvalue: DEFAULT INTEGER;
|
||||
|
||||
explain: EXPLAIN string;
|
||||
value: DEL | NUMERIC INTEGER;
|
||||
|
||||
valueon: VALUEON value;
|
||||
valueoff: VALUEOFF value;
|
||||
|
||||
valuename: VALUENAME string;
|
||||
keyname: KEYNAME string;
|
||||
|
||||
itemlist: ITEMLIST items END ITEMLIST;
|
||||
itemname: NAME string;
|
||||
itemvalue: VALUE value;
|
||||
|
||||
item: itemname | itemvalue | DEFAULT | actionlist;
|
||||
items: /* empty */ | item items;
|
||||
|
||||
supported: SUPPORTED string;
|
||||
|
||||
actionlist: ACTIONLIST actions END ACTIONLIST;
|
||||
actions: valuename actions | itemvalue actions | /* empty */;
|
||||
|
||||
variable: LITERAL EQUALS LITERAL;
|
||||
variables: variable variables | /* empty */;
|
||||
strings: STRINGSSECTION variables;
|
||||
|
||||
%%
|
||||
|
||||
void
|
||||
yyerror (const char *s)
|
||||
{
|
||||
error_message ("%s\n", s);
|
||||
}
|
||||
|
||||
|
||||
|
@ -332,12 +332,10 @@ lcov-split:
|
||||
@$(MAKE) $(COV_TARGET) $(COV_VARS) \
|
||||
TEST_OPTIONS="--analyse-cmd=\"lcov --base-directory `pwd` --directory . --capture --output-file samba.info -t\""
|
||||
-rm heimdal/lib/*/{lex,parse}.{gcda,gcno}
|
||||
-rm lib/policy/*/{lex,parse}.{gcda,gcno}
|
||||
genhtml -o coverage samba.info
|
||||
|
||||
lcov: test_cov
|
||||
-rm heimdal/lib/*/{lex,parse}.{gcda,gcno}
|
||||
-rm lib/policy/*/{lex,parse}.{gcda,gcno}
|
||||
lcov --base-directory `pwd` --directory . --capture --output-file samba.info
|
||||
genhtml -o coverage samba.info
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user