diff --git a/parser/Makefile b/parser/Makefile index 15cbe62de..528d1b341 100644 --- a/parser/Makefile +++ b/parser/Makefile @@ -76,8 +76,8 @@ EXTRA_CFLAGS+=-DSUBDOMAIN_CONFDIR=\"${CONFDIR}\" SRCS = parser_common.c parser_include.c parser_interface.c parser_lex.c \ parser_main.c parser_misc.c parser_merge.c parser_symtab.c \ parser_yacc.c parser_regex.c parser_variable.c parser_policy.c \ - parser_alias.c -HDRS = parser.h parser_include.h immunix.h + parser_alias.c mount.c +HDRS = parser.h parser_include.h immunix.h mount.h TOOLS = apparmor_parser OBJECTS = $(SRCS:.c=.o) diff --git a/parser/mount.c b/parser/mount.c new file mode 100644 index 000000000..80fca854a --- /dev/null +++ b/parser/mount.c @@ -0,0 +1,510 @@ +/* + * Copyright (c) 2010 + * Canonical, Ltd. (All rights reserved) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License published by the Free Software Foundation. + * + * 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, contact Novell, Inc. or Canonical + * Ltd. + */ + +/** + * The mount command, its mix of options and flags, its permissions and + * mapping are a mess. + * mount [-lhV] + * + * mount -a [-fFnrsvw] [-t vfstype] [-O optlist] + * + * mount [-fnrsvw] [-o option[,option]...] device|dir + * + * mount [-fnrsvw] [-t vfstype] [-o options] device dir + * + *---------------------------------------------------------------------- + * Mount flags of no interest for apparmor mediation + * -a, --all + * -F fork for simultaneous mount + * -f fake, do everything except that actual system call + * -h --help + * -i, --internal-only + * -n mount without writing in /etc/mtab + * -O limits what is auto mounted + * -p, --pass-fd num + * -s Tolerate sloppy mount options + * -U uuid + * -V --version + * --no-canonicalize + * + *---------------------------------------------------------------------- + * what do we do with these + * -l list? + * -L