Initial checkin of Webmin

This commit is contained in:
Jamie Cameron 2007-04-12 20:24:50 +00:00
parent 27d3d6cb97
commit fc1c1b243f
13213 changed files with 746058 additions and 0 deletions

29
LICENCE Normal file
View File

@ -0,0 +1,29 @@
---------------------------------------------------------
Copyright (c) Jamie Cameron
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the developer nor the names of contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE DEVELOPER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
---------------------------------------------------------

30
LICENCE.ja Normal file
View File

@ -0,0 +1,30 @@
Japanese translation is released under following license.
---------------------------------------------------------
Copyright (c) Kazuya Sakakihara
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the developer nor the names of contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE DEVELOPER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
---------------------------------------------------------

12
PATENTS Normal file
View File

@ -0,0 +1,12 @@
Mutual Termination for Patent Action. The License for the use of Webmin shall
terminate automatically and You may no longer exercise any of the rights granted
to You by this License if:
1. You file a lawsuit in any court alleging that any software that is licensed
under this license infringes any patent claims that are essential to use
that software.
2. You file a lawsuit in any court alleging that any OSI Certified open source
software that is licensed under any license containing a "Mutual Termination
for Patent Action" clause infringes any patent claims that are essential to use
that software.

54
README Normal file
View File

@ -0,0 +1,54 @@
Webmin Version 1.340
--------------------
Webmin is a web-based interface for system administration for Unix.
Using any browser that supports tables and forms, you can setup user
accounts, Apache, internet services, DNS, file sharing and so on.
Webmin consists of a simple web server, and a number of CGI programs
which directly update system files like /etc/inetd.conf and /etc/passwd.
The web server and all CGI programs are written in Perl version 5, and use
only the standard perl modules.
Webmin can be installed in two different ways :
1) By just running the setup.sh script in the same directory as this README
file, with no arguments. You will be asked a series of questions such as
the configuration directory, your chosen login name and password, and
possibly your operating system. For questions where a default is shown
in square brackets, you can just hit enter to accept the default (which
is usually correct).
If the configuration directory you enter is the same as that used by
a previous install of Webmin, it will be automatically upgraded with all
configurable settings preserved.
This will set up Webmin to run directly from this directory. After running
setup.sh, do not delete the directory as it contains all the scripts and
programs that will be used by Webmin when it is running. Unlike in the second
installation method, the Webmin scripts do not get copied to another
location when installing.
2) By running the setup.sh script in this directory, but with a command-line
argument such as /usr/local/webmin . When a directory like this is provided,
Webmin's scripts will be copied to the chosen directory and it will be
configured to run from that location.
The exact same questions will be asked by setup.sh when it is run with
a directory argument, and upgrading will work in the same way. If you
are upgrading an old install, you should enter the same directory argument
so that the new files overwrite the old in order to save disk space.
After Webmin has been installed to a specific directory using this method,
the directory extracted from the tar.gz file can be safely deleted.
If you are installing Webmin on a Windows system, you must run the command
perl setup.pl instead, as shell scripts will not typically run on a Windows
system. The Windows version depends on several programs and modules that may
not be part of the standard distribution. You will need the process.exe
commmand, the sc.exe command and the Win32::Daemon Perl module.
For more information, see http://www.webmin.com/
Jamie Cameron
jcameron@webmin.com

Binary file not shown.

View File

@ -0,0 +1,6 @@
Revision history for Perl extension Authen::SolarisRBAC.
0.01 Mon Apr 18 11:53:37 2005
- original version; created by h2xs 1.20 with options
-A -n Authen::SolarisRBAC

View File

@ -0,0 +1,6 @@
Changes
MANIFEST
Makefile.PL
SolarisRBAC.pm
SolarisRBAC.xs
test.pl

View File

@ -0,0 +1,877 @@
# This Makefile is for the Authen::SolarisRBAC extension to perl.
#
# It was generated automatically by MakeMaker version
# 6.17 (Revision: 1.133) from the contents of
# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
#
# ANY CHANGES MADE HERE WILL BE LOST!
#
# MakeMaker ARGV: ()
#
# MakeMaker Parameters:
# CCCDLFLAGS => q[ ]
# CCFLAGS => q[ ]
# DEFINE => q[]
# INC => q[]
# LIBS => [q[-lsecdb -lsocket -lnsl -lintl]]
# NAME => q[Authen::SolarisRBAC]
# OPTIMIZE => q[ ]
# PREREQ_PM => { }
# VERSION_FROM => q[SolarisRBAC.pm]
# --- MakeMaker post_initialize section:
# --- MakeMaker const_config section:
# These definitions are from config.sh (via /usr/perl5/5.8.4/lib/sun4-solaris-64int/Config.pm)
# They may have been overridden via Makefile.PL or on the command line
AR = ar
CC = cc
CCCDLFLAGS =
CCDLFLAGS = -R /usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE
DLEXT = so
DLSRC = dl_dlopen.xs
LD = cc
LDDLFLAGS = -G
LDFLAGS =
LIBC = /lib/libc.so
LIB_EXT = .a
OBJ_EXT = .o
OSNAME = solaris
OSVERS = 2.10
RANLIB = :
SITELIBEXP = /usr/perl5/site_perl/5.8.4
SITEARCHEXP = /usr/perl5/site_perl/5.8.4/sun4-solaris-64int
SO = so
EXE_EXT =
FULL_AR = /usr/ccs/bin/ar
VENDORARCHEXP = /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int
VENDORLIBEXP = /usr/perl5/vendor_perl/5.8.4
# --- MakeMaker constants section:
AR_STATIC_ARGS = cr
DIRFILESEP = /
NAME = Authen::SolarisRBAC
NAME_SYM = Authen_SolarisRBAC
VERSION = 0.1
VERSION_MACRO = VERSION
VERSION_SYM = 0_1
DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
XS_VERSION = 0.1
XS_VERSION_MACRO = XS_VERSION
XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
INST_ARCHLIB = blib/arch
INST_SCRIPT = blib/script
INST_BIN = blib/bin
INST_LIB = blib/lib
INST_MAN1DIR = blib/man1
INST_MAN3DIR = blib/man3
MAN1EXT = 1
MAN3EXT = 3
INSTALLDIRS = site
DESTDIR =
PREFIX =
PERLPREFIX = /usr/perl5/5.8.4
SITEPREFIX = /usr/perl5/5.8.4
VENDORPREFIX = /usr/perl5/5.8.4
INSTALLPRIVLIB = $(PERLPREFIX)/lib
DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB)
INSTALLSITELIB = /usr/perl5/site_perl/5.8.4
DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB)
INSTALLVENDORLIB = /usr/perl5/vendor_perl/5.8.4
DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB)
INSTALLARCHLIB = $(PERLPREFIX)/lib/sun4-solaris-64int
DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB)
INSTALLSITEARCH = /usr/perl5/site_perl/5.8.4/sun4-solaris-64int
DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH)
INSTALLVENDORARCH = /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int
DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH)
INSTALLBIN = $(PERLPREFIX)/bin
DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN)
INSTALLSITEBIN = $(SITEPREFIX)/bin
DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN)
INSTALLVENDORBIN = $(VENDORPREFIX)/bin
DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN)
INSTALLSCRIPT = $(PERLPREFIX)/bin
DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT)
INSTALLMAN1DIR = $(PERLPREFIX)/man/man1
DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR)
INSTALLSITEMAN1DIR = $(SITEPREFIX)/man/man1
DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR)
INSTALLVENDORMAN1DIR = $(VENDORPREFIX)/man/man1
DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR)
INSTALLMAN3DIR = $(PERLPREFIX)/man/man3
DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR)
INSTALLSITEMAN3DIR = $(SITEPREFIX)/man/man3
DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR)
INSTALLVENDORMAN3DIR = $(VENDORPREFIX)/man/man3
DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR)
PERL_LIB = /usr/perl5/5.8.4/lib
PERL_ARCHLIB = /usr/perl5/5.8.4/lib/sun4-solaris-64int
LIBPERL_A = libperl.a
FIRST_MAKEFILE = Makefile
MAKEFILE_OLD = $(FIRST_MAKEFILE).old
MAKE_APERL_FILE = $(FIRST_MAKEFILE).aperl
PERLMAINCC = $(CC)
PERL_INC = /usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE
PERL = /usr/local/bin/perl
FULLPERL = /usr/local/bin/perl
ABSPERL = $(PERL)
PERLRUN = $(PERL)
FULLPERLRUN = $(FULLPERL)
ABSPERLRUN = $(ABSPERL)
PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
PERL_CORE = 0
PERM_RW = 644
PERM_RWX = 755
MAKEMAKER = /usr/perl5/5.8.4/lib/ExtUtils/MakeMaker.pm
MM_VERSION = 6.17
MM_REVISION = 1.133
# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
# DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
FULLEXT = Authen/SolarisRBAC
BASEEXT = SolarisRBAC
PARENT_NAME = Authen
DLBASE = $(BASEEXT)
VERSION_FROM = SolarisRBAC.pm
INC =
DEFINE =
OBJECT = $(BASEEXT)$(OBJ_EXT)
LDFROM = $(OBJECT)
LINKTYPE = dynamic
# Handy lists of source code files:
XS_FILES = SolarisRBAC.xs
C_FILES = SolarisRBAC.c
O_FILES = SolarisRBAC.o
H_FILES =
MAN1PODS =
MAN3PODS = SolarisRBAC.pm
# Where is the Config information that we are using/depend on
CONFIGDEP = $(PERL_ARCHLIB)$(DIRFILESEP)Config.pm $(PERL_INC)$(DIRFILESEP)config.h
# Where to build things
INST_LIBDIR = $(INST_LIB)/Authen
INST_ARCHLIBDIR = $(INST_ARCHLIB)/Authen
INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT)
INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT)
INST_STATIC = $(INST_ARCHAUTODIR)/$(BASEEXT)$(LIB_EXT)
INST_DYNAMIC = $(INST_ARCHAUTODIR)/$(DLBASE).$(DLEXT)
INST_BOOT = $(INST_ARCHAUTODIR)/$(BASEEXT).bs
# Extra linker info
EXPORT_LIST =
PERL_ARCHIVE =
PERL_ARCHIVE_AFTER =
TO_INST_PM = SolarisRBAC.pm
PM_TO_BLIB = SolarisRBAC.pm \
$(INST_LIB)/Authen/SolarisRBAC.pm
# --- MakeMaker platform_constants section:
MM_Unix_VERSION = 1.42
PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc
# --- MakeMaker tool_autosplit section:
# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
AUTOSPLITFILE = $(PERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1)'
# --- MakeMaker tool_xsubpp section:
XSUBPPDIR = /usr/perl5/5.8.4/lib/ExtUtils
XSUBPP = $(XSUBPPDIR)/xsubpp
XSPROTOARG =
XSUBPPDEPS = /usr/perl5/5.8.4/lib/ExtUtils/typemap $(XSUBPP)
XSUBPPARGS = -typemap /usr/perl5/5.8.4/lib/ExtUtils/typemap
XSUBPP_EXTRA_ARGS =
# --- MakeMaker tools_other section:
SHELL = /bin/sh
CHMOD = chmod
CP = cp
MV = mv
NOOP = $(SHELL) -c true
NOECHO = @
RM_F = rm -f
RM_RF = rm -rf
TEST_F = test -f
TOUCH = touch
UMASK_NULL = umask 0
DEV_NULL = > /dev/null 2>&1
MKPATH = $(PERLRUN) "-MExtUtils::Command" -e mkpath
EQUALIZE_TIMESTAMP = $(PERLRUN) "-MExtUtils::Command" -e eqtime
ECHO = echo
ECHO_N = echo -n
UNINST = 0
VERBINST = 0
MOD_INSTALL = $(PERLRUN) -MExtUtils::Install -e 'install({@ARGV}, '\''$(VERBINST)'\'', 0, '\''$(UNINST)'\'');'
DOC_INSTALL = $(PERLRUN) "-MExtUtils::Command::MM" -e perllocal_install
UNINSTALL = $(PERLRUN) "-MExtUtils::Command::MM" -e uninstall
WARN_IF_OLD_PACKLIST = $(PERLRUN) "-MExtUtils::Command::MM" -e warn_if_old_packlist
# --- MakeMaker makemakerdflt section:
makemakerdflt: all
$(NOECHO) $(NOOP)
# --- MakeMaker dist section:
TAR = tar
TARFLAGS = cvf
ZIP = zip
ZIPFLAGS = -r
COMPRESS = gzip --best
SUFFIX = .gz
SHAR = shar
PREOP = $(NOECHO) $(NOOP)
POSTOP = $(NOECHO) $(NOOP)
TO_UNIX = $(NOECHO) $(NOOP)
CI = ci -u
RCS_LABEL = rcs -Nv$(VERSION_SYM): -q
DIST_CP = best
DIST_DEFAULT = tardist
DISTNAME = Authen-SolarisRBAC
DISTVNAME = Authen-SolarisRBAC-0.1
# --- MakeMaker macro section:
# --- MakeMaker depend section:
# --- MakeMaker cflags section:
CCFLAGS =
OPTIMIZE =
PERLTYPE =
MPOLLUTE =
# --- MakeMaker const_loadlibs section:
# Authen::SolarisRBAC might depend on some other libraries:
# See ExtUtils::Liblist for details
#
EXTRALIBS = -lsecdb -lintl
LDLOADLIBS = -lsecdb -lsocket -lnsl -lintl
BSLOADLIBS =
LD_RUN_PATH = /lib
# --- MakeMaker const_cccmd section:
CCCMD = $(CC) -c $(PASTHRU_INC) $(INC) \
$(CCFLAGS) $(OPTIMIZE) \
$(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \
$(XS_DEFINE_VERSION)
# --- MakeMaker post_constants section:
# --- MakeMaker pasthru section:
PASTHRU = LIB="$(LIB)"\
LIBPERL_A="$(LIBPERL_A)"\
LINKTYPE="$(LINKTYPE)"\
PREFIX="$(PREFIX)"\
OPTIMIZE="$(OPTIMIZE)"\
PASTHRU_DEFINE="$(PASTHRU_DEFINE)"\
PASTHRU_INC="$(PASTHRU_INC)"
# --- MakeMaker special_targets section:
.SUFFIXES: .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT)
.PHONY: all config static dynamic test linkext manifest
# --- MakeMaker c_o section:
.c.i:
cc -E -c $(PASTHRU_INC) $(INC) \
$(CCFLAGS) $(OPTIMIZE) \
$(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \
$(XS_DEFINE_VERSION) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c > $*.i
.c.s:
$(CCCMD) -S $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c
.c$(OBJ_EXT):
$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c
.C$(OBJ_EXT):
$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.C
.cpp$(OBJ_EXT):
$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cpp
.cxx$(OBJ_EXT):
$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cxx
.cc$(OBJ_EXT):
$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.cc
# --- MakeMaker xs_c section:
.xs.c:
$(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $(XSUBPP_EXTRA_ARGS) $*.xs > $*.xsc && $(MV) $*.xsc $*.c
# --- MakeMaker xs_o section:
.xs$(OBJ_EXT):
$(PERLRUN) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.xsc && $(MV) $*.xsc $*.c
$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c
# --- MakeMaker top_targets section:
all :: pure_all manifypods
$(NOECHO) $(NOOP)
pure_all :: config pm_to_blib subdirs linkext
$(NOECHO) $(NOOP)
subdirs :: $(MYEXTLIB)
$(NOECHO) $(NOOP)
config :: $(FIRST_MAKEFILE) $(INST_LIBDIR)$(DIRFILESEP).exists
$(NOECHO) $(NOOP)
config :: $(INST_ARCHAUTODIR)$(DIRFILESEP).exists
$(NOECHO) $(NOOP)
config :: $(INST_AUTODIR)$(DIRFILESEP).exists
$(NOECHO) $(NOOP)
$(INST_AUTODIR)/.exists :: /usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE/perl.h
$(NOECHO) $(MKPATH) $(INST_AUTODIR)
$(NOECHO) $(EQUALIZE_TIMESTAMP) /usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE/perl.h $(INST_AUTODIR)/.exists
-$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_AUTODIR)
$(INST_LIBDIR)/.exists :: /usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE/perl.h
$(NOECHO) $(MKPATH) $(INST_LIBDIR)
$(NOECHO) $(EQUALIZE_TIMESTAMP) /usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE/perl.h $(INST_LIBDIR)/.exists
-$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_LIBDIR)
$(INST_ARCHAUTODIR)/.exists :: /usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE/perl.h
$(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR)
$(NOECHO) $(EQUALIZE_TIMESTAMP) /usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE/perl.h $(INST_ARCHAUTODIR)/.exists
-$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_ARCHAUTODIR)
config :: $(INST_MAN3DIR)$(DIRFILESEP).exists
$(NOECHO) $(NOOP)
$(INST_MAN3DIR)/.exists :: /usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE/perl.h
$(NOECHO) $(MKPATH) $(INST_MAN3DIR)
$(NOECHO) $(EQUALIZE_TIMESTAMP) /usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE/perl.h $(INST_MAN3DIR)/.exists
-$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_MAN3DIR)
help:
perldoc ExtUtils::MakeMaker
# --- MakeMaker linkext section:
linkext :: $(LINKTYPE)
$(NOECHO) $(NOOP)
# --- MakeMaker dlsyms section:
# --- MakeMaker dynamic section:
dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT)
$(NOECHO) $(NOOP)
# --- MakeMaker dynamic_bs section:
BOOTSTRAP = $(BASEEXT).bs
# As Mkbootstrap might not write a file (if none is required)
# we use touch to prevent make continually trying to remake it.
# The DynaLoader only reads a non-empty file.
$(BOOTSTRAP): $(FIRST_MAKEFILE) $(BOOTDEP) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists
$(NOECHO) $(ECHO) "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
$(NOECHO) $(PERLRUN) \
"-MExtUtils::Mkbootstrap" \
-e "Mkbootstrap('$(BASEEXT)','$(BSLOADLIBS)');"
$(NOECHO) $(TOUCH) $(BOOTSTRAP)
$(CHMOD) $(PERM_RW) $@
$(INST_BOOT): $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists
$(NOECHO) $(RM_RF) $(INST_BOOT)
-$(CP) $(BOOTSTRAP) $(INST_BOOT)
$(CHMOD) $(PERM_RW) $@
# --- MakeMaker dynamic_lib section:
# This section creates the dynamically loadable $(INST_DYNAMIC)
# from $(OBJECT) and possibly $(MYEXTLIB).
ARMAYBE = :
OTHERLDFLAGS =
INST_DYNAMIC_DEP =
INST_DYNAMIC_FIX =
$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP)
$(RM_F) $@
LD_RUN_PATH="$(LD_RUN_PATH)" $(LD) $(LDDLFLAGS) $(LDFROM) $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST) $(INST_DYNAMIC_FIX)
$(CHMOD) $(PERM_RWX) $@
# --- MakeMaker static section:
## $(INST_PM) has been moved to the all: target.
## It remains here for awhile to allow for old usage: "make static"
static :: $(FIRST_MAKEFILE) $(INST_STATIC)
$(NOECHO) $(NOOP)
# --- MakeMaker static_lib section:
$(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DIRFILESEP).exists
$(RM_RF) $@
$(FULL_AR) $(AR_STATIC_ARGS) $@ $(OBJECT) && $(RANLIB) $@
$(CHMOD) $(PERM_RWX) $@
$(NOECHO) $(ECHO) "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)/extralibs.ld
# --- MakeMaker manifypods section:
POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--"
POD2MAN = $(POD2MAN_EXE)
manifypods : pure_all \
SolarisRBAC.pm \
SolarisRBAC.pm
$(NOECHO) $(POD2MAN) --section=3 --perm_rw=$(PERM_RW)\
SolarisRBAC.pm $(INST_MAN3DIR)/Authen::SolarisRBAC.$(MAN3EXT)
# --- MakeMaker processPL section:
# --- MakeMaker installbin section:
# --- MakeMaker subdirs section:
# none
# --- MakeMaker clean_subdirs section:
clean_subdirs :
$(NOECHO) $(NOOP)
# --- MakeMaker clean section:
# Delete temporary files but do not touch installed files. We don't delete
# the Makefile here so a later make realclean still has a makefile to use.
clean :: clean_subdirs
-$(RM_RF) SolarisRBAC.c ./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all $(INST_ARCHAUTODIR)/extralibs.ld perlmain.c tmon.out mon.out so_locations pm_to_blib *$(OBJ_EXT) *$(LIB_EXT) perl.exe perl perl$(EXE_EXT) $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def lib$(BASEEXT).def $(BASEEXT).exp $(BASEEXT).x core core.*perl.*.? *perl.core core.[0-9] core.[0-9][0-9] core.[0-9][0-9][0-9] core.[0-9][0-9][0-9][0-9] core.[0-9][0-9][0-9][0-9][0-9]
-$(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL)
# --- MakeMaker realclean_subdirs section:
realclean_subdirs :
$(NOECHO) $(NOOP)
# --- MakeMaker realclean section:
# Delete temporary files (via clean) and also delete installed files
realclean purge :: clean realclean_subdirs
$(RM_RF) $(INST_AUTODIR) $(INST_ARCHAUTODIR)
$(RM_RF) $(DISTVNAME)
$(RM_F) $(INST_DYNAMIC) $(INST_BOOT)
$(RM_F) $(INST_STATIC)
$(RM_F) $(INST_LIB)/Authen/SolarisRBAC.pm $(MAKEFILE_OLD) $(FIRST_MAKEFILE)
# --- MakeMaker metafile section:
metafile :
$(NOECHO) $(ECHO) '# http://module-build.sourceforge.net/META-spec.html' > META.yml
$(NOECHO) $(ECHO) '#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#' >> META.yml
$(NOECHO) $(ECHO) 'name: Authen-SolarisRBAC' >> META.yml
$(NOECHO) $(ECHO) 'version: 0.1' >> META.yml
$(NOECHO) $(ECHO) 'version_from: SolarisRBAC.pm' >> META.yml
$(NOECHO) $(ECHO) 'installdirs: site' >> META.yml
$(NOECHO) $(ECHO) 'requires:' >> META.yml
$(NOECHO) $(ECHO) '' >> META.yml
$(NOECHO) $(ECHO) 'distribution_type: module' >> META.yml
$(NOECHO) $(ECHO) 'generated_by: ExtUtils::MakeMaker version 6.17' >> META.yml
# --- MakeMaker metafile_addtomanifest section:
metafile_addtomanifest:
$(NOECHO) $(PERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}}) } ' \
-e ' or print "Could not add META.yml to MANIFEST: $${'\''@'\''}\n"'
# --- MakeMaker dist_basics section:
distclean :: realclean distcheck
$(NOECHO) $(NOOP)
distcheck :
$(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck
skipcheck :
$(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck
manifest :
$(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest
veryclean : realclean
$(RM_F) *~ *.orig */*~ */*.orig
# --- MakeMaker dist_core section:
dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE)
$(NOECHO) $(PERLRUN) -l -e 'print '\''Warning: Makefile possibly out of date with $(VERSION_FROM)'\''' \
-e ' if -e '\''$(VERSION_FROM)'\'' and -M '\''$(VERSION_FROM)'\'' < -M '\''$(FIRST_MAKEFILE)'\'';'
tardist : $(DISTVNAME).tar$(SUFFIX)
$(NOECHO) $(NOOP)
uutardist : $(DISTVNAME).tar$(SUFFIX)
uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu
$(DISTVNAME).tar$(SUFFIX) : distdir
$(PREOP)
$(TO_UNIX)
$(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
$(RM_RF) $(DISTVNAME)
$(COMPRESS) $(DISTVNAME).tar
$(POSTOP)
zipdist : $(DISTVNAME).zip
$(NOECHO) $(NOOP)
$(DISTVNAME).zip : distdir
$(PREOP)
$(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
$(RM_RF) $(DISTVNAME)
$(POSTOP)
shdist : distdir
$(PREOP)
$(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
$(RM_RF) $(DISTVNAME)
$(POSTOP)
# --- MakeMaker distdir section:
distdir : metafile metafile_addtomanifest
$(RM_RF) $(DISTVNAME)
$(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \
-e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');"
# --- MakeMaker dist_test section:
disttest : distdir
cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL
cd $(DISTVNAME) && $(MAKE) $(PASTHRU)
cd $(DISTVNAME) && $(MAKE) test $(PASTHRU)
# --- MakeMaker dist_ci section:
ci :
$(PERLRUN) "-MExtUtils::Manifest=maniread" \
-e "@all = keys %{ maniread() };" \
-e "print(qq{Executing $(CI) @all\n}); system(qq{$(CI) @all});" \
-e "print(qq{Executing $(RCS_LABEL) ...\n}); system(qq{$(RCS_LABEL) @all});"
# --- MakeMaker install section:
install :: all pure_install doc_install
install_perl :: all pure_perl_install doc_perl_install
install_site :: all pure_site_install doc_site_install
install_vendor :: all pure_vendor_install doc_vendor_install
pure_install :: pure_$(INSTALLDIRS)_install
doc_install :: doc_$(INSTALLDIRS)_install
pure__install : pure_site_install
$(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
doc__install : doc_site_install
$(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
pure_perl_install ::
$(NOECHO) $(MOD_INSTALL) \
read $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist \
write $(DESTINSTALLARCHLIB)/auto/$(FULLEXT)/.packlist \
$(INST_LIB) $(DESTINSTALLPRIVLIB) \
$(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \
$(INST_BIN) $(DESTINSTALLBIN) \
$(INST_SCRIPT) $(DESTINSTALLSCRIPT) \
$(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \
$(INST_MAN3DIR) $(DESTINSTALLMAN3DIR)
$(NOECHO) $(WARN_IF_OLD_PACKLIST) \
$(SITEARCHEXP)/auto/$(FULLEXT)
pure_site_install ::
$(NOECHO) $(MOD_INSTALL) \
read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \
write $(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \
$(INST_LIB) $(DESTINSTALLSITELIB) \
$(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \
$(INST_BIN) $(DESTINSTALLSITEBIN) \
$(INST_SCRIPT) $(DESTINSTALLSCRIPT) \
$(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \
$(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR)
$(NOECHO) $(WARN_IF_OLD_PACKLIST) \
$(PERL_ARCHLIB)/auto/$(FULLEXT)
pure_vendor_install ::
$(NOECHO) $(MOD_INSTALL) \
read $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist \
write $(DESTINSTALLVENDORARCH)/auto/$(FULLEXT)/.packlist \
$(INST_LIB) $(DESTINSTALLVENDORLIB) \
$(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \
$(INST_BIN) $(DESTINSTALLVENDORBIN) \
$(INST_SCRIPT) $(DESTINSTALLSCRIPT) \
$(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \
$(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR)
doc_perl_install ::
$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
-$(NOECHO) $(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLPRIVLIB)" \
LINKTYPE "$(LINKTYPE)" \
VERSION "$(VERSION)" \
EXE_FILES "$(EXE_FILES)" \
>> $(DESTINSTALLARCHLIB)/perllocal.pod
doc_site_install ::
$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
-$(NOECHO) $(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLSITELIB)" \
LINKTYPE "$(LINKTYPE)" \
VERSION "$(VERSION)" \
EXE_FILES "$(EXE_FILES)" \
>> $(DESTINSTALLARCHLIB)/perllocal.pod
doc_vendor_install ::
$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
-$(NOECHO) $(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLVENDORLIB)" \
LINKTYPE "$(LINKTYPE)" \
VERSION "$(VERSION)" \
EXE_FILES "$(EXE_FILES)" \
>> $(DESTINSTALLARCHLIB)/perllocal.pod
uninstall :: uninstall_from_$(INSTALLDIRS)dirs
uninstall_from_perldirs ::
$(NOECHO) $(UNINSTALL) $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist
uninstall_from_sitedirs ::
$(NOECHO) $(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist
uninstall_from_vendordirs ::
$(NOECHO) $(UNINSTALL) $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist
# --- MakeMaker force section:
# Phony target to force checking subdirectories.
FORCE:
$(NOECHO) $(NOOP)
# --- MakeMaker perldepend section:
PERL_HDRS = \
$(PERL_INC)/EXTERN.h \
$(PERL_INC)/INTERN.h \
$(PERL_INC)/XSUB.h \
$(PERL_INC)/av.h \
$(PERL_INC)/cc_runtime.h \
$(PERL_INC)/config.h \
$(PERL_INC)/cop.h \
$(PERL_INC)/cv.h \
$(PERL_INC)/dosish.h \
$(PERL_INC)/embed.h \
$(PERL_INC)/embedvar.h \
$(PERL_INC)/fakethr.h \
$(PERL_INC)/form.h \
$(PERL_INC)/gv.h \
$(PERL_INC)/handy.h \
$(PERL_INC)/hv.h \
$(PERL_INC)/intrpvar.h \
$(PERL_INC)/iperlsys.h \
$(PERL_INC)/keywords.h \
$(PERL_INC)/mg.h \
$(PERL_INC)/nostdio.h \
$(PERL_INC)/op.h \
$(PERL_INC)/opcode.h \
$(PERL_INC)/patchlevel.h \
$(PERL_INC)/perl.h \
$(PERL_INC)/perlio.h \
$(PERL_INC)/perlsdio.h \
$(PERL_INC)/perlsfio.h \
$(PERL_INC)/perlvars.h \
$(PERL_INC)/perly.h \
$(PERL_INC)/pp.h \
$(PERL_INC)/pp_proto.h \
$(PERL_INC)/proto.h \
$(PERL_INC)/regcomp.h \
$(PERL_INC)/regexp.h \
$(PERL_INC)/regnodes.h \
$(PERL_INC)/scope.h \
$(PERL_INC)/sv.h \
$(PERL_INC)/thrdvar.h \
$(PERL_INC)/thread.h \
$(PERL_INC)/unixish.h \
$(PERL_INC)/util.h
$(OBJECT) : $(PERL_HDRS)
SolarisRBAC.c : $(XSUBPPDEPS)
# --- MakeMaker makefile section:
$(OBJECT) : $(FIRST_MAKEFILE)
# We take a very conservative approach here, but it's worth it.
# We move Makefile to Makefile.old here to avoid gnu make looping.
$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)
$(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?"
$(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..."
$(NOECHO) $(RM_F) $(MAKEFILE_OLD)
$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD)
-$(MAKE) -f $(MAKEFILE_OLD) clean $(DEV_NULL) || $(NOOP)
$(PERLRUN) Makefile.PL
$(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <=="
$(NOECHO) $(ECHO) "==> Please rerun the make command. <=="
false
# --- MakeMaker staticmake section:
# --- MakeMaker makeaperl section ---
MAP_TARGET = perl
FULLPERL = /usr/local/bin/perl
$(MAP_TARGET) :: static $(MAKE_APERL_FILE)
$(MAKE) -f $(MAKE_APERL_FILE) $@
$(MAKE_APERL_FILE) : $(FIRST_MAKEFILE)
$(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
$(NOECHO) $(PERLRUNINST) \
Makefile.PL DIR= \
MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=
# --- MakeMaker test section:
TEST_VERBOSE=0
TEST_TYPE=test_$(LINKTYPE)
TEST_FILE = test.pl
TEST_FILES =
TESTDB_SW = -d
testdb :: testdb_$(LINKTYPE)
test :: $(TEST_TYPE)
test_dynamic :: pure_all
PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE)
testdb_dynamic :: pure_all
PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE)
test_ : test_dynamic
test_static :: pure_all $(MAP_TARGET)
PERL_DL_NONLAZY=1 ./$(MAP_TARGET) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE)
testdb_static :: pure_all $(MAP_TARGET)
PERL_DL_NONLAZY=1 ./$(MAP_TARGET) $(TESTDB_SW) "-I$(INST_LIB)" "-I$(INST_ARCHLIB)" $(TEST_FILE)
# --- MakeMaker ppd section:
# Creates a PPD (Perl Package Description) for a binary distribution.
ppd:
$(NOECHO) $(ECHO) '<SOFTPKG NAME="$(DISTNAME)" VERSION="0,1,0,0">' > $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <TITLE>$(DISTNAME)</TITLE>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <ABSTRACT></ABSTRACT>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <AUTHOR></AUTHOR>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <IMPLEMENTATION>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <OS NAME="$(OSNAME)" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <ARCHITECTURE NAME="sun4-solaris-64int" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' <CODEBASE HREF="" />' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) ' </IMPLEMENTATION>' >> $(DISTNAME).ppd
$(NOECHO) $(ECHO) '</SOFTPKG>' >> $(DISTNAME).ppd
# --- MakeMaker pm_to_blib section:
pm_to_blib: $(TO_INST_PM)
$(NOECHO) $(PERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', '\''$(PM_FILTER)'\'')'\
SolarisRBAC.pm $(INST_LIB)/Authen/SolarisRBAC.pm
$(NOECHO) $(TOUCH) $@
# --- MakeMaker selfdocument section:
# --- MakeMaker postamble section:
# End.

View File

@ -0,0 +1,14 @@
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'Authen::SolarisRBAC',
'VERSION_FROM' => 'SolarisRBAC.pm', # finds $VERSION
'PREREQ_PM' => {}, # e.g., Module::Name => 1.1
'LIBS' => ['-lsecdb -lsocket -lnsl -lintl'], # e.g., '-lm'
'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
'INC' => '', # e.g., '-I/usr/include/other'
'CCCDLFLAGS' => ' ',
'CCFLAGS' => ' ',
'OPTIMIZE' => ' ',
);

View File

@ -0,0 +1,813 @@
# This Makefile is for the Authen::SolarisRBAC extension to perl.
#
# It was generated automatically by MakeMaker version
# 5.45 (Revision: 1.222) from the contents of
# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
#
# ANY CHANGES MADE HERE WILL BE LOST!
#
# MakeMaker ARGV: ()
#
# MakeMaker Parameters:
# DEFINE => q[]
# INC => q[]
# LIBS => [q[-lsecdb -lsocket -lnsl -lintl]]
# NAME => q[Authen::SolarisRBAC]
# PREREQ_PM => { }
# VERSION_FROM => q[SolarisRBAC.pm]
# --- MakeMaker post_initialize section:
# --- MakeMaker const_config section:
# These definitions are from config.sh (via /usr/lib/perl5/5.6.0/i386-linux/Config.pm)
# They may have been overridden via Makefile.PL or on the command line
AR = ar
CC = gcc
CCCDLFLAGS = -fpic
CCDLFLAGS = -rdynamic
DLEXT = so
DLSRC = dl_dlopen.xs
LD = gcc
LDDLFLAGS = -shared
LDFLAGS =
LIBC = /lib/libc-2.2.1.so
LIB_EXT = .a
OBJ_EXT = .o
OSNAME = linux
OSVERS = 2.2.14
RANLIB = :
SO = so
EXE_EXT =
FULL_AR = /usr/bin/ar
# --- MakeMaker constants section:
AR_STATIC_ARGS = cr
NAME = Authen::SolarisRBAC
DISTNAME = Authen-SolarisRBAC
NAME_SYM = Authen_SolarisRBAC
VERSION = 0.1
VERSION_SYM = 0_1
XS_VERSION = 0.1
INST_BIN = blib/bin
INST_EXE = blib/script
INST_LIB = blib/lib
INST_ARCHLIB = blib/arch
INST_SCRIPT = blib/script
PREFIX = /usr
INSTALLDIRS = site
INSTALLPRIVLIB = $(PREFIX)/lib/perl5/5.6.0
INSTALLARCHLIB = $(PREFIX)/lib/perl5/5.6.0/i386-linux
INSTALLSITELIB = $(PREFIX)/lib/perl5/site-perl
INSTALLSITEARCH = $(PREFIX)/lib/perl5/site-perl/i386-linux
INSTALLBIN = $(PREFIX)/bin
INSTALLSCRIPT = $(PREFIX)/bin
PERL_LIB = /usr/lib/perl5/5.6.0
PERL_ARCHLIB = /usr/lib/perl5/5.6.0/i386-linux
SITELIBEXP = /usr/lib/perl5/site-perl
SITEARCHEXP = /usr/lib/perl5/site-perl/i386-linux
LIBPERL_A = libperl.a
FIRST_MAKEFILE = Makefile
MAKE_APERL_FILE = Makefile.aperl
PERLMAINCC = $(CC)
PERL_INC = /usr/lib/perl5/5.6.0/i386-linux/CORE
PERL = /usr/local/bin/perl
FULLPERL = /usr/local/bin/perl
FULL_AR = /usr/bin/ar
VERSION_MACRO = VERSION
DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
XS_VERSION_MACRO = XS_VERSION
XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc
MAKEMAKER = /usr/lib/perl5/5.6.0/ExtUtils/MakeMaker.pm
MM_VERSION = 5.45
# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
# ROOTEXT = Directory part of FULLEXT with leading slash (eg /DBD) !!! Deprecated from MM 5.32 !!!
# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
# DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
FULLEXT = Authen/SolarisRBAC
BASEEXT = SolarisRBAC
PARENT_NAME = Authen
DLBASE = $(BASEEXT)
VERSION_FROM = SolarisRBAC.pm
INC =
DEFINE =
OBJECT = $(BASEEXT)$(OBJ_EXT)
LDFROM = $(OBJECT)
LINKTYPE = dynamic
# Handy lists of source code files:
XS_FILES= SolarisRBAC.xs
C_FILES = SolarisRBAC.c
O_FILES = SolarisRBAC.o
H_FILES =
HTMLLIBPODS =
HTMLSCRIPTPODS =
MAN1PODS =
MAN3PODS = SolarisRBAC.pm
HTMLEXT = html
INST_MAN1DIR = blib/man1
INSTALLMAN1DIR = /usr/share/man/en/man1
MAN1EXT = 1
INST_MAN3DIR = blib/man3
INSTALLMAN3DIR = /usr/share/perl5/man/man3
MAN3EXT = 3
PERM_RW = 644
PERM_RWX = 755
# work around a famous dec-osf make(1) feature(?):
makemakerdflt: all
.SUFFIXES: .xs .c .C .cpp .cxx .cc $(OBJ_EXT)
# Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that
# some make implementations will delete the Makefile when we rebuild it. Because
# we call false(1) when we rebuild it. So make(1) is not completely wrong when it
# does so. Our milage may vary.
# .PRECIOUS: Makefile # seems to be not necessary anymore
.PHONY: all config static dynamic test linkext manifest
# Where is the Config information that we are using/depend on
CONFIGDEP = $(PERL_ARCHLIB)/Config.pm $(PERL_INC)/config.h
# Where to put things:
INST_LIBDIR = $(INST_LIB)/Authen
INST_ARCHLIBDIR = $(INST_ARCHLIB)/Authen
INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT)
INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT)
INST_STATIC = $(INST_ARCHAUTODIR)/$(BASEEXT)$(LIB_EXT)
INST_DYNAMIC = $(INST_ARCHAUTODIR)/$(DLBASE).$(DLEXT)
INST_BOOT = $(INST_ARCHAUTODIR)/$(BASEEXT).bs
EXPORT_LIST =
PERL_ARCHIVE =
TO_INST_PM = SolarisRBAC.pm
PM_TO_BLIB = SolarisRBAC.pm \
$(INST_LIBDIR)/SolarisRBAC.pm
# --- MakeMaker tool_autosplit section:
# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
AUTOSPLITFILE = $(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -e 'use AutoSplit;autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1) ;'
# --- MakeMaker tool_xsubpp section:
XSUBPPDIR = /usr/lib/perl5/5.6.0/ExtUtils
XSUBPP = $(XSUBPPDIR)/xsubpp
XSPROTOARG =
XSUBPPDEPS = $(XSUBPPDIR)/typemap $(XSUBPP)
XSUBPPARGS = -typemap $(XSUBPPDIR)/typemap
# --- MakeMaker tools_other section:
SHELL = /bin/sh
CHMOD = chmod
CP = cp
LD = gcc
MV = mv
NOOP = $(SHELL) -c true
RM_F = rm -f
RM_RF = rm -rf
TEST_F = test -f
TOUCH = touch
UMASK_NULL = umask 0
DEV_NULL = > /dev/null 2>&1
# The following is a portable way to say mkdir -p
# To see which directories are created, change the if 0 to if 1
MKPATH = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e mkpath
# This helps us to minimize the effect of the .exists files A yet
# better solution would be to have a stable file in the perl
# distribution with a timestamp of zero. But this solution doesn't
# need any changes to the core distribution and works with older perls
EQUALIZE_TIMESTAMP = $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Command -e eqtime
# Here we warn users that an old packlist file was found somewhere,
# and that they should call some uninstall routine
WARN_IF_OLD_PACKLIST = $(PERL) -we 'exit unless -f $$ARGV[0];' \
-e 'print "WARNING: I have found an old package in\n";' \
-e 'print "\t$$ARGV[0].\n";' \
-e 'print "Please make sure the two installations are not conflicting\n";'
UNINST=0
VERBINST=1
MOD_INSTALL = $(PERL) -I$(INST_LIB) -I$(PERL_LIB) -MExtUtils::Install \
-e "install({@ARGV},'$(VERBINST)',0,'$(UNINST)');"
DOC_INSTALL = $(PERL) -e '$$\="\n\n";' \
-e 'print "=head2 ", scalar(localtime), ": C<", shift, ">", " L<", shift, ">";' \
-e 'print "=over 4";' \
-e 'while (defined($$key = shift) and defined($$val = shift)){print "=item *";print "C<$$key: $$val>";}' \
-e 'print "=back";'
UNINSTALL = $(PERL) -MExtUtils::Install \
-e 'uninstall($$ARGV[0],1,1); print "\nUninstall is deprecated. Please check the";' \
-e 'print " packlist above carefully.\n There may be errors. Remove the";' \
-e 'print " appropriate files manually.\n Sorry for the inconveniences.\n"'
# --- MakeMaker dist section:
DISTVNAME = $(DISTNAME)-$(VERSION)
TAR = tar
TARFLAGS = cvf
ZIP = zip
ZIPFLAGS = -r
COMPRESS = gzip --best
SUFFIX = .gz
SHAR = shar
PREOP = @$(NOOP)
POSTOP = @$(NOOP)
TO_UNIX = @$(NOOP)
CI = ci -u
RCS_LABEL = rcs -Nv$(VERSION_SYM): -q
DIST_CP = best
DIST_DEFAULT = tardist
# --- MakeMaker macro section:
# --- MakeMaker depend section:
# --- MakeMaker cflags section:
CCFLAGS = -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
OPTIMIZE = -O2 -m486 -fno-strength-reduce -fomit-frame-pointer -pipe
PERLTYPE =
LARGE =
SPLIT =
MPOLLUTE =
# --- MakeMaker const_loadlibs section:
# Authen::SolarisRBAC might depend on some other libraries:
# See ExtUtils::Liblist for details
#
EXTRALIBS = -lnsl -lintl
LDLOADLIBS = -lnsl -lintl
BSLOADLIBS =
LD_RUN_PATH = /lib:/usr/lib
# --- MakeMaker const_cccmd section:
CCCMD = $(CC) -c $(INC) $(CCFLAGS) $(OPTIMIZE) \
$(PERLTYPE) $(LARGE) $(SPLIT) $(MPOLLUTE) $(DEFINE_VERSION) \
$(XS_DEFINE_VERSION)
# --- MakeMaker post_constants section:
# --- MakeMaker pasthru section:
PASTHRU = LIB="$(LIB)"\
LIBPERL_A="$(LIBPERL_A)"\
LINKTYPE="$(LINKTYPE)"\
PREFIX="$(PREFIX)"\
OPTIMIZE="$(OPTIMIZE)"
# --- MakeMaker c_o section:
.c$(OBJ_EXT):
$(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
.C$(OBJ_EXT):
$(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.C
.cpp$(OBJ_EXT):
$(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.cpp
.cxx$(OBJ_EXT):
$(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.cxx
.cc$(OBJ_EXT):
$(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.cc
# --- MakeMaker xs_c section:
.xs.c:
$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.xsc && $(MV) $*.xsc $*.c
# --- MakeMaker xs_o section:
.xs$(OBJ_EXT):
$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.xsc && $(MV) $*.xsc $*.c
$(CCCMD) $(CCCDLFLAGS) -I$(PERL_INC) $(DEFINE) $*.c
# --- MakeMaker top_targets section:
#all :: config $(INST_PM) subdirs linkext manifypods
all :: pure_all htmlifypods manifypods
@$(NOOP)
pure_all :: config pm_to_blib subdirs linkext
@$(NOOP)
subdirs :: $(MYEXTLIB)
@$(NOOP)
config :: Makefile $(INST_LIBDIR)/.exists
@$(NOOP)
config :: $(INST_ARCHAUTODIR)/.exists
@$(NOOP)
config :: $(INST_AUTODIR)/.exists
@$(NOOP)
$(INST_AUTODIR)/.exists :: /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h
@$(MKPATH) $(INST_AUTODIR)
@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h $(INST_AUTODIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_AUTODIR)
$(INST_LIBDIR)/.exists :: /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h
@$(MKPATH) $(INST_LIBDIR)
@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h $(INST_LIBDIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_LIBDIR)
$(INST_ARCHAUTODIR)/.exists :: /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h
@$(MKPATH) $(INST_ARCHAUTODIR)
@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h $(INST_ARCHAUTODIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_ARCHAUTODIR)
config :: $(INST_MAN3DIR)/.exists
@$(NOOP)
$(INST_MAN3DIR)/.exists :: /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h
@$(MKPATH) $(INST_MAN3DIR)
@$(EQUALIZE_TIMESTAMP) /usr/lib/perl5/5.6.0/i386-linux/CORE/perl.h $(INST_MAN3DIR)/.exists
-@$(CHMOD) $(PERM_RWX) $(INST_MAN3DIR)
help:
perldoc ExtUtils::MakeMaker
Version_check:
@$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
-MExtUtils::MakeMaker=Version_check \
-e "Version_check('$(MM_VERSION)')"
# --- MakeMaker linkext section:
linkext :: $(LINKTYPE)
@$(NOOP)
# --- MakeMaker dlsyms section:
# --- MakeMaker dynamic section:
## $(INST_PM) has been moved to the all: target.
## It remains here for awhile to allow for old usage: "make dynamic"
#dynamic :: Makefile $(INST_DYNAMIC) $(INST_BOOT) $(INST_PM)
dynamic :: Makefile $(INST_DYNAMIC) $(INST_BOOT)
@$(NOOP)
# --- MakeMaker dynamic_bs section:
BOOTSTRAP = SolarisRBAC.bs
# As Mkbootstrap might not write a file (if none is required)
# we use touch to prevent make continually trying to remake it.
# The DynaLoader only reads a non-empty file.
$(BOOTSTRAP): Makefile $(INST_ARCHAUTODIR)/.exists
@echo "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
@$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" \
-MExtUtils::Mkbootstrap \
-e "Mkbootstrap('$(BASEEXT)','$(BSLOADLIBS)');"
@$(TOUCH) $(BOOTSTRAP)
$(CHMOD) $(PERM_RW) $@
$(INST_BOOT): $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists
@rm -rf $(INST_BOOT)
-cp $(BOOTSTRAP) $(INST_BOOT)
$(CHMOD) $(PERM_RW) $@
# --- MakeMaker dynamic_lib section:
# This section creates the dynamically loadable $(INST_DYNAMIC)
# from $(OBJECT) and possibly $(MYEXTLIB).
ARMAYBE = :
OTHERLDFLAGS =
INST_DYNAMIC_DEP =
$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)/.exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(INST_DYNAMIC_DEP)
LD_RUN_PATH="$(LD_RUN_PATH)" $(LD) -o $@ $(LDDLFLAGS) $(LDFROM) $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) $(EXPORT_LIST)
$(CHMOD) $(PERM_RWX) $@
# --- MakeMaker static section:
## $(INST_PM) has been moved to the all: target.
## It remains here for awhile to allow for old usage: "make static"
#static :: Makefile $(INST_STATIC) $(INST_PM)
static :: Makefile $(INST_STATIC)
@$(NOOP)
# --- MakeMaker static_lib section:
$(INST_STATIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)/.exists
$(RM_RF) $@
$(FULL_AR) $(AR_STATIC_ARGS) $@ $(OBJECT) && $(RANLIB) $@
$(CHMOD) $(PERM_RWX) $@
@echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)/extralibs.ld
# --- MakeMaker htmlifypods section:
htmlifypods : pure_all
@$(NOOP)
# --- MakeMaker manifypods section:
POD2MAN_EXE = /usr/bin/pod2man
POD2MAN = $(PERL) -we '%m=@ARGV;for (keys %m){' \
-e 'next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M "Makefile";' \
-e 'print "Manifying $$m{$$_}\n";' \
-e 'system(qq[$$^X ].q["-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" $(POD2MAN_EXE) ].qq[$$_>$$m{$$_}])==0 or warn "Couldn\047t install $$m{$$_}\n";' \
-e 'chmod(oct($(PERM_RW))), $$m{$$_} or warn "chmod $(PERM_RW) $$m{$$_}: $$!\n";}'
manifypods : pure_all SolarisRBAC.pm
@$(POD2MAN) \
SolarisRBAC.pm \
$(INST_MAN3DIR)/Authen::SolarisRBAC.$(MAN3EXT)
# --- MakeMaker processPL section:
# --- MakeMaker installbin section:
# --- MakeMaker subdirs section:
# none
# --- MakeMaker clean section:
# Delete temporary files but do not touch installed files. We don't delete
# the Makefile here so a later make realclean still has a makefile to use.
clean ::
-rm -rf SolarisRBAC.c ./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all perlmain.c mon.out core core.*perl.*.? *perl.core so_locations pm_to_blib *~ */*~ */*/*~ *$(OBJ_EXT) *$(LIB_EXT) perl.exe $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def $(BASEEXT).exp
-mv Makefile Makefile.old $(DEV_NULL)
# --- MakeMaker realclean section:
# Delete temporary files (via clean) and also delete installed files
realclean purge :: clean
rm -rf $(INST_AUTODIR) $(INST_ARCHAUTODIR)
rm -f $(INST_DYNAMIC) $(INST_BOOT)
rm -f $(INST_STATIC)
rm -f $(INST_LIBDIR)/SolarisRBAC.pm
rm -rf Makefile Makefile.old
# --- MakeMaker dist_basics section:
distclean :: realclean distcheck
distcheck :
$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=fullcheck \
-e fullcheck
skipcheck :
$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=skipcheck \
-e skipcheck
manifest :
$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=mkmanifest \
-e mkmanifest
# --- MakeMaker dist_core section:
dist : $(DIST_DEFAULT)
@$(PERL) -le 'print "Warning: Makefile possibly out of date with $$vf" if ' \
-e '-e ($$vf="$(VERSION_FROM)") and -M $$vf < -M "Makefile";'
tardist : $(DISTVNAME).tar$(SUFFIX)
zipdist : $(DISTVNAME).zip
$(DISTVNAME).tar$(SUFFIX) : distdir
$(PREOP)
$(TO_UNIX)
$(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
$(RM_RF) $(DISTVNAME)
$(COMPRESS) $(DISTVNAME).tar
$(POSTOP)
$(DISTVNAME).zip : distdir
$(PREOP)
$(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
$(RM_RF) $(DISTVNAME)
$(POSTOP)
uutardist : $(DISTVNAME).tar$(SUFFIX)
uuencode $(DISTVNAME).tar$(SUFFIX) \
$(DISTVNAME).tar$(SUFFIX) > \
$(DISTVNAME).tar$(SUFFIX)_uu
shdist : distdir
$(PREOP)
$(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
$(RM_RF) $(DISTVNAME)
$(POSTOP)
# --- MakeMaker dist_dir section:
distdir :
$(RM_RF) $(DISTVNAME)
$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=manicopy,maniread \
-e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');"
# --- MakeMaker dist_test section:
disttest : distdir
cd $(DISTVNAME) && $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) Makefile.PL
cd $(DISTVNAME) && $(MAKE)
cd $(DISTVNAME) && $(MAKE) test
# --- MakeMaker dist_ci section:
ci :
$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=maniread \
-e "@all = keys %{ maniread() };" \
-e 'print("Executing $(CI) @all\n"); system("$(CI) @all");' \
-e 'print("Executing $(RCS_LABEL) ...\n"); system("$(RCS_LABEL) @all");'
# --- MakeMaker install section:
install :: all pure_install doc_install
install_perl :: all pure_perl_install doc_perl_install
install_site :: all pure_site_install doc_site_install
install_ :: install_site
@echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
pure_install :: pure_$(INSTALLDIRS)_install
doc_install :: doc_$(INSTALLDIRS)_install
@echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod
pure__install : pure_site_install
@echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
doc__install : doc_site_install
@echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
pure_perl_install ::
@$(MOD_INSTALL) \
read $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist \
write $(INSTALLARCHLIB)/auto/$(FULLEXT)/.packlist \
$(INST_LIB) $(INSTALLPRIVLIB) \
$(INST_ARCHLIB) $(INSTALLARCHLIB) \
$(INST_BIN) $(INSTALLBIN) \
$(INST_SCRIPT) $(INSTALLSCRIPT) \
$(INST_HTMLLIBDIR) $(INSTALLHTMLPRIVLIBDIR) \
$(INST_HTMLSCRIPTDIR) $(INSTALLHTMLSCRIPTDIR) \
$(INST_MAN1DIR) $(INSTALLMAN1DIR) \
$(INST_MAN3DIR) $(INSTALLMAN3DIR)
@$(WARN_IF_OLD_PACKLIST) \
$(SITEARCHEXP)/auto/$(FULLEXT)
pure_site_install ::
@$(MOD_INSTALL) \
read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \
write $(INSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \
$(INST_LIB) $(INSTALLSITELIB) \
$(INST_ARCHLIB) $(INSTALLSITEARCH) \
$(INST_BIN) $(INSTALLBIN) \
$(INST_SCRIPT) $(INSTALLSCRIPT) \
$(INST_HTMLLIBDIR) $(INSTALLHTMLSITELIBDIR) \
$(INST_HTMLSCRIPTDIR) $(INSTALLHTMLSCRIPTDIR) \
$(INST_MAN1DIR) $(INSTALLMAN1DIR) \
$(INST_MAN3DIR) $(INSTALLMAN3DIR)
@$(WARN_IF_OLD_PACKLIST) \
$(PERL_ARCHLIB)/auto/$(FULLEXT)
doc_perl_install ::
-@$(MKPATH) $(INSTALLARCHLIB)
-@$(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLPRIVLIB)" \
LINKTYPE "$(LINKTYPE)" \
VERSION "$(VERSION)" \
EXE_FILES "$(EXE_FILES)" \
>> $(INSTALLARCHLIB)/perllocal.pod
doc_site_install ::
-@$(MKPATH) $(INSTALLARCHLIB)
-@$(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLSITELIB)" \
LINKTYPE "$(LINKTYPE)" \
VERSION "$(VERSION)" \
EXE_FILES "$(EXE_FILES)" \
>> $(INSTALLARCHLIB)/perllocal.pod
uninstall :: uninstall_from_$(INSTALLDIRS)dirs
uninstall_from_perldirs ::
@$(UNINSTALL) $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist
uninstall_from_sitedirs ::
@$(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist
# --- MakeMaker force section:
# Phony target to force checking subdirectories.
FORCE:
@$(NOOP)
# --- MakeMaker perldepend section:
PERL_HDRS = \
$(PERL_INC)/EXTERN.h \
$(PERL_INC)/INTERN.h \
$(PERL_INC)/XSUB.h \
$(PERL_INC)/av.h \
$(PERL_INC)/cc_runtime.h \
$(PERL_INC)/config.h \
$(PERL_INC)/cop.h \
$(PERL_INC)/cv.h \
$(PERL_INC)/dosish.h \
$(PERL_INC)/embed.h \
$(PERL_INC)/embedvar.h \
$(PERL_INC)/fakethr.h \
$(PERL_INC)/form.h \
$(PERL_INC)/gv.h \
$(PERL_INC)/handy.h \
$(PERL_INC)/hv.h \
$(PERL_INC)/intrpvar.h \
$(PERL_INC)/iperlsys.h \
$(PERL_INC)/keywords.h \
$(PERL_INC)/mg.h \
$(PERL_INC)/nostdio.h \
$(PERL_INC)/objXSUB.h \
$(PERL_INC)/op.h \
$(PERL_INC)/opcode.h \
$(PERL_INC)/opnames.h \
$(PERL_INC)/patchlevel.h \
$(PERL_INC)/perl.h \
$(PERL_INC)/perlapi.h \
$(PERL_INC)/perlio.h \
$(PERL_INC)/perlsdio.h \
$(PERL_INC)/perlsfio.h \
$(PERL_INC)/perlvars.h \
$(PERL_INC)/perly.h \
$(PERL_INC)/pp.h \
$(PERL_INC)/pp_proto.h \
$(PERL_INC)/proto.h \
$(PERL_INC)/regcomp.h \
$(PERL_INC)/regexp.h \
$(PERL_INC)/regnodes.h \
$(PERL_INC)/scope.h \
$(PERL_INC)/sv.h \
$(PERL_INC)/thrdvar.h \
$(PERL_INC)/thread.h \
$(PERL_INC)/unixish.h \
$(PERL_INC)/utf8.h \
$(PERL_INC)/util.h \
$(PERL_INC)/warnings.h
$(OBJECT) : $(PERL_HDRS)
SolarisRBAC.c : $(XSUBPPDEPS)
# --- MakeMaker makefile section:
$(OBJECT) : $(FIRST_MAKEFILE)
# We take a very conservative approach here, but it\'s worth it.
# We move Makefile to Makefile.old here to avoid gnu make looping.
Makefile : Makefile.PL $(CONFIGDEP)
@echo "Makefile out-of-date with respect to $?"
@echo "Cleaning current config before rebuilding Makefile..."
-@$(RM_F) Makefile.old
-@$(MV) Makefile Makefile.old
-$(MAKE) -f Makefile.old clean $(DEV_NULL) || $(NOOP)
$(PERL) "-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" Makefile.PL
@echo "==> Your Makefile has been rebuilt. <=="
@echo "==> Please rerun the make command. <=="
false
# To change behavior to :: would be nice, but would break Tk b9.02
# so you find such a warning below the dist target.
#Makefile :: $(VERSION_FROM)
# @echo "Warning: Makefile possibly out of date with $(VERSION_FROM)"
# --- MakeMaker staticmake section:
# --- MakeMaker makeaperl section ---
MAP_TARGET = perl
FULLPERL = /usr/local/bin/perl
$(MAP_TARGET) :: static $(MAKE_APERL_FILE)
$(MAKE) -f $(MAKE_APERL_FILE) $@
$(MAKE_APERL_FILE) : $(FIRST_MAKEFILE)
@echo Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
@$(PERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) \
Makefile.PL DIR= \
MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=
# --- MakeMaker test section:
TEST_VERBOSE=0
TEST_TYPE=test_$(LINKTYPE)
TEST_FILE = test.pl
TEST_FILES =
TESTDB_SW = -d
testdb :: testdb_$(LINKTYPE)
test :: $(TEST_TYPE)
test_dynamic :: pure_all
PERL_DL_NONLAZY=1 $(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(TEST_FILE)
testdb_dynamic :: pure_all
PERL_DL_NONLAZY=1 $(FULLPERL) $(TESTDB_SW) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(TEST_FILE)
test_ : test_dynamic
test_static :: pure_all $(MAP_TARGET)
PERL_DL_NONLAZY=1 ./$(MAP_TARGET) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(TEST_FILE)
testdb_static :: pure_all $(MAP_TARGET)
PERL_DL_NONLAZY=1 ./$(MAP_TARGET) $(TESTDB_SW) -I$(INST_ARCHLIB) -I$(INST_LIB) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(TEST_FILE)
# --- MakeMaker ppd section:
# Creates a PPD (Perl Package Description) for a binary distribution.
ppd:
@$(PERL) -e "print qq{<SOFTPKG NAME=\"Authen-SolarisRBAC\" VERSION=\"0,1,0,0\">\n}. qq{\t<TITLE>Authen-SolarisRBAC</TITLE>\n}. qq{\t<ABSTRACT></ABSTRACT>\n}. qq{\t<AUTHOR></AUTHOR>\n}. qq{\t<IMPLEMENTATION>\n}. qq{\t\t<OS NAME=\"$(OSNAME)\" />\n}. qq{\t\t<ARCHITECTURE NAME=\"i386-linux\" />\n}. qq{\t\t<CODEBASE HREF=\"\" />\n}. qq{\t</IMPLEMENTATION>\n}. qq{</SOFTPKG>\n}" > Authen-SolarisRBAC.ppd
# --- MakeMaker pm_to_blib section:
pm_to_blib: $(TO_INST_PM)
@$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \
"-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \
-e "pm_to_blib({qw{$(PM_TO_BLIB)}},'$(INST_LIB)/auto')"
@$(TOUCH) $@
# --- MakeMaker selfdocument section:
# --- MakeMaker postamble section:
# End.

View File

@ -0,0 +1,50 @@
/*
* This file was generated automatically by xsubpp version 1.9508 from the
* contents of SolarisRBAC.xs. Do not edit this file, edit SolarisRBAC.xs instead.
*
* ANY CHANGES MADE HERE WILL BE LOST!
*
*/
#line 1 "SolarisRBAC.xs"
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include <auth_attr.h>
#include <secdb.h>
#line 17 "SolarisRBAC.c"
XS(XS_Authen__SolarisRBAC_chkauth); /* prototype to pass -Wmissing-prototypes */
XS(XS_Authen__SolarisRBAC_chkauth)
{
dXSARGS;
if (items != 2)
Perl_croak(aTHX_ "Usage: Authen::SolarisRBAC::chkauth(authname, username)");
{
char * authname = (char *)SvPV_nolen(ST(0));
char * username = (char *)SvPV_nolen(ST(1));
int RETVAL;
dXSTARG;
#line 14 "SolarisRBAC.xs"
RETVAL = chkauthattr(authname, username);
#line 31 "SolarisRBAC.c"
XSprePUSH; PUSHi((IV)RETVAL);
}
XSRETURN(1);
}
#ifdef __cplusplus
extern "C"
#endif
XS(boot_Authen__SolarisRBAC); /* prototype to pass -Wmissing-prototypes */
XS(boot_Authen__SolarisRBAC)
{
dXSARGS;
char* file = __FILE__;
XS_VERSION_BOOTCHECK ;
newXS("Authen::SolarisRBAC::chkauth", XS_Authen__SolarisRBAC_chkauth, file);
XSRETURN_YES;
}

View File

@ -0,0 +1,64 @@
package Authen::SolarisRBAC;
require 5.005_62;
use strict;
use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
# This allows declaration use Authen::SolarisRBAC ':all';
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
# will save memory.
our %EXPORT_TAGS = ( 'all' => [ qw(
) ] );
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
our @EXPORT = qw(
);
our $VERSION = '0.1';
bootstrap Authen::SolarisRBAC $VERSION;
# Preloaded methods go here.
1;
__END__
# Below is stub documentation for your module. You better edit it!
=head1 NAME
Authen::SolarisRBAC - Perl extension for Solaris RBAC
=head1 SYNOPSIS
use Authen::SolarisRBAC;
$ok = Authen::SolarisRBAC::chkauth("solaris.admin.dcmgr.admin", "fred");
=head1 DESCRIPTION
Provides wrappers for the Solaris RBAC functions.
=head2 EXPORT
None by default.
=head1 AUTHOR
Jamie Cameron, jcameron@webmin.com
=head1 SEE ALSO
rbac(5).
=cut

View File

@ -0,0 +1,18 @@
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include <auth_attr.h>
#include <secdb.h>
MODULE = Authen::SolarisRBAC PACKAGE = Authen::SolarisRBAC
int
chkauth(authname, username)
char *authname
char *username
CODE:
RETVAL = chkauthattr(authname, username);
OUTPUT:
RETVAL

View File

@ -0,0 +1,64 @@
package Authen::SolarisRBAC;
require 5.005_62;
use strict;
use warnings;
require Exporter;
require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.
# This allows declaration use Authen::SolarisRBAC ':all';
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
# will save memory.
our %EXPORT_TAGS = ( 'all' => [ qw(
) ] );
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
our @EXPORT = qw(
);
our $VERSION = '0.1';
bootstrap Authen::SolarisRBAC $VERSION;
# Preloaded methods go here.
1;
__END__
# Below is stub documentation for your module. You better edit it!
=head1 NAME
Authen::SolarisRBAC - Perl extension for Solaris RBAC
=head1 SYNOPSIS
use Authen::SolarisRBAC;
$ok = Authen::SolarisRBAC::chkauth("solaris.admin.dcmgr.admin", "fred");
=head1 DESCRIPTION
Provides wrappers for the Solaris RBAC functions.
=head2 EXPORT
None by default.
=head1 AUTHOR
Jamie Cameron, jcameron@webmin.com
=head1 SEE ALSO
rbac(5).
=cut

View File

@ -0,0 +1,152 @@
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. | will give a
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. nr % 0
. rr F
.\}
.\"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "SolarisRBAC 3"
.TH SolarisRBAC 3 "2005-04-19" "perl v5.8.4" "User Contributed Perl Documentation"
.SH "NAME"
Authen::SolarisRBAC \- Perl extension for Solaris RBAC
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 2
\& use Authen::SolarisRBAC;
\& $ok = Authen::SolarisRBAC::chkauth("solaris.admin.dcmgr.admin", "fred");
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Provides wrappers for the Solaris \s-1RBAC\s0 functions.
.Sh "\s-1EXPORT\s0"
.IX Subsection "EXPORT"
None by default.
.SH "AUTHOR"
.IX Header "AUTHOR"
Jamie Cameron, jcameron@webmin.com
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIrbac\fR\|(5).

View File

View File

@ -0,0 +1,20 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
######################### We start with some black magic to print on failure.
# Change 1..1 below to 1..last_test_to_print .
# (It may become useful if the test is moved to ./t subdirectory.)
BEGIN { $| = 1; print "1..1\n"; }
END {print "not ok 1\n" unless $loaded;}
use Authen::SolarisRBAC;
$loaded = 1;
print "ok 1\n";
######################### End of black magic.
# Insert your test code below (better if it prints "ok 13"
# (correspondingly "not ok 13") depending on the success of chunk 13
# of the test code):

33
acl/CHANGELOG Normal file
View File

@ -0,0 +1,33 @@
---- Changes since 1.130 ----
Improved the code for finding the openssl program for generating certificates.
Added the ability to restrict allowed Unix users who can login as Webmin users.
---- Changes since 1.150 ----
Added a Module Config option for an alternate user and group list display, which takes up less space on systems with a large number of Webmin users.
---- Changes since 1.160 ----
When editing a Webmin user or group, modules are now displayed under category headings.
---- Changes since 1.170 ----
Added a button to the user editing page for switching the current Webmin login to that user, without needing to know his password.
---- Changes since 1.180 ----
Added module hiding button to the group page, as in the user page.
---- Changes since 1.190 ----
Users and groups can now be backed up using the Backup Configuration Files module.
---- Changes since 1.200 ----
Users and groups with the same name can now be created. Internally, Webmin now uses .gacl files instead of .acl to store group ACL settings.
---- Changes since 1.210 ----
Enhanced the Unix User Authentication page to allow different access to be granted to different users and group members.
---- Changes since 1.220 ----
Users can now be temporarily locked without their passwords being lost.
---- Changes since 1.230 ----
CIDR-format network addresses can now be used in the IP access control field.
The inactivity logout time can now be set on a per-Webmin user basis, rather than the global setting in the Webmin Configuration module applying to all users.
---- Changes since 1.250 ----
Added checkboxes and buttons on the module's main page for deleting several users and groups at once.
Webmin users created and managed by other modules can be marked as non-editable, to prevent them from being edited when any changes would be over-written.
The IP addresses of connected users are displayed on the sessions page.
---- Changes since 1.260 ----
Added the ability to control which hours of the day and days of the week a Webmin user can login.
---- Changes since 1.290 ----
Added an option on the Unix User Authentication page to allow Unix users who can sudo to root to login to Webmin with root privileges.
Added an option to the Unix User Authentication that lets users who pass PAM validation but have no Unix or Webmin account login as a selected Webmin user.
---- Changes since 1.330 ----
When a group is deleted, sub-groups are also removed, and the group is removed from any parents.

691
acl/acl-lib.pl Normal file
View File

@ -0,0 +1,691 @@
# acl-lib.pl
# Library for editing webmin users, passwords and access rights
do '../web-lib.pl';
&init_config();
do '../ui-lib.pl';
%access = &get_module_acl();
$access{'switch'} = 0 if (&is_readonly_mode());
# list_users()
# Returns a list of hashes containing user details
sub list_users
{
local(%miniserv, $_, @rv, %acl, %logout);
&read_acl(undef, \%acl);
&get_miniserv_config(\%miniserv);
foreach my $a (split(/\s+/, $miniserv{'logouttimes'})) {
if ($a =~ /^([^=]+)=(\S+)$/) {
$logout{$1} = $2;
}
}
open(PWFILE, $miniserv{'userfile'});
while(<PWFILE>) {
s/\r|\n//g;
local @user = split(/:/, $_);
if (@user) {
local(%user);
$user{'name'} = $user[0];
$user{'pass'} = $user[1];
$user{'sync'} = $user[2];
$user{'cert'} = $user[3];
if ($user[4] =~ /^(allow|deny)\s+(.*)/) {
$user{$1} = $2;
}
if ($user[5] =~ /days\s+(\S+)/) {
$user{'days'} = $1;
}
if ($user[5] =~ /hours\s+(\d+\.\d+)-(\d+\.\d+)/) {
$user{'hoursfrom'} = $1;
$user{'hoursto'} = $2;
}
$user{'modules'} = $acl{$user[0]};
$user{'lang'} = $gconfig{"lang_$user[0]"};
$user{'notabs'} = $gconfig{"notabs_$user[0]"};
$user{'skill'} = $gconfig{"skill_$user[0]"};
$user{'risk'} = $gconfig{"risk_$user[0]"};
$user{'rbacdeny'} = $gconfig{"rbacdeny_$user[0]"};
$user{'theme'} = $gconfig{"theme_$user[0]"};
$user{'readonly'} = $gconfig{"readonly_$user[0]"};
$user{'ownmods'} = [ split(/\s+/,
$gconfig{"ownmods_$user[0]"}) ];
$user{'logouttime'} = $logout{$user[0]};
push(@rv, \%user);
}
}
close(PWFILE);
return @rv;
}
# list_groups()
# Returns a list of hashes, one per group.
# Group membership is stored in /etc/webmin/webmin.groups, and other attributes
# in the config file.
sub list_groups
{
local @rv;
open(GROUPS, "$config_directory/webmin.groups");
while(<GROUPS>) {
s/\r|\n//g;
local @g = split(/:/, $_);
local $group = { 'name' => $g[0],
'members' => [ split(/\s+/, $g[1]) ],
'modules' => [ split(/\s+/, $g[2]) ],
'desc' => $g[3],
'ownmods' => [ split(/\s+/, $g[4]) ] };
push(@rv, $group);
}
close(GROUPS);
return @rv;
}
# list_modules()
# Returns a list of the dirs of all modules available on this system
sub list_modules
{
return map { $_->{'dir'} } &list_module_infos();
}
# list_module_infos()
# Returns a list of the details of all modules available on this system
sub list_module_infos
{
local @mods = grep { &check_os_support($_) } &get_all_module_infos();
return sort { $a->{'desc'} cmp $b->{'desc'} } @mods;
}
# create_user(&details, clone)
sub create_user
{
local(%user, %miniserv, @mods);
%user = %{$_[0]};
&lock_file($ENV{'MINISERV_CONFIG'});
&get_miniserv_config(\%miniserv);
if ($user{'theme'}) {
$miniserv{"preroot_".$user{'name'}} = $user{'theme'};
}
elsif (defined($user{'theme'})) {
$miniserv{"preroot_".$user{'name'}} = "";
}
if (defined($user{'logouttime'})) {
local @logout = split(/\s+/, $miniserv{'logouttimes'});
push(@logout, "$user{'name'}=$user{'logouttime'}");
$miniserv{'logouttimes'} = join(" ", @logout);
}
&put_miniserv_config(\%miniserv);
&unlock_file($ENV{'MINISERV_CONFIG'});
local @times;
push(@times, "days", $user{'days'}) if ($user{'days'} ne '');
push(@times, "hours", $user{'hoursfrom'}."-".$user{'hoursto'})
if ($user{'hoursfrom'});
&lock_file($miniserv{'userfile'});
&open_tempfile(PWFILE, ">>$miniserv{'userfile'}");
&print_tempfile(PWFILE,
"$user{'name'}:$user{'pass'}:$user{'sync'}:$user{'cert'}:",
($user{'allow'} ? "allow $user{'allow'}" :
$user{'deny'} ? "deny $user{'deny'}" : ""),":",
join(" ", @times),
"\n");
&close_tempfile(PWFILE);
&unlock_file($miniserv{'userfile'});
&lock_file(&acl_filename());
@mods = &list_modules();
&open_tempfile(ACL, ">>".&acl_filename());
&print_tempfile(ACL, &acl_line(\%user, \@mods));
&close_tempfile(ACL);
&unlock_file(&acl_filename());
delete($gconfig{"lang_".$user{'name'}});
$gconfig{"lang_".$user{'name'}} = $user{'lang'} if ($user{'lang'});
delete($gconfig{"notabs_".$user{'name'}});
$gconfig{"notabs_".$user{'name'}} = $user{'notabs'} if ($user{'notabs'});
delete($gconfig{"skill_".$user{'name'}});
$gconfig{"skill_".$user{'name'}} = $user{'skill'} if ($user{'skill'});
delete($gconfig{"risk_".$user{'name'}});
$gconfig{"risk_".$user{'name'}} = $user{'risk'} if ($user{'risk'});
delete($gconfig{"rbacdeny_".$user{'name'}});
$gconfig{"rbacdeny_".$user{'name'}} = $user{'rbacdeny'} if ($user{'rbacdeny'});
delete($gconfig{"ownmods_".$user{'name'}});
$gconfig{"ownmods_".$user{'name'}} = join(" ", @{$user{'ownmods'}})
if (@{$user{'ownmods'}});
delete($gconfig{"theme_".$user{'name'}});
$gconfig{"theme_".$user{'name'}} = $user{'theme'} if (defined($user{'theme'}));
$gconfig{"readonly_".$user{'name'}} = $user{'readonly'}
if (defined($user{'readonly'}));
&write_file("$config_directory/config", \%gconfig);
if ($_[1]) {
foreach $m ("", @mods) {
local $file = "$config_directory/$m/$_[1].acl";
local $dest = "$config_directory/$m/$user{'name'}.acl";
if (-r $file) {
local %macl;
&read_file($file, \%macl);
&write_file($dest, \%macl);
}
}
}
}
# modify_user(old-name, &details)
sub modify_user
{
local(%user, %miniserv, @pwfile, @acl, @mods, $_, $m);
%user = %{$_[1]};
&lock_file($ENV{'MINISERV_CONFIG'});
&get_miniserv_config(\%miniserv);
delete($miniserv{"preroot_".$_[0]});
if ($user{'theme'}) {
$miniserv{"preroot_".$user{'name'}} = $user{'theme'};
}
elsif (defined($user{'theme'})) {
$miniserv{"preroot_".$user{'name'}} = "";
}
local @logout = split(/\s+/, $miniserv{'logouttimes'});
@logout = grep { $_ !~ /^$_[0]=/ } @logout;
if (defined($user{'logouttime'})) {
push(@logout, "$user{'name'}=$user{'logouttime'}");
}
$miniserv{'logouttimes'} = join(" ", @logout);
&put_miniserv_config(\%miniserv);
&unlock_file($ENV{'MINISERV_CONFIG'});
local @times;
push(@times, "days", $user{'days'}) if ($user{'days'} ne '');
push(@times, "hours", $user{'hoursfrom'}."-".$user{'hoursto'})
if ($user{'hoursfrom'});
&lock_file($miniserv{'userfile'});
open(PWFILE, $miniserv{'userfile'});
@pwfile = <PWFILE>;
close(PWFILE);
&open_tempfile(PWFILE, ">$miniserv{'userfile'}");
foreach (@pwfile) {
if (/^([^:]+):/ && $1 eq $_[0]) {
&print_tempfile(PWFILE,
"$user{'name'}:$user{'pass'}:",
"$user{'sync'}:$user{'cert'}:",
($user{'allow'} ? "allow $user{'allow'}" :
$user{'deny'} ? "deny $user{'deny'}" : ""),":",
join(" ", @times),"\n");
}
else {
&print_tempfile(PWFILE, $_);
}
}
&close_tempfile(PWFILE);
&unlock_file($miniserv{'userfile'});
&lock_file(&acl_filename());
@mods = &list_modules();
open(ACL, &acl_filename());
@acl = <ACL>;
close(ACL);
&open_tempfile(ACL, ">".&acl_filename());
foreach (@acl) {
if (/^(\S+):/ && $1 eq $_[0]) {
&print_tempfile(ACL, &acl_line($_[1], \@mods));
}
else {
&print_tempfile(ACL, $_);
}
}
&close_tempfile(ACL);
&unlock_file(&acl_filename());
delete($gconfig{"lang_".$_[0]});
$gconfig{"lang_".$user{'name'}} = $user{'lang'} if ($user{'lang'});
delete($gconfig{"notabs_".$_[0]});
$gconfig{"notabs_".$user{'name'}} = $user{'notabs'} if ($user{'notabs'});
delete($gconfig{"skill_".$_[0]});
$gconfig{"skill_".$user{'name'}} = $user{'skill'} if ($user{'skill'});
delete($gconfig{"risk_".$_[0]});
$gconfig{"risk_".$user{'name'}} = $user{'risk'} if ($user{'risk'});
delete($gconfig{"rbacdeny_".$_[0]});
$gconfig{"rbacdeny_".$user{'name'}} = $user{'rbacdeny'} if ($user{'rbacdeny'});
delete($gconfig{"ownmods_".$_[0]});
$gconfig{"ownmods_".$user{'name'}} = join(" ", @{$user{'ownmods'}})
if (@{$user{'ownmods'}});
delete($gconfig{"theme_".$_[0]});
$gconfig{"theme_".$user{'name'}} = $user{'theme'} if (defined($user{'theme'}));
delete($gconfig{"readonly_".$_[0]});
$gconfig{"readonly_".$user{'name'}} = $user{'readonly'}
if (defined($user{'readonly'}));
&write_file("$config_directory/config", \%gconfig);
if ($_[0] ne $user{'name'}) {
# Rename all .acl files if user renamed
foreach $m (@mods, "") {
local $file = "$config_directory/$m/$_[0].acl";
if (-r $file) {
&rename_file($file, "$config_directory/$m/$user{'name'}.acl");
}
}
local $file = "$config_directory/$_[0].acl";
if (-r $file) {
&rename_file($file, "$config_directory/$user{'name'}.acl");
}
}
if ($miniserv{'session'} && $_[0] ne $user{'name'}) {
# Modify all sessions for the renamed user
&rename_session_user(\&miniserv, $_[0], $user{'name'});
}
}
# delete_user(name)
# Delete some user from the ACL and password files
sub delete_user
{
local($_, @pwfile, @acl, %miniserv);
&lock_file($ENV{'MINISERV_CONFIG'});
&get_miniserv_config(\%miniserv);
delete($miniserv{"preroot_".$_[0]});
local @logout = split(/\s+/, $miniserv{'logouttimes'});
@logout = grep { $_ !~ /^$_[0]=/ } @logout;
$miniserv{'logouttimes'} = join(" ", @logout);
&put_miniserv_config(\%miniserv);
&unlock_file($ENV{'MINISERV_CONFIG'});
&lock_file($miniserv{'userfile'});
open(PWFILE, $miniserv{'userfile'});
@pwfile = <PWFILE>;
close(PWFILE);
&open_tempfile(PWFILE, ">$miniserv{'userfile'}");
foreach (@pwfile) {
if (!/^([^:]+):/ || $1 ne $_[0]) {
&print_tempfile(PWFILE, $_);
}
}
&close_tempfile(PWFILE);
&unlock_file($miniserv{'userfile'});
&lock_file(&acl_filename());
open(ACL, &acl_filename());
@acl = <ACL>;
close(ACL);
&open_tempfile(ACL, ">".&acl_filename());
foreach (@acl) {
if (!/^([^:]+):/ || $1 ne $_[0]) {
&print_tempfile(ACL, $_);
}
}
&close_tempfile(ACL);
&unlock_file(&acl_filename());
delete($gconfig{"lang_".$_[0]});
delete($gconfig{"notabs_".$_[0]});
delete($gconfig{"skill_".$_[0]});
delete($gconfig{"risk_".$_[0]});
delete($gconfig{"ownmods_".$_[0]});
delete($gconfig{"theme_".$_[0]});
delete($gconfig{"readonly_".$_[0]});
&write_file("$config_directory/config", \%gconfig);
# Delete all module .acl files
&unlink_file(map { "$config_directory/$_/$_[0].acl" } &list_modules());
&unlink_file("$config_directory/$_[0].acl");
if ($miniserv{'session'}) {
# Delete all sessions for the deleted user
&delete_session_user(\%miniserv, $_[0]);
}
}
# create_group(&group, [clone])
# Add a new webmin group
sub create_group
{
&lock_file("$config_directory/webmin.groups");
open(GROUP, ">>$config_directory/webmin.groups");
print GROUP &group_line($_[0]),"\n";
close(GROUP);
&unlock_file("$config_directory/webmin.groups");
if ($_[1]) {
foreach $m ("", &list_modules()) {
local $file = "$config_directory/$m/$_[1].gacl";
local $dest = "$config_directory/$m/$_[0]->{'name'}.gacl";
if (-r $file) {
local %macl;
&read_file($file, \%macl);
&write_file($dest, \%macl);
}
}
}
}
# modify_group(name, &group)
# Update a webmin group
sub modify_group
{
&lock_file("$config_directory/webmin.groups");
local $lref = &read_file_lines("$config_directory/webmin.groups");
foreach $l (@$lref) {
if ($l =~ /^([^:]+):/ && $1 eq $_[0]) {
$l = &group_line($_[1]);
}
}
&flush_file_lines();
&unlock_file("$config_directory/webmin.groups");
if ($_[0] ne $_[1]->{'name'}) {
# Rename all .gacl files if group renamed
foreach $m (@{$_[1]->{'modules'}}, "") {
local $file = "$config_directory/$m/$_[0].gacl";
if (-r $file) {
&rename_file($file,
"$config_directory/$m/$_[1]->{'name'}.gacl");
}
}
}
}
# delete_group(name)
# Delete a webmin group
sub delete_group
{
&lock_file("$config_directory/webmin.groups");
local $lref = &read_file_lines("$config_directory/webmin.groups");
@$lref = grep { !/^([^:]+):/ || $1 ne $_[0] } @$lref;
&flush_file_lines();
&unlock_file("$config_directory/webmin.groups");
&unlink_file(map { "$config_directory/$_/$_[0].gacl" } &list_modules());
}
# group_line(&group)
sub group_line
{
return join(":", $_[0]->{'name'},
join(" ", @{$_[0]->{'members'}}),
join(" ", @{$_[0]->{'modules'}}),
$_[0]->{'desc'},
join(" ", @{$_[0]->{'ownmods'}}) );
}
# acl_line(&user, &allmodules)
# Internal function to generate an ACL file line
sub acl_line
{
local(%user);
%user = %{$_[0]};
return "$user{'name'}: ".join(' ', @{$user{'modules'}})."\n";
}
# can_edit_user(user, [&groups])
sub can_edit_user
{
return 1 if ($access{'users'} eq '*');
if ($access{'users'} eq '~') {
return $base_remote_user eq $_[0];
}
local $u;
local $glist = $_[1] ? $_[1] : [ &list_groups() ];
foreach $u (split(/\s+/, $access{'users'})) {
if ($u =~ /^_(\S+)$/) {
foreach $g (@$glist) {
return 1 if ($g->{'name'} eq $1 &&
&indexof($_[0], @{$g->{'members'}}) >= 0);
}
}
else {
return 1 if ($u eq $_[0]);
}
}
return 0;
}
# open_session_db(\%miniserv)
sub open_session_db
{
local $sfile = $_[0]->{'sessiondb'} ? $_[0]->{'sessiondb'} :
$_[0]->{'pidfile'} =~ /^(.*)\/[^\/]+$/ ? "$1/sessiondb"
: return;
eval "use SDBM_File";
dbmopen(%sessiondb, $sfile, 0700);
eval { $sessiondb{'1111111111'} = 'foo bar' };
if ($@) {
dbmclose(%sessiondb);
eval "use NDBM_File";
dbmopen(%sessiondb, $sfile, 0700);
}
else {
delete($sessiondb{'1111111111'});
}
}
# delete_session_id(\%miniserv, id)
# Deletes one session from the database
sub delete_session_id
{
return 1 if (&is_readonly_mode());
&open_session_db($_[0]);
local $ex = exists($sessiondb{$_[1]});
delete($sessiondb{$_[1]});
dbmclose(%sessiondb);
return $ex;
}
# delete_session_user(\%miniserv, user)
# Deletes all sessions for some user
sub delete_session_user
{
return 1 if (&is_readonly_mode());
&open_session_db($_[0]);
foreach my $s (keys %sessiondb) {
local ($u,$t) = split(/\s+/, $sessiondb{$s});
if ($u eq $_[1]) {
delete($sessiondb{$s});
}
}
dbmclose(%sessiondb);
}
# rename_session_user(\%miniserv, olduser, newuser)
# Changes the username in all sessions for some user
sub rename_session_user
{
return 1 if (&is_readonly_mode());
&open_session_db(\%miniserv);
foreach my $s (keys %sessiondb) {
local ($u,$t) = split(/\s+/, $sessiondb{$s});
if ($u eq $_[1]) {
$sessiondb{$s} = "$_[2] $t";
}
}
dbmclose(%sessiondb);
}
# update_members(&allusers, &allgroups, &modules, &members)
# Update the members users and groups of some group
sub update_members
{
local $m;
foreach $m (@{$_[3]}) {
if ($m !~ /^\@(.*)$/) {
# Member is a user
local ($u) = grep { $_->{'name'} eq $m } @{$_[0]};
if ($u) {
$u->{'modules'} = [ @{$_[2]}, @{$u->{'ownmods'}} ];
&modify_user($u->{'name'}, $u);
}
}
else {
# Member is a group
local $gname = substr($m, 1);
local ($g) = grep { $_->{'name'} eq $gname } @{$_[1]};
if ($g) {
$g->{'modules'} = [ @{$_[2]}, @{$g->{'ownmods'}} ];
&modify_group($g->{'name'}, $g);
&update_members($_[0], $_[1], $g->{'modules'},
$g->{'members'});
}
}
}
}
# copy_acl_files(from, to, &modules)
# Copy all .acl files from some user to another in a list of modules
sub copy_acl_files
{
local $m;
foreach $m (@{$_[2]}) {
&unlink_file("$config_directory/$m/$_[1].acl");
local %acl;
if (&read_file("$config_directory/$m/$_[0].acl", \%acl)) {
&write_file("$config_directory/$m/$_[1].acl", \%acl);
}
}
}
# copy_group_acl_files(from, to, &modules)
# Copy all .acl files from some group to another in a list of modules
sub copy_group_acl_files
{
local $m;
foreach $m (@{$_[2]}) {
&unlink_file("$config_directory/$m/$_[1].gacl");
local %acl;
if (&read_file("$config_directory/$m/$_[0].gacl", \%acl)) {
&write_file("$config_directory/$m/$_[1].gacl", \%acl);
}
}
}
# copy_group_user_acl_files(from, to, &modules)
# Copy all .acl files from some group to a user in a list of modules
sub copy_group_user_acl_files
{
local $m;
foreach $m (@{$_[2]}) {
&unlink_file("$config_directory/$m/$_[1].acl");
local %acl;
if (&read_file("$config_directory/$m/$_[0].gacl", \%acl)) {
&write_file("$config_directory/$m/$_[1].acl", \%acl);
}
}
}
# set_acl_files(&allusers, &allgroups, module, &members, &access)
# Recursively update the ACL for all sub-users and groups of a group
sub set_acl_files
{
local $m;
foreach $m (@{$_[3]}) {
if ($m !~ /^\@(.*)$/) {
# Member is a user
local ($u) = grep { $_->{'name'} eq $m } @{$_[0]};
if ($u) {
local $aclfile =
"$config_directory/$_[2]/$u->{'name'}.acl";
&lock_file($aclfile);
&write_file($aclfile, $_[4]);
chmod(0640, $aclfile);
&unlock_file($aclfile);
}
}
else {
# Member is a group
local $gname = substr($m, 1);
local ($g) = grep { $_->{'name'} eq $gname } @{$_[1]};
if ($g) {
local $aclfile =
"$config_directory/$_[2]/$g->{'name'}.gacl";
&lock_file($aclfile);
&write_file($aclfile, $_[4]);
chmod(0640, $aclfile);
&unlock_file($aclfile);
&set_acl_files($_[0], $_[1], $_[2], $g->{'members'}, $_[4]);
}
}
}
}
# get_ssleay()
# Returns the path to OpenSSL or equivalent
sub get_ssleay
{
if (&has_command($config{'ssleay'})) {
return &has_command($config{'ssleay'});
}
elsif (&has_command("openssl")) {
return &has_command("openssl");
}
elsif (&has_command("ssleay")) {
return &has_command("ssleay");
}
else {
return undef;
}
}
# encrypt_password(password, [salt])
sub encrypt_password
{
local ($pass, $salt) = @_;
if ($gconfig{'md5pass'}) {
$salt ||= substr(time(), -8);
return crypt($pass, '$1$'.$salt);
}
else {
&seed_random();
$salt ||= chr(int(rand(26))+65).chr(int(rand(26))+65);
return &unix_crypt($pass, $salt);
}
}
# get_unixauth(\%miniserv)
# Returns a list of Unix users/groups/all and the Webmin user that they
# authenticate as
sub get_unixauth
{
local @rv;
local @ua = split(/\s+/, $_[0]->{'unixauth'});
foreach my $ua (@ua) {
if ($ua =~ /^(\S+)=(\S+)$/) {
push(@rv, [ $1, $2 ]);
}
else {
push(@rv, [ "*", $ua ]);
}
}
return @rv;
}
# save_unixauth(\%miniserv, &authlist)
# Updates %miniserv with the given Unix auth list
sub save_unixauth
{
local @ua;
foreach my $ua (@{$_[1]}) {
if ($ua->[0] ne "*") {
push(@ua, "$ua->[0]=$ua->[1]");
}
else {
push(@ua, $ua->[1]);
}
}
$_[0]->{'unixauth'} = join(" ", @ua);
}
# delete_from_groups(user|@group)
# Removes the specified user from all groups
sub delete_from_groups
{
local ($user) = @_;
foreach my $g (&list_groups()) {
local @mems = @{$g->{'members'}};
local $i = &indexof($user, @mems);
if ($i >= 0) {
splice(@mems, $i, 1);
$g->{'members'} = \@mems;
&modify_group($g->{'name'}, $g);
}
}
}
1;

215
acl/acl_security.pl Normal file
View File

@ -0,0 +1,215 @@
do 'acl-lib.pl';
# acl_security_form(&options)
# Output HTML for editing security options for the acl module
sub acl_security_form
{
local $o = $_[0];
print "<tr> <td valign=top><b>$text{'acl_users'}</b></td>\n";
print "<td valign=top>\n";
printf "<input type=radio name=users_def value=1 %s> %s\n",
$o->{'users'} eq '*' ? 'checked' : '', $text{'acl_uall'};
printf "<input type=radio name=users_def value=2 %s> %s<br>\n",
$o->{'users'} eq '~' ? 'checked' : '', $text{'acl_uthis'};
printf "<input type=radio name=users_def value=0 %s> %s<br>\n",
$o->{'users'} eq '*' || $o->{'users'} eq '~' ? '' : 'checked',
$text{'acl_usel'};
print "<select name=users multiple size=6 width=150>\n";
map { $ucan{$_}++ } split(/\s+/, $o->{'users'});
foreach $u (&list_users()) {
printf "<option %s>%s\n",
$ucan{$u->{'name'}} ? 'selected' : '',
$u->{'name'};
}
foreach $g (&list_groups()) {
printf "<option %s value=%s>%s\n",
$ucan{'_'.$g->{'name'}} ? 'selected' : '',
'_'.$g->{'name'}, &text('acl_gr', $g->{'name'});
}
print "</select></td>\n";
print "<td valign=top><b>$text{'acl_mods'}</b></td> ",
"<td valign=top>\n";
printf "<input type=radio name=mode value=0 %s> %s&nbsp;\n",
$o->{'mode'} == 0 ? 'checked' : '', $text{'acl_all'};
printf "<input type=radio name=mode value=1 %s> %s<br>\n",
$o->{'mode'} == 1 ? 'checked' : '', $text{'acl_own'};
printf "<input type=radio name=mode value=2 %s> %s<br>\n",
$o->{'mode'} == 2 ? 'checked' : '', $text{'acl_sel'};
print "&nbsp;&nbsp;&nbsp;<select name=mods multiple size=6>\n";
map { $mcan{$_}++ } split(/\s+/, $o->{'mods'});
foreach $m (&list_module_infos()) {
printf "<option value=%s %s>%s\n",
$m->{'dir'}, $mcan{$m->{'dir'}} ? 'selected' :'',
$m->{'desc'};
}
print "</select></td> </tr>\n";
print "<tr> <td><b>$text{'acl_create'}</b></td> <td>\n";
printf "<input type=radio name=create value=1 %s> $text{'yes'}\n",
$o->{'create'} ? 'checked' : '';
printf "<input type=radio name=create value=0 %s> $text{'no'}</td>\n",
$o->{'create'} ? '' : 'checked';
print "<td><b>$text{'acl_delete'}</b></td> <td>\n";
printf "<input type=radio name=delete value=1 %s> $text{'yes'}\n",
$o->{'delete'} ? 'checked' : '';
printf "<input type=radio name=delete value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'delete'} ? '' : 'checked';
print "<tr> <td><b>$text{'acl_rename'}</b></td> <td>\n";
printf "<input type=radio name=rename value=1 %s> $text{'yes'}\n",
$o->{'rename'} ? 'checked' : '';
printf "<input type=radio name=rename value=0 %s> $text{'no'}</td>\n",
$o->{'rename'} ? '' : 'checked';
print "<td><b>$text{'acl_acl'}</b></td> <td>\n";
printf "<input type=radio name=acl value=1 %s> $text{'yes'}\n",
$o->{'acl'} ? 'checked' : '';
printf "<input type=radio name=acl value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'acl'} ? '' : 'checked';
print "<tr> <td><b>$text{'acl_cert'}</b></td> <td>\n";
printf "<input type=radio name=cert value=1 %s> $text{'yes'}\n",
$o->{'cert'} ? 'checked' : '';
printf "<input type=radio name=cert value=0 %s> $text{'no'}</td>\n",
$o->{'cert'} ? '' : 'checked';
print "<td><b>$text{'acl_others'}</b></td> <td>\n";
printf "<input type=radio name=others value=1 %s> $text{'yes'}\n",
$o->{'others'} ? 'checked' : '';
printf "<input type=radio name=others value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'others'} ? '' : 'checked';
print "<tr> <td><b>$text{'acl_chcert'}</b></td> <td>\n";
printf "<input type=radio name=chcert value=1 %s> $text{'yes'}\n",
$o->{'chcert'} ? 'checked' : '';
printf "<input type=radio name=chcert value=0 %s> $text{'no'}</td>\n",
$o->{'chcert'} ? '' : 'checked';
print "<td><b>$text{'acl_lang'}</b></td> <td>\n";
printf "<input type=radio name=lang value=1 %s> $text{'yes'}\n",
$o->{'lang'} ? 'checked' : '';
printf "<input type=radio name=lang value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'lang'} ? '' : 'checked';
print "<tr> <td><b>$text{'acl_cats'}</b></td> <td>\n";
printf "<input type=radio name=cats value=1 %s> $text{'yes'}\n",
$o->{'cats'} ? 'checked' : '';
printf "<input type=radio name=cats value=0 %s> $text{'no'}</td>\n",
$o->{'cats'} ? '' : 'checked';
print "<td><b>$text{'acl_theme'}</b></td> <td>\n";
printf "<input type=radio name=theme value=1 %s> $text{'yes'}\n",
$o->{'theme'} ? 'checked' : '';
printf "<input type=radio name=theme value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'theme'} ? '' : 'checked';
print "<tr> <td><b>$text{'acl_ips'}</b></td> <td>\n";
printf "<input type=radio name=ips value=1 %s> $text{'yes'}\n",
$o->{'ips'} ? 'checked' : '';
printf "<input type=radio name=ips value=0 %s> $text{'no'}</td>\n",
$o->{'ips'} ? '' : 'checked';
print "<tr> <td><b>$text{'acl_perms'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=perms value=1 %s> $text{'acl_perms_1'}\n",
$o->{'perms'} ? 'checked' : '';
printf "<input type=radio name=perms value=0 %s> $text{'acl_perms_0'}</td>\n",
$o->{'perms'} ? '' : 'checked';
print "</tr>\n";
print "<tr> <td><b>$text{'acl_sync'}</b></td> <td>\n";
printf "<input type=radio name=sync value=1 %s> $text{'yes'}\n",
$o->{'sync'} ? 'checked' : '';
printf "<input type=radio name=sync value=0 %s> $text{'no'}</td>\n",
$o->{'sync'} ? '' : 'checked';
print "<td><b>$text{'acl_unix'}</b></td> <td>\n";
printf "<input type=radio name=unix value=1 %s> $text{'yes'}\n",
$o->{'unix'} ? 'checked' : '';
printf "<input type=radio name=unix value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'unix'} ? '' : 'checked';
print "<tr> <td><b>$text{'acl_sessions'}</b></td> <td>\n";
printf "<input type=radio name=sessions value=1 %s> $text{'yes'}\n",
$o->{'sessions'} ? 'checked' : '';
printf "<input type=radio name=sessions value=0 %s> $text{'no'}</td>\n",
$o->{'sessions'} ? '' : 'checked';
print "<td><b>$text{'acl_switch'}</b></td> <td>\n";
printf "<input type=radio name=switch value=1 %s> $text{'yes'}\n",
$o->{'switch'} ? 'checked' : '';
printf "<input type=radio name=switch value=0 %s> $text{'no'}</td> </tr>\n",
$o->{'switch'} ? '' : 'checked';
print "<tr> <td><b>$text{'acl_times'}</b></td> <td>\n";
printf "<input type=radio name=times value=1 %s> $text{'yes'}\n",
$o->{'times'} ? 'checked' : '';
printf "<input type=radio name=times value=0 %s> $text{'no'}</td>\n",
$o->{'times'} ? '' : 'checked';
print "</tr>\n";
print "<tr> <td colspan=4><hr></td> </tr>\n";
print "<tr> <td valign=top><b>$text{'acl_groups'}</b></td> <td valign=top>\n";
printf "<input type=radio name=groups value=1 %s> $text{'yes'}\n",
$o->{'groups'} == 1 ? 'checked' : '';
printf "<input type=radio name=groups value=0 %s> $text{'no'}</td>\n",
$o->{'groups'} == 0 ? 'checked' : '';
print "<td valign=top><b>$text{'acl_gassign'}</b></td> <td>\n";
printf "<input type=radio name=gassign_def value=1 %s> %s\n",
$o->{'gassign'} eq '*' ? 'checked' : '', $text{'acl_gall'};
printf "<input type=radio name=gassign_def value=0 %s> %s<br>\n",
$o->{'gassign'} eq '*' ? '' : 'checked', $text{'acl_gsel'};
print "<select name=gassign multiple size=3 width=150>\n";
map { $gcan{$_}++ } split(/\s+/, $o->{'gassign'});
printf "<option value=_none %s>&lt;%s&gt;\n",
$gcan{'_none'} ? 'selected' : '', $text{'acl_gnone'};
foreach $g (&list_groups()) {
printf "<option %s>%s\n",
$gcan{$g->{'name'}} ? 'selected' : '', $g->{'name'};
}
print "</select></td> </tr>\n";
}
# acl_security_save(&options)
# Parse the form for security options for the acl module
sub acl_security_save
{
if ($in{'users_def'} == 1) {
$_[0]->{'users'} = '*';
}
elsif ($in{'users_def'} == 2) {
$_[0]->{'users'} = '~';
}
else {
$_[0]->{'users'} = join(" ", split(/\0/, $in{'users'}));
}
$_[0]->{'mode'} = $in{'mode'};
$_[0]->{'mods'} = $in{'mode'} == 2 ? join(" ", split(/\0/, $in{'mods'}))
: undef;
$_[0]->{'create'} = $in{'create'};
$_[0]->{'groups'} = $in{'groups'};
$_[0]->{'delete'} = $in{'delete'};
$_[0]->{'rename'} = $in{'rename'};
$_[0]->{'acl'} = $in{'acl'};
$_[0]->{'others'} = $in{'others'};
$_[0]->{'cert'} = $in{'cert'};
$_[0]->{'chcert'} = $in{'chcert'};
$_[0]->{'lang'} = $in{'lang'};
$_[0]->{'perms'} = $in{'perms'};
$_[0]->{'gassign'} = $in{'gassign_def'} ? '*' :
join(" ", split(/\0/, $in{'gassign'}));
$_[0]->{'sync'} = $in{'sync'};
$_[0]->{'unix'} = $in{'unix'};
$_[0]->{'switch'} = $in{'switch'};
$_[0]->{'sessions'} = $in{'sessions'};
$_[0]->{'cats'} = $in{'cats'};
$_[0]->{'theme'} = $in{'theme'};
$_[0]->{'ips'} = $in{'ips'};
$_[0]->{'times'} = $in{'times'};
}

99
acl/backup_config.pl Normal file
View File

@ -0,0 +1,99 @@
do 'acl-lib.pl';
# backup_config_files()
# Returns files and directories that can be backed up
sub backup_config_files
{
local @rv;
# Add primary user and group files
local %miniserv;
&get_miniserv_config(\%miniserv);
push(@rv, $miniserv{'userfile'});
push(@rv, &acl_filename());
# Add all .acl files for users and groups
local $u;
foreach $u (&list_users(), &list_groups()) {
push(@rv, "$config_directory/$u->{'name'}.acl",
glob("$config_directory/*/$u->{'name'}.acl"));
}
# Add /etc/webmin/config
system("cp $config_directory/config $config_directory/config.aclbackup");
push(@rv, "$config_directory/config.aclbackup");
# Add /etc/webmin/miniserv.conf
system("cp $config_directory/miniserv.conf $config_directory/miniserv.conf.aclbackup");
push(@rv, "$config_directory/miniserv.conf.aclbackup");
return @rv;
}
# pre_backup(&files)
# Called before the files are actually read
sub pre_backup
{
return undef;
}
# post_backup(&files)
# Called after the files are actually read
sub post_backup
{
unlink("$config_directory/config.aclbackup");
unlink("$config_directory/miniserv.conf.aclbackup");
return undef;
}
# pre_restore(&files)
# Called before the files are restored from a backup
sub pre_restore
{
# Remove user and group .acl files
local $u;
foreach $u (&list_users(), &list_groups()) {
unlink("$config_directory/$u->{'name'}.acl",
glob("$config_directory/*/$u->{'name'}.acl"));
}
return undef;
}
# post_restore(&files)
# Called after the files are restored from a backup
sub post_restore
{
# Splice global config entries for users into real config
local %aclbackup;
&read_file("$config_directory/config.aclbackup", \%aclbackup);
unlink("$config_directory/config.aclbackup");
local $k;
foreach $k (keys %gconfig) {
delete($gconfig{$k}) if ($k =~ /^(lang_|notabs_|skill_|risk_|theme_|ownmods_)/);
}
foreach $k (keys %aclbackup) {
$gconfig{$k} = $aclbackup{$k} if ($k =~ /^(lang_|notabs_|skill_|risk_|theme_|ownmods_)/);
}
&write_file("$config_directory/config", \%gconfig);
# Splice miniserv.conf entries for users into real config
%aclbackup = ( );
&read_file("$config_directory/miniserv.conf.aclbackup", \%aclbackup);
unlink("$config_directory/miniserv.conf.aclbackup");
local %miniserv;
&get_miniserv_config(\%miniserv);
foreach $k (keys %miniserv) {
delete($miniserv{$k}) if ($k =~ /^(preroot_)/);
}
foreach $k (keys %aclbackup) {
$miniserv{$k} = $aclbackup{$k} if ($k =~ /^(preroot_)/);
}
&put_miniserv_config(\%miniserv);
&restart_miniserv();
return undef;
}
1;

354
acl/cert_form.cgi Executable file
View File

@ -0,0 +1,354 @@
#!/usr/local/bin/perl
# cert_form.cgi
require './acl-lib.pl';
&ui_print_header(undef, $text{'cert_title'}, "", undef, undef, undef, undef, undef, undef,
"language=VBSCRIPT onload='postLoad()'");
eval "use Net::SSLeay";
print "<p>$text{'cert_msg'}<p>\n";
if ($ENV{'SSL_USER'}) {
print &text('cert_already', "<tt>$ENV{'SSL_USER'}</tt>"),
"<p>\n";
}
if ($ENV{'HTTP_USER_AGENT'} =~ /MSIE/i) {
# Special VBscript and ActiveX hacks are needed for IE
print <<EOF;
<OBJECT classid="clsid:127698e4-e730-4e5c-a2b1-21490a70c8a1" sXEnrollVersion="5,131,3659,0" codebase="xenroll.dll" id=Enroll>
</OBJECT>
<SCRIPT type="text/vbscript">
Option Explicit
Function MakeKeyFlags(keysize)
Dim flags
' If CRYPT_EXPORTABLE is set, the generated private key can be exported
' from IE in passphrase protected pkcs12 envelope.
' If CRYPT_USER_PROTECTED is set, the user is allowed to select security
' level for the generated private key. If not set the lowest security
' level is set as default. This means that private key is not protected
' on local disk and user is not prompted is the key is used to sign data.
Const CRYPT_EXPORTABLE = 1
Const CRYPT_USER_PROTECTED = 2
If document.certform.protectkey.checked = true Then
flags = CRYPT_EXPORTABLE Or CRYPT_USER_PROTECTED
Else
flags = CRYPT_EXPORTABLE
End If
MakeKeyFlags = flags Or ( keysize * 65536)
End Function
Function CreatePKCS10Request(keysize)
Dim DNName
Const AT_KEYEXCHANGE = 1
Const AT_SIGNATURE = 2
DNName = "CN="+document.requestData.commonName.value+", O="+document.requestData.organizationName.value+", OU="+document.requestData.organizationalUnitName.value+", ST="+document.requestData.stateOrProvinceName.value+", C="+document.requestData.countryName.value+", Email="+document.requestData.emailAddress.value
Enroll.RequestStoreFlags = &H20000
' document.requestData.storeflags.value = "&H20000"
Enroll.GenKeyFlags = MakeKeyFlags(keysize)
Enroll.KeySpec = AT_KEYEXCHANGE
CreatePKCS10Request = Enroll.createPKCS10(DNName, "")
End Function
sub CertRequestSub
Dim keysize
keysize = document.certform.keysize.value
document.requestData.data.value = CreatePKCS10Request(keysize)
document.requestData.action.value = "submit"
document.requestData.reqkeysize.value = keysize
document.requestData.submit()
end sub
sub CertRequestEdit
Dim keysize
keysize = document.certform.keysize.value
document.requestData.data.value = CreatePKCS10Request(keysize)
document.requestData.action.value = "edit"
document.requestData.reqkeysize.value = keysize
document.requestData.submit()
end sub
'-----------------------------------------------------------------
' IE SPECIFIC:
' Get the list of CSPs from Enroll
' returns error number
' assumes Enroll is named 'Enroll' and the list box is 'document.certform.lbCSP'
Function GetCSPList()
On Error Resume Next
Dim nProvType, nOrigProvType, nTotCSPs, nDefaultCSP, bNoDssBase, bNoDssDh, sUserAgent
' should be >= the number of providers defined in wincrypt.h (~line 431)
Const nMaxProvType=25
nTotCSPs=0
nDefaultCSP=-1
sUserAgent=navigator.userAgent
If CInt(Mid(sUserAgent, InStr(sUserAgent, "MSIE")+5, 1))<=4 Then
bNoDssDh=True
bNoDssBase=True
Else
bNoDssDh=False
If 0<>InStr(sUserAgent, "95") Then
bNoDssBase=True
' NT 4 does not include version num in string.
ElseIf 0<>InStr(sUserAgent, "NT)") Then
bNoDssBase=True
Else
bNoDssBase=False
End If
End If
' save the original provider type
nOrigProvType=Enroll.ProviderType
If 0 <> Err.Number Then
' something wrong with Enroll
GetCSPList=Err.Number
Exit Function
End If
' enumerate through each of the provider types
For nProvType=0 To nMaxProvType
Dim nCSPIndex
nCSPIndex=0
Enroll.ProviderType=nProvType
' enumerate through each of the providers for this type
Do
Dim sProviderName
'get the name
sProviderName=Enroll.enumProviders(nCSPIndex, 0)
If &H80070103=Err.Number Then
' no more providers
Err.Clear
Exit Do
ElseIf 0<>Err.Number Then
' something wrong with Enroll
' - ex, Win16 IE4 Enroll doesn't support this call.
GetCSPList=Err.Number
Exit Function
End If
If ("Microsoft Base DSS Cryptographic Provider"=sProviderName And True=bNoDssBase) _
Or ("Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"=sProviderName And True=bNoDssDh) Then
' skip this provider
Else
' For each provider, add an element to the list box.
Dim oOption
Set oOption=document.createElement("Option")
oOption.text=sProviderName
oOption.Value=nProvType
document.certform.lbCSP.add(oOption)
If InStr(sProviderName, "Microsoft Enhanced Cryptographic Provider") <> 0 Then
oOption.selected=True
nDefaultCSP=nTotCSPs
End If
nTotCSPs=nTotCSPs+1
End If
' get the next provider
nCSPIndex=nCSPIndex+1
Loop
Next
' if there are no CSPs, we're kinda stuck
If 0=nTotCSPs Then
Set oElement=document.createElement("Option")
oElement.text="-- No CSP's found --"
document.certform.lbCSP.Options.Add(oElement)
End If
' remove the 'loading' text
document.certform.lbCSP.remove(0)
' select the default provider
If -1 <> nDefaultCSP Then
document.certform.lbCSP.selectedIndex=nDefaultCSP
End If
' restore the original provider type
Enroll.ProviderType=nOrigProvType
' set the return value and exit
If 0 <> Err.Number Then
GetCSPList=Err.Number
ElseIf 0 = nTotCSPs Then
' signal no elements with -1
GetCSPList=-1
Else
GetCSPList=0
End If
End Function
Function postLoad()
On Error Resume Next
Dim nResult
nResult = 0
' get the CSP list
nResult = GetCSPList()
if 0 <> nResult Then
Exit Function
end if
handleCSPChange()
End Function
Function handleCSPChange()
Dim g_bOkToSubmit, nCSPIndex, nProvType, nSupportedKeyUsages
Dim keymax, keymin
' IE is not ready until Enroll has been loaded
g_bOkToSubmit = false
' some constants defined in wincrypt.h:
Const CRYPT_EXPORTABLE = 1
Const CRYPT_USER_PROTECTED = 2
Const CRYPT_MACHINE_KEYSET = &H20
Const AT_KEYEXCHANGE = 1
Const AT_SIGNATURE = 2
Const CERT_SYSTEM_STORE_LOCAL_MACHINE = &H20000
Const ALG_CLASS_ANY = 0
Const ALG_CLASS_SIGNATURE = &H2000
Const ALG_CLASS_HASH = &H4000
Const PROV_DSS=3
Const PROV_DSS_DH=13
' convenience constants, for readability
Const KEY_LEN_MIN=true
Const KEY_LEN_MAX=false
Const KEY_USAGE_EXCH=0
Const KEY_USAGE_SIG=1
Const KEY_USAGE_BOTH=2
' defaults
Const KEY_LEN_MIN_DEFAULT=384
Const KEY_LEN_MAX_DEFAULT=16384
nCSPIndex = document.certform.lbCSP.selectedIndex
Enroll.ProviderName = document.certform.lbCSP.options(nCSPIndex).text
nProvType = document.certform.lbCSP.options(nCSPIndex).value
Enroll.ProviderType = nProvType
nSupportedKeyUsages = AT_KEYEXCHANGE
if (PROV_DSS = nProvType OR PROV_DSS_DH = nProvType) then
nSupportedKeyUsages = AT_SIGNATURE
end if
document.certform.keyusage.value="both"
End Function
</SCRIPT>
<form name="requestData" action="cert_issue_ie.cgi" method=post>
<input type="hidden" name="data">
<input type="hidden" name="action" value="">
<input type="hidden" name="reqkeysize" value="">
<table border>
<tr $tb> <td><b>$text{'cert_header'}</b></td> </tr>
<tr $cb> <td><table>
<tr> <td> <b>$text{'cert_cn'}</b> </td>
<td> <input type="text" size=30 name="commonName" value="">
</td> </tr>
<tr> <td> <b>$text{'cert_email'}</b> </td>
<td> <input type="text" size=30 name="emailAddress" value="">
</td> </tr>
<tr> <td> <b>$text{'cert_ou'}</b> </td>
<td> <input type="text" size=30 name="organizationalUnitName" value="">
</td> </tr>
<tr> <td> <b>$text{'cert_o'}</b> </td>
<td> <input type="text" size=30 name="organizationName" value="">
</td> </tr>
<tr> <td> <b>$text{'cert_sp'}</b> </td>
<td> <input type="text" size=15 name="stateOrProvinceName" value="">
</td> </tr>
<tr> <td> <b>$text{'cert_c'}</b> </td>
<td> <input type="text" size=2 name="countryName" value="">
</td> </tr>
<input type="hidden" name="storeflags" value="">
</form>
<form name="certform">
<tr><td><b>CSP</b></td>
<td><select name="lbCSP" onchange="handleCSPChange()" language="VBSCRIPT">
<option id=locLoading selected>Loading...
</select></td></tr>
<tr>
<td><b>Key size</b></td>
<td><select name=keysize>
<option value=512> 512
<option value=1024 selected> 1024
<option value=2048> 2048
</select>
bits.
<em> Please note that not all CSP's support all key sizes. </em>
</td></tr>
<input type=hidden name=keyusage value="signature">
<input type="hidden" name="storeflags" value="">
<tr> <td><b>Private key protection</b></td>
<td><input type="checkbox" name="protectkey" value="protectkey" checked>
<em>Adds additional security options to private key storage.</em></td> </tr>
</table></td></tr></table>
<input type="button" name="request" value="Submit Request"
onClick="CertRequestSub" language="VBSCRIPT"
src="icons/submitrequest.gif" border=0>
</form>
EOF
}
elsif ($ENV{'HTTP_USER_AGENT'} =~ /Mozilla/i) {
# Output a form that works for netscape and mozilla
print "<form action=cert_issue.cgi>\n";
print "<table border>\n";
print "<tr $tb> <td><b>$text{'cert_header'}</b></td> </tr>\n";
print "<tr $cb> <td><table>\n";
print "<tr> <td><b>$text{'cert_cn'}</b></td>\n";
print "<td><input name=commonName size=30></td> </tr>\n";
print "<tr> <td><b>$text{'cert_email'}</b></td>\n";
print "<td><input name=emailAddress size=30></td> </tr>\n";
print "<tr> <td><b>$text{'cert_ou'}</b></td>\n";
print "<td><input name=organizationalUnitName size=30></td> </tr>\n";
print "<tr> <td><b>$text{'cert_o'}</b></td>\n";
print "<td><input name=organizationName size=30></td> </tr>\n";
print "<tr> <td><b>$text{'cert_sp'}</b></td>\n";
print "<td><input name=stateOrProvinceName size=15></td> </tr>\n";
print "<tr> <td><b>$text{'cert_c'}</b></td>\n";
print "<td><input name=countryName size=2></td> </tr>\n";
print "<tr> <td><b>$text{'cert_key'}</b></td>\n";
print "<td><keygen name=key></td> </tr>\n";
print "</table></td></tr></table>\n";
print "<input type=submit value='$text{'cert_issue'}'>\n";
print "</form>\n";
}
else {
# Unsupported browser!
print "<p><b>",&text('cert_ebrowser',
"<tt>$ENV{'HTTP_USER_AGENT'}</tt>"),"</b><p>\n";
}
&ui_print_footer("", $text{'index_return'});

52
acl/cert_issue.cgi Executable file
View File

@ -0,0 +1,52 @@
#!/usr/local/bin/perl
# cert_issue.cgi
require './acl-lib.pl';
&ReadParse();
&error_setup($text{'cert_err'});
$in{'key'} || &error($text{'cert_ekey'});
&get_miniserv_config(\%miniserv);
# Create the new key
$temp1 = &transname();
$temp2 = &tempname();
open(IN, ">$temp1");
foreach $k ("emailAddress", "organizationalUnitName", "organizationName",
"stateOrProvinceName", "countryName", "commonName") {
print IN "$k = $in{$k}\n";
}
$in{'key'} =~ s/\s//g;
print IN "SPKAC = $in{'key'}\n";
close(IN);
$cmd = &get_ssleay();
$ssleay = &backquote_logged("$cmd ca -spkac $temp1 -out $temp2 -config $module_config_directory/openssl.cnf -days 1095 2>&1");
unlink($temp1);
if ($?) {
&error("<pre>$ssleay</pre>");
}
else {
# Display status and redirect to actual cert file
$| = 1;
&ui_print_header(undef, $text{'cert_title'}, "");
print "<p>",&text('cert_done', $in{'commonName'}),"<p>\n";
print "<font size=+1>",&text('cert_pickup', "cert_output.cgi?file=$temp2"),"</font><p>\n";
&ui_print_footer("", $text{'index_return'});
# Update the miniserv users file
&lock_file($miniserv{'userfile'});
$lref = &read_file_lines($miniserv{'userfile'});
foreach $l (@$lref) {
@u = split(/:/, $l);
if ($u[0] eq $base_remote_user) {
$l = "$u[0]:$u[1]:$u[2]:/C=$in{'countryName'}/ST=$in{'stateOrProvinceName'}/O=$in{'organizationName'}/OU=$in{'organizationalUnitName'}/CN=$in{'commonName'}/Email=$in{'emailAddress'}";
}
}
&flush_file_lines();
&unlock_file($miniserv{'userfile'});
sleep(1);
&restart_miniserv();
&webmin_log("cert", undef, $base_remote_user, \%in);
}

121
acl/cert_issue_ie.cgi Executable file
View File

@ -0,0 +1,121 @@
#!/usr/local/bin/perl
# cert_issue_ie.cgi
require './acl-lib.pl';
&ReadParse();
&error_setup($text{'cert_err'});
&get_miniserv_config(\%miniserv);
# Save certificate request to a file
$req = $in{'data'};
$req =~ s/\r|\n//g;
$temp = &transname();
open(TEMP, ">$temp");
print TEMP "-----BEGIN CERTIFICATE REQUEST-----\n";
$result = 1;
while($result) {
$result = substr($req, 0, 72);
if($result) {
print TEMP "$result\n";
$req = substr($req, 72);
}
}
print TEMP "-----END CERTIFICATE REQUEST-----\n";
close(TEMP);
# Call the openssl CA command to process the request
$temp2 = &transname();
$cmd = &get_ssleay();
$out = &backquote_logged("yes | $cmd ca -in $temp -out $temp2 -config $module_config_directory/openssl.cnf -days 1095 2>&1");
if ($?) {
unlink($temp);
&error("<pre>$out</pre>");
}
unlink($temp);
# Create CRL if needed
$crl = "$module_config_directory/crl.pem";
if (!-r $crl_file) {
$out = &backquote_logged("$config{'ssleay'} ca -gencrl -out $crl -config $module_config_directory/openssl.cnf 2>&1");
if ($?) {
&error("<pre>$out</pre>");
}
}
# Call the openssl crl2pkcs7 command to add to the CRL
$temp3 = &transname();
$out = &backquote_logged("$config{'ssleay'} crl2pkcs7 -certfile $temp2 -in $crl -out $temp3 2>&1");
if ($?) {
unlink($temp2);
&error("<pre>$out</pre>");
}
unlink($temp2);
open(OUT, $temp3);
while(<OUT>) {
s/\r|\n//g;
if (/BEGIN PKCS7/) {
$started++;
}
elsif (/END PKCS7/) {
last;
}
elsif ($started) {
$certificate .= $_;
}
}
close(OUT);
unlink($temp3);
# Output HTML for IE to install the new cert
$certdone = &text('cert_done', $in{'commonName'});
&ui_print_header(undef, $text{'cert_title'}, "");
print <<EOF;
<OBJECT classid="clsid:127698e4-e730-4e5c-a2b1-21490a70c8a1" sXEnrollVersion="5,131,3659,0" id=Enroll>
</OBJECT>
<SCRIPT type="text/vbscript">
sub CertAcceptSub()
on error resume next
Enroll.MyStoreFlags=&H10000
Enroll.RequestStoreFlags=&H10000
Enroll.acceptPKCS7(document.resultData.result.value)
if err.Number <> 0 then
msgbox "Error: Could not insert the PKCS7 envelope"
else
msgbox "Installed certificate OK"
end if
end sub
</SCRIPT>
<form name="resultData">
<input type="hidden" name="result" value="$certificate">
<p>$certdone<p>
<input type=hidden name=storeflags value="&H10000">
<input type="button" name="accept" value="$text{'cert_install'}"
onClick="CertAcceptSub" language="vbscript">
</form>
EOF
&ui_print_footer("", $text{'index_return'});
# Update the miniserv users file
&lock_file($miniserv{'userfile'});
$lref = &read_file_lines($miniserv{'userfile'});
foreach $l (@$lref) {
@u = split(/:/, $l);
if ($u[0] eq $base_remote_user) {
$l = "$u[0]:$u[1]:$u[2]:/C=$in{'countryName'}/ST=$in{'stateOrProvinceName'}/O=$in{'organizationName'}/OU=$in{'organizationalUnitName'}/CN=$in{'commonName'}/Email=$in{'emailAddress'}";
}
}
&flush_file_lines();
&unlock_file($miniserv{'userfile'});
sleep(1);
&restart_miniserv();
&webmin_log("cert", undef, $base_remote_user, \%in);

13
acl/cert_output.cgi Executable file
View File

@ -0,0 +1,13 @@
#!/usr/local/bin/perl
# cert_issue.cgi
require './acl-lib.pl';
&ReadParse();
print "Content-type: application/x-x509-user-cert\n\n";
open(OUT, $in{'file'});
while(<OUT>) {
print;
}
close(OUT);
unlink($in{'file'});

4
acl/config Normal file
View File

@ -0,0 +1,4 @@
ssleay=/usr/local/ssl/bin/openssl
select=0
order=0
display=1

4
acl/config-*-linux Normal file
View File

@ -0,0 +1,4 @@
ssleay=/usr/bin/openssl
select=0
order=0
display=1

4
acl/config-freebsd Normal file
View File

@ -0,0 +1,4 @@
ssleay=/usr/bin/openssl
select=0
order=0
display=1

4
acl/config-macos Normal file
View File

@ -0,0 +1,4 @@
ssleay=/usr/bin/openssl
select=0
order=0
display=1

4
acl/config-netbsd Normal file
View File

@ -0,0 +1,4 @@
ssleay=/usr/bin/openssl
select=0
order=0
display=1

4
acl/config-openbsd Normal file
View File

@ -0,0 +1,4 @@
ssleay=/usr/bin/openssl
select=0
order=0
display=1

4
acl/config-solaris-10-* Executable file
View File

@ -0,0 +1,4 @@
ssleay=/usr/sfw/bin/openssl
select=0
order=0
display=1

6
acl/config.info Normal file
View File

@ -0,0 +1,6 @@
line1=Configurable options,11
display=User and group display mode,1,1-Names only,0-Names and modules
select=Display user modules in,1,0-Table,1-Pulldown menu
order=Sort users and groups by,1,0-Order in file,1-Name
line2=System configuration,11
ssleay=Path to openssl or ssleay program,3,Automatic

5
acl/config.info.bg Normal file
View File

@ -0,0 +1,5 @@
line1=Конфигурационни опции,11
select=Показвай юзерските модули в,1,0-таблица,1-Падащо меню
order=Подреди юзери и групи по,1,0-подредба във файл,1-име
line2=Системна конфигурация,11
ssleay=Път към openssl или ssleay програма,0

6
acl/config.info.ca Normal file
View File

@ -0,0 +1,6 @@
line1=Opcions configurables,11
display=Forma de mostrar els usuaris i els grups,1,1-Només els noms,0-Noms i mòduls
select=Mostra els mòduls d'usuaris amb,1,0-Taula,1-Menú desplegable
order=Ordena els usuaris i grups per,1,0-L'ordre del fitxer,1-El nom
line2=Configuració del sistema,11
ssleay=Camí del programa openssl o ssleay,3,Automàtic

1
acl/config.info.cz Normal file
View File

@ -0,0 +1 @@
ssleay=Cesta k programu openssl nebo ssleay,0

6
acl/config.info.da Normal file
View File

@ -0,0 +1,6 @@
line1=Konfigurerbare indstillinger,11
display=Bruger og gruppe visnings mode,1,1-Kun navne,0-Navne og moduler
select=Vis brugermoduler i,1.0-Tabel,1-Pulldown menu
order=Sorter brugere og grupper ved,1.0-Sortering i fil,1-Navn
line2=Systemkonfiguration,11
ssleay=Sti til openssl eller ssleay progarm,3,Automatisk

6
acl/config.info.de Normal file
View File

@ -0,0 +1,6 @@
line1=Konfigurierbare Optionen,11
display=Benutzer- und Gruppenanzeige,1,1-Nur Namen,0-Namen und Module
select=Zeige Benutzermodule als,1,0-Tabelle,1-Auswahlliste
order=Benutzer- und Gruppensortierung,1,0-Reihenfolge in Datei,1-Name
line2=Systemkonfiguration,11
ssleay=Pfad zu OpenSSL oder SSLeay,3,Automatisch

6
acl/config.info.es Normal file
View File

@ -0,0 +1,6 @@
line1=Opciones Configurables,11
display=Modo de mostrar usuario y grupo,1,1-S&#243;lo nombres,0-Nombres y m&#243;dulos
select=Mostrar m&#243;dulos de usuario en,1,0-Tabla,1-Men&#250; desplegable
order=Clasificar usuarios y grupos por,1,0-Orden en archivo,1-Nombre
line2=Configuraci&#243;n de Sistema,11
ssleay=Trayectoria al programa openssl o ssleay,0

8
acl/config.info.fa Normal file
View File

@ -0,0 +1,8 @@

line1=گزينه‌هاي پيکربندي,11
display=حالت نمايش کاربران و گروه‌ها,1,1-فقط نامها,0-نامها و پيمانه‌ها
select=نمايش پيمانه‌هاي کاربر در,1,0-جدول,1-گزينگان پايين بر
order=مرتب سازي کاربران و گروه‌ها براساس,1,0-ترتيب در پرونده,1-نام
line2=پيکربندي سيستم,11
ssleay=مسير براي openssl يا برنامه ssleay,3,خودکار

6
acl/config.info.fr Normal file
View File

@ -0,0 +1,6 @@
line1=Options configurables,11
display=Mode d'affichage des utilisateurs et des groupes,1,1-Noms seulement,0-Noms et modules
select=Afficher les modules utilisateur par,1,0-Table,1-Menu d&#233;roulant
order=Trier les utilisateurs et les groupes par,1,0-Ordre dans le fichier,1-Nom
line2=Configuration du syst&#232;me,11
ssleay=Chemin d'acc&#232;s au programme openssl ou ssleay,3,Automatique

6
acl/config.info.hu Normal file
View File

@ -0,0 +1,6 @@
line1=Konfigurálható beállítások,11
display=Felhasználó és csoport megjelenítési mód,1,1-Csak a neveket,0-Neveket és modulokat
select=A modulok megjelenítsi módja,1,0-Táblázat,1-Menü
order=Felhasználók és csoportok rendezése,1,0-A fájl rendezése szerint,1-Név szerint
line2=Rendszer konfiguráció,11
ssleay=Az <code>openssl</code> vagy <code>ssleay</code> program teljes elérési útja,0

View File

@ -0,0 +1,5 @@
select=ユーザモジュールの表示方法,1,0-表,1-プルダウンメニュー
order=ユーザとグループのソート順,1,0-ファイル順,1-名前順
line1=設定可能なオプション,11
line2=システム設定,11
ssleay=opensslプログラムまたはssleayプログラムのパス,0

View File

@ -0,0 +1,5 @@
ssleay=opensslプログラムまたはssleayプログラムのパス,0
select=ユーザモジュールの表示方法,1,0-表,1-プルダウンメニュー
line1=設定可能なオプション,11
order=ユーザとグループのソート順,1,0-ファイル順,1-名前順
line2=システム設定,11

6
acl/config.info.nl Normal file
View File

@ -0,0 +1,6 @@
line1=Instelbare opties,11
display=Gebruiker en groep weergave instelling,1,1-Alleen Namen,0-Namen en modules
select=Geef gebruiker modules weer in,1,0-Tabel,1-Pulldown menu
order=Sorteer gebruikers en groepen op,1,0-Volgorde in bestand,1-Naam
line2=Systeem configuratie,11
ssleay=Pad naar openssl of ssleay programma,3,Automatisch

14
acl/config.info.no Normal file
View File

@ -0,0 +1,14 @@
#########################################
#line1=Configurable options,11
#select=Display user modules in,1,0-Table,1-Pulldown menu
#order=Sort users and groups by,1,0-Order in file,1-Name
#line2=System configuration,11
#ssleay=Path to openssl or ssleay program,0
#####################################################
line1=Konfigurerbare opsjoner,11
select=Vis bruker modulen i,1,0-Tabell,1-Pulldown meny
order=Sorter brukere og grupper etter,1,0-Rekefølge i filen,1-Navn
line2=System konfigurasjon,11
ssleay=Stien til openssl eller ssleay program,0

3
acl/config.info.pl Normal file
View File

@ -0,0 +1,3 @@
ssleay=Scieżka do programu openssl lub ssleay,0
select=Wyświetl moduły użytkownika w,1,0-Tabeli,1-Rozwijalnym menu
order=Porządkuj użytkowników i&nbap;grupy wg,1,0-Kolejności w&nbsp;zbiorze,1-Nazwy

5
acl/config.info.pt_BR Normal file
View File

@ -0,0 +1,5 @@
line1=Opções configuráveis,11
select=Exibir módulos de usuários em,1,0-Tabela,1-Menus
order=Ordenar usuários e grupos por,1,0-Ordem no arquivo,1-Nome
line2=Configuração do sistema,11
ssleay=Caminho para o programa openssl ou ssleay,0

5
acl/config.info.ru_RU Normal file
View File

@ -0,0 +1,5 @@
select=Показывать модули пользователя в виде,1,0-Таблицы,1-Выпадающего меню
ssleay=Путь к программе openssl или ssleay,0
order=Упорядочивать пользователей и группы по,1,0-Очередности в файле,1-Имени
line1=Настраиваемые параметры,11
line2=Системные параметры,11

5
acl/config.info.ru_SU Normal file
View File

@ -0,0 +1,5 @@
line1=Настраиваемые параметры,11
select=Показывать модули пользователя в виде,1,0-Таблицы,1-Выпадающего меню
order=Упорядочивать пользователей и группы по,1,0-Очередности в файле,1-Имени
line2=Системные параметры,11
ssleay=Путь к программе openssl или ssleay,0

6
acl/config.info.sk Normal file
View File

@ -0,0 +1,6 @@
line1=Nastaviteľné možnosti,11
display=Spôsob zobrazenia užívateľov a skupín,1,1-Iba mená,0-Mená a moduly
select=Zobraz užívateľské moduly v ,1,0-Tabuľke,1-Rozbaľovacom menu
order=Zoraď užívateľov a skupiny podľa,1,0-Poradia v súbore,1-Mena
line2=Nastavenie Systému,11
ssleay=Cesta k programu openssl alebo ssleay,3,Automatická

2
acl/config.info.sv Normal file
View File

@ -0,0 +1,2 @@
ssleay=Sökväg till openssl- eller ssleay-program,0
select=Visa moduler i,1,0-Tabell,1-Rullgardinsmeny

6
acl/config.info.tr Normal file
View File

@ -0,0 +1,6 @@
line1=Yapılandırılabilir seçenekler,11
display=Kullanıcı ve grup görüntüleme biçimi,1,1-Sadece isim,0-İsim ve modüller
select=Kullanıcı modüllerini bu şekilde görüntüle,1,0-Tablo,1-Menü
order=Kullanıcı ve grupları bu şekilde sırala,1,0-Dosyadaki sırası ile,1-İsim ile
line2=Sistem yapılandırması,11
ssleay=Openssl ya da ssleay programı yolu,3,Otomatik

6
acl/config.info.uk_UA Normal file
View File

@ -0,0 +1,6 @@
select=Показувати модулі користувача у виді,1,0-таблиці, що1-випадає меню
ssleay=Шлях до програми openssl чи ssleay,0
order=Упорядковувати користувачів і групи по,1,0-черговості у файлі,1-імені
line1= параметри, ЩоНабудовуються,11
line2=Системні параметри,11

2
acl/config.info.zh_CN Normal file
View File

@ -0,0 +1,2 @@
ssleay=Openssl 或者 Ssleay 程序的路径,0
select=显示用户模块以,1,0-Table,1-Pulldown 菜单

View File

@ -0,0 +1,2 @@
select=显示用户模块以,1,0-Table,1-Pulldown 菜单
ssleay=Openssl 或者 Ssleay 程序的路径,0

View File

@ -0,0 +1,5 @@
line1=組態選項,11
select=顯示使用者模組在,1,0-表格,1-下拉選單
order=排序使用者和全組 依,1,0-檔案內位置,1-名稱
line2=系統組態,11
ssleay=openssl或ssleay程式路徑,0

View File

@ -0,0 +1,5 @@
select=顯示使用者模組在,1,0-表格,1-下拉選單
order=排序使用者和全組 依,1,0-檔案內位置,1-名稱
line1=組態選項,11
line2=系統組態,11
ssleay=openssl或ssleay程式路徑,0

108
acl/convert.cgi Executable file
View File

@ -0,0 +1,108 @@
#!/usr/local/bin/perl
# convert.cgi
# Convert unix to webmin users
require './acl-lib.pl';
&ReadParse();
&error_setup($text{'convert_err'});
$access{'sync'} && $access{'create'} || &error($text{'convert_ecannot'});
&foreign_require("useradmin", "user-lib.pl");
# Validate inputs
if ($access{'gassign'} ne '*') {
@gcan = split(/\s+/, $access{'gassign'});
&indexof($in{'wgroup'}, @gcan) >= 0 ||
&error($text{'convert_ewgroup2'});
}
if ($in{'conv'} == 1) {
$in{'users'} =~ /\S/ || &error($text{'convert_eusers'});
map { $users{$_}++ } split(/\s+/, $in{'users'});
}
elsif ($in{'conv'} == 2) {
map { $nusers{$_}++ } split(/\s+/, $in{'nusers'});
}
elsif ($in{'conv'} == 3) {
$gid = getgrnam($in{'group'});
defined($gid) || &error($text{'convert_egroup'});
}
elsif ($in{'conv'} == 4) {
$in{'min'} =~ /^\d+$/ || &error($text{'convert_emin'});
$in{'max'} =~ /^\d+$/ || &error($text{'convert_emax'});
}
# Get the group to add to
foreach $g (&list_groups()) {
$group = $g if ($g->{'name'} eq $in{'wgroup'});
$exists{$g->{'name'}}++;
}
$group || &error($text{'convert_ewgroup'});
if ($in{'conv'} == 3) {
# Find secondary members of group
@ginfo = getgrnam($in{'group'});
@members = split(/,/, $ginfo[3]);
}
# Convert matching users
&ui_print_header(undef, $text{'convert_title'}, "");
print &ui_subheading($text{'convert_msg'});
print "<table border width=100%><tr><td bgcolor=#c0c0c0><pre>\n";
map { $exists{$_->{'name'}}++ } &list_users();
foreach $u (&foreign_call("useradmin", "list_users")) {
local $ok;
if ($in{'conv'} == 0) {
$ok = 1;
}
elsif ($in{'conv'} == 1) {
$ok = $users{$u->{'user'}};
}
elsif ($in{'conv'} == 2) {
$ok = !$nusers{$u->{'user'}};
}
elsif ($in{'conv'} == 3) {
$ok = $u->{'gid'} == $gid ||
&indexof($u->{'user'}, @members) >= 0;
}
elsif ($in{'conv'} == 4) {
$ok = $u->{'uid'} >= $in{'min'} &&
$u->{'uid'} <= $in{'max'};
}
if (!$ok) {
print &text('convert_skip', $u->{'user'}),"\n";
}
elsif ($exists{$u->{'user'}}) {
print "<i>",&text('convert_exists', $u->{'user'}),"</i>\n";
}
elsif ($u->{'user'} !~ /^[A-z0-9\-\_\.]+$/) {
print "<i>",&text('convert_invalid', $u->{'user'}),"</i>\n";
}
else {
# Actually add the user
print "<b>",&text('convert_added', $u->{'user'}),"</b>\n";
local $user = { 'name' => $u->{'user'},
'pass' => $in{'sync'} ? 'x' : $u->{'pass'},
'modules' => $group->{'modules'} };
&create_user($user);
foreach $m (@{$group->{'modules'}}, "") {
local %groupacl;
if (&read_file("$config_directory/$m/$in{'wgroup'}.gacl",
\%groupacl)) {
&write_file(
"$config_directory/$m/$u->{'user'}.acl",
\%groupacl);
}
}
push(@{$group->{'members'}}, $u->{'user'});
$exists{$u->{'user'}}++;
}
}
endpwent() if ($gconfig{'os_type'} ne 'hpux');
# Finish off
&modify_group($group->{'name'}, $group);
&restart_miniserv();
print "</pre></td></tr></table><br>\n";
&ui_print_footer("", $text{'index_return'});

41
acl/convert_form.cgi Executable file
View File

@ -0,0 +1,41 @@
#!/usr/local/bin/perl
# convert_form.cgi
# Display a form for converting unix users to webmin users
require './acl-lib.pl';
$access{'sync'} && $access{'create'} || &error($text{'convert_ecannot'});
&ui_print_header(undef, $text{'convert_title'}, "");
@glist = &list_groups();
if ($access{'gassign'} ne '*') {
@gcan = split(/\s+/, $access{'gassign'});
@glist = grep { &indexof($_->{'name'}, @gcan) >= 0 } @glist;
}
if (!@glist) {
print "$text{'convert_nogroups'}<p>\n";
&ui_print_footer("", $text{'index_return'});
exit;
}
print "<form action=convert.cgi>\n";
print "$text{'convert_desc'}<p>\n";
print "<input type=radio name=conv value=0 checked> $text{'convert_0'}<br>\n";
print "<input type=radio name=conv value=1> $text{'convert_1'} ",
"<input name=users size=40> ",&user_chooser_button("users",1),"<br>\n";
print "<input type=radio name=conv value=2> $text{'convert_2'} ",
"<input name=nusers size=40> ",&user_chooser_button("nusers",1),"<br>\n";
print "<input type=radio name=conv value=3> $text{'convert_3'} ",
&unix_group_input("group"),"<br>\n";
print "<input type=radio name=conv value=4> $text{'convert_4'} ",
"<input name=min size=6> - <input name=max size=6><p>\n";
print "$text{'convert_group'} <select name=wgroup>\n";
foreach $g (@glist) {
print "<option>$g->{'name'}\n";
}
print "</select><br>\n";
print "<input type=checkbox name=sync value=1> $text{'convert_sync'}<br>\n";
print "<input type=submit value='$text{'convert_ok'}'></form>\n";
&ui_print_footer("", $text{'index_return'});

23
acl/defaultacl Normal file
View File

@ -0,0 +1,23 @@
users=*
mode=0
create=1
delete=1
rename=1
others=1
cert=1
acl=1
chcert=1
lang=1
groups=1
gassign=*
perms=0
sync=1
unix=1
theme=1
sessions=1
cats=1
ips=1
switch=1
rbacenable=1
logouttime=1
times=1

46
acl/delete_group.cgi Executable file
View File

@ -0,0 +1,46 @@
#!/usr/local/bin/perl
# delete_group.cgi
# Delete a group (and maybe it's members)
require './acl-lib.pl';
&ReadParse();
&error_setup($text{'gdelete_err'});
$access{'groups'} || &error($text{'gdelete_ecannot'});
@glist = &list_groups();
($group) = grep { $_->{'name'} eq $in{'group'} } @glist;
@mems = @{$group->{'members'}};
foreach $m (@mems) {
&error($text{'gdelete_esub'}) if ($m =~ /^\@/);
}
if (&indexof($base_remote_user, @mems) >= 0) {
&error($text{'gdelete_euser'});
}
elsif (@mems && !$in{'confirm'}) {
# Ask if the user really wants to delete the group and members
&ui_print_header(undef, $text{'gdelete_title'}, "");
print "<center><form action=delete_group.cgi>\n";
print "<input type=hidden name=group value='$in{'group'}'>\n";
print &text('gdelete_desc', "<tt>$in{'group'}</tt>",
"<tt>".join(" ", @mems)."</tt>"),"<p>\n";
print "<input type=submit name=confirm value='$text{'gdelete_ok'}'>\n";
print "</form></center>\n";
&ui_print_footer("", $text{'index_return'});
}
else {
# Delete the group (and members if any)
&delete_group($in{'group'});
foreach $u (@mems) {
if ($u =~ /^\@(.*)/) {
&delete_group("$1");
}
else {
&delete_user($u);
}
}
&delete_from_groups("\@".$in{'group'});
&reload_miniserv();
&webmin_log("delete", "group", $in{'group'});
&redirect("");
}

62
acl/delete_groups.cgi Executable file
View File

@ -0,0 +1,62 @@
#!/usr/local/bin/perl
# Delete a bunch of Webmin groups
require './acl-lib.pl';
&ReadParse();
&error_setup($text{'gdeletes_err'});
$access{'groups'} || &error($text{'gdelete_ecannot'});
# Validate inputs
@d = split(/\0/, $in{'d'});
@d || &error($text{'udeletes_enone'});
@glist = &list_groups();
$ucount = 0;
foreach $g (@d) {
($group) = grep { $_->{'name'} eq $g } @glist;
foreach $m (@{$group->{'members'}}) {
&error($text{'gdelete_esub'}) if ($m =~ /^\@/);
&error($text{'gdelete_euser'}) if ($m eq $base_remote_user);
$ucount++;
}
}
if ($in{'confirm'}) {
# Do it
foreach $g (@d) {
($group) = grep { $_->{'name'} eq $g } @glist;
&delete_group($g);
foreach $m (@{$group->{'members'}}) {
if ($u =~ /^\@(.*)/) {
&delete_group("$1");
}
else {
&delete_user($u);
}
}
&delete_from_groups("\@".$g);
}
&reload_miniserv();
&webmin_log("delete", "groups", scalar(@d));
&redirect("");
}
else {
# Ask the user if he is sure
&ui_print_header(undef, $text{'gdeletes_title'}, "");
print "<center>\n";
print &ui_form_start("delete_groups.cgi", "post");
foreach $g (@d) {
print &ui_hidden("d", $g),"\n";
}
print &text('gdeletes_rusure', scalar(@d), $ucount),"<p>\n";
print &ui_form_end([ [ "confirm", $text{'gdeletes_ok'} ] ]);
print &text('gdeletes_users', join(" ", map { "<tt>$_</tt>" } @d)),
"<p>\n";
print "</center>\n";
&ui_print_footer("", $text{'index_return'});
}

13
acl/delete_session.cgi Executable file
View File

@ -0,0 +1,13 @@
#!/usr/local/bin/perl
# delete_session.cgi
# Delete a single session
require './acl-lib.pl';
&ReadParse();
$access{'sessions'} || &error($text{'sessions_ecannot'});
&get_miniserv_config(\%miniserv);
&delete_session_id(\%miniserv, $in{'id'});
&restart_miniserv();
&redirect("list_sessions.cgi");

18
acl/delete_user.cgi Executable file
View File

@ -0,0 +1,18 @@
#!/usr/local/bin/perl
# delete_user.cgi
# Delete a webmin user
require './acl-lib.pl';
&ReadParse();
&error_setup($text{'delete_err'});
$access{'delete'} || &error($text{'delete_ecannot'});
&can_edit_user($in{'user'}) || &error($text{'delete_euser'});
if ($base_remote_user eq $in{'user'}) {
&error($text{'delete_eself'});
}
&delete_user($in{'user'});
&delete_from_groups($in{'user'});
&reload_miniserv();
&webmin_log("delete", "user", $in{'user'});
&redirect("");

50
acl/delete_users.cgi Executable file
View File

@ -0,0 +1,50 @@
#!/usr/local/bin/perl
# Delete a bunch of Webmin users
require './acl-lib.pl';
&ReadParse();
&error_setup($text{'udeletes_err'});
$access{'delete'} || &error($text{'delete_ecannot'});
# Validate inputs
@d = split(/\0/, $in{'d'});
@d || &error($text{'udeletes_enone'});
foreach $user (@d) {
&can_edit_user($user) || &error($text{'delete_euser'});
if ($base_remote_user eq $user) {
&error($text{'delete_eself'});
}
$user->{'readonly'} && &error($text{'udeletes_ereadonly'});
}
if ($in{'confirm'}) {
# Do it
foreach $user (@d) {
&delete_user($user);
&delete_from_groups($user);
}
&reload_miniserv();
&webmin_log("delete", "users", scalar(@d));
&redirect("");
}
else {
# Ask the user if he is sure
&ui_print_header(undef, $text{'udeletes_title'}, "");
print "<center>\n";
print &ui_form_start("delete_users.cgi", "post");
foreach $user (@d) {
print &ui_hidden("d", $user),"\n";
}
print &text('udeletes_rusure', scalar(@d)),"<p>\n";
print &ui_form_end([ [ "confirm", $text{'udeletes_ok'} ] ]);
print &text('udeletes_users', join(" ", map { "<tt>$_</tt>" } @d)),
"<p>\n";
print "</center>\n";
&ui_print_footer("", $text{'index_return'});
}

76
acl/edit_acl.cgi Executable file
View File

@ -0,0 +1,76 @@
#!/usr/local/bin/perl
# edit_acl.cgi
# Display a form for editing the access control options for some module
require './acl-lib.pl';
&ReadParse();
$access{'acl'} || &error($text{'acl_emod'});
if ($in{'group'}) {
$access{'groups'} || &error($text{'acl_egroup'});
$who = $in{'group'};
}
else {
foreach $u (&list_users()) {
$me = $u if ($u->{'name'} eq $base_remote_user);
}
@mcan = $access{'mode'} == 1 ? @{$me->{'modules'}} :
$access{'mode'} == 2 ? split(/\s+/, $access{'mods'}) :
( &list_modules() , "" );
&indexof($in{'mod'}, @mcan) >= 0 || &error($text{'acl_emod'});
&can_edit_user($in{'user'}) || &error($text{'acl_euser'});
$who = $in{'user'};
}
%minfo = $in{'mod'} ? &get_module_info($in{'mod'})
: ( 'desc' => $text{'index_global'} );
$below = &text($in{'group'} ? 'acl_title3' : 'acl_title2', "<tt>$who</tt>",
"<tt>$minfo{'desc'}</tt>");
&ui_print_header($below, $text{'acl_title'}, "",
-r &help_file($in{'mod'}, "acl_info") ?
[ "acl_info", $in{'mod'} ] : undef);
%access = $in{'group'} ? &get_group_module_acl($who, $in{'mod'})
: &get_module_acl($who, $in{'mod'}, 1);
# display the form
print &ui_form_start("save_acl.cgi", "post");
print &ui_hidden("_acl_mod", $in{'mod'}),"\n";
if ($in{'group'}) {
print &ui_hidden("_acl_group", $who),"\n";
}
else {
print &ui_hidden("_acl_user", $who),"\n";
}
print &ui_table_start(&text('acl_options', $minfo{'desc'}), "width=100%", 4);
if ($in{'mod'} && $in{'user'} && &supports_rbac($in{'mod'}) &&
!$gconfig{'rbacdeny_'.$who}) {
# Show RBAC option
print &ui_table_row($text{'acl_rbac'},
&ui_radio("rbac", $access{'rbac'} ? 1 : 0,
[ [ 1, $text{'acl_rbacyes'} ],
[ 0, $text{'no'} ] ]), 3);
}
if ($in{'mod'}) {
# Show module config editing option
print &ui_table_row($text{'acl_config'},
&ui_radio("noconfig", $access{'noconfig'} ? 1 : 0,
[ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ]), 3);
}
$mdir = &module_root_directory($in{'mod'});
if (-r "$mdir/acl_security.pl") {
print &ui_table_hr() if ($in{'mod'});
&foreign_require($in{'mod'}, "acl_security.pl");
&foreign_call($in{'mod'}, "acl_security_form", \%access);
}
print &ui_table_end();
print "<table width=100%><tr>\n";
print "<td>",&ui_submit($text{'save'}),"</td>\n";
print "<td align=right>",&ui_submit($text{'acl_reset'}, "reset"),"</td>\n";
print "</table>\n";
print &ui_form_end();
&ui_print_footer("", $text{'index_return'});

144
acl/edit_group.cgi Executable file
View File

@ -0,0 +1,144 @@
#!/usr/local/bin/perl
# edit_group.cgi
# Edit or create a webmin group
require './acl-lib.pl';
&ReadParse();
$access{'groups'} || &error($text{'gedit_ecannot'});
if ($in{'group'}) {
# Editing an existing group
&ui_print_header(undef, $text{'gedit_title'}, "");
foreach $g (&list_groups()) {
if ($g->{'name'} eq $in{'group'}) {
%group = %$g;
}
}
}
else {
# Creating a new group
&ui_print_header(undef, $text{'gedit_title2'}, "");
foreach $g (&list_groups()) {
if ($g->{'name'} eq $in{'clone'}) {
$group{'modules'} = $g->{'modules'};
}
}
}
print "<form action=save_group.cgi method=post>\n";
print "<input type=hidden name=old value=\"$in{'group'}\">\n";
if ($in{'clone'}) {
print "<input type=hidden name=clone value=\"$in{'clone'}\">\n";
}
print "<table border width=100%>\n";
print "<tr $tb> <td><b>$text{'gedit_rights'}</b></td> </tr>\n";
print "<tr $cb> <td><table width=100%>\n";
# Show the group name
print "<tr> <td><b>$text{'gedit_group'}</b></td>\n";
print "<td><input name=name size=25 value=\"$group{'name'}\"></td>\n";
# Find and show the parent group
@glist = grep { $_->{'name'} ne $group{'name'} } &list_groups();
@mcan = $access{'gassign'} eq '*' ?
( ( map { $_->{'name'} } @glist ), '_none' ) :
split(/\s+/, $access{'gassign'});
map { $gcan{$_}++ } @mcan;
if (@glist && %gcan) {
print "<td><b>$text{'edit_group'}</b></td>\n";
print "<td><select name=group>\n";
foreach $g (@glist) {
local $mem = &indexof('@'.$group{'name'},
@{$g->{'members'}}) >= 0;
next if (!$gcan{$g->{'name'}} && !$mem);
printf "<option %s>%s\n",
$mem ? 'selected' : '', $g->{'name'};
$group = $g if ($mem);
}
printf "<option value='' %s>&lt;%s&gt;\n",
$group ? '' : 'selected', $text{'edit_none'}
if ($gcan{'_none'});
print "</select></td>\n";
}
print "</tr>\n";
if ($in{'group'}) {
# Show all current members
print "<tr> <td valign=top><b>$text{'gedit_members'}</b></td>\n";
print "<td colspan=3><table width=100%>\n";
$i = 0;
foreach $m (@{$group{'members'}}) {
print "<tr>\n" if ($i%4 == 0);
print "<td width=25%>",($m =~ /^\@(.*)$/ ? "<i>$1</i>" : $m),
"</td>\n";
print "<tr>\n" if ($i%4 == 3);
$i++;
}
print "</table></td> </tr>\n";
}
@mlist = &list_module_infos();
map { $has{$_}++ } @{$group{'modules'}};
print "<tr> <td valign=top><b>$text{'gedit_modules'}</b></td>\n";
print "<td colspan=3>\n";
print &select_all_link("mod", 0, $text{'edit_selall'}),"&nbsp;\n";
print &select_invert_link("mod", 0, $text{'edit_invert'}),"<br>\n";
@cats = &unique(map { $_->{'category'} } @mlist);
&read_file("$config_directory/webmin.catnames", \%catnames);
print "<table width=100% cellpadding=0 cellspacing=0>\n";
foreach $c (sort { $b cmp $a } @cats) {
@cmlist = grep { $_->{'category'} eq $c } @mlist;
print "<tr> <td colspan=2 $tb><b>",
$catnames{$c} || $text{'category_'.$c},
"</b></td> </tr>\n";
$sw = 0;
foreach $m (@cmlist) {
local $md = $m->{'dir'};
if (!$sw) { print "<tr>\n"; }
print "<td width=50%>";
printf"<input type=checkbox name=mod value=$md %s>\n",
$has{$md} ? "checked" : "";
if ($access{'acl'} && $in{'group'}) {
# Show link for editing ACL
printf "<a href='edit_acl.cgi?mod=%s&%s=%s'>".
"%s</a>\n",
&urlize($m->{'dir'}),
"group", &urlize($in{'group'}),
$m->{'desc'};
}
else {
print "$m->{'desc'}\n";
}
print "</td>";
if ($sw) { print "<tr>\n"; }
$sw = !$sw;
}
}
print "</table>\n";
print &select_all_link("mod", 0, $text{'edit_selall'}),"&nbsp;\n";
print &select_invert_link("mod", 0, $text{'edit_invert'}),"\n";
print "</td> </tr>\n";
print "</table></td> </tr></table>\n";
print "<table width=100%> <tr>\n";
print "<td><input type=submit value='$text{'save'}'></td></form>\n";
if ($in{'group'}) {
print "<form action=hide_form.cgi>\n";
print "<input type=hidden name=group value=\"$in{'group'}\">\n";
print "<td align=center>",
"<input type=submit value=\"$text{'edit_hide'}\"></td></form>\n";
print "<form action=edit_group.cgi>\n";
print "<input type=hidden name=clone value=\"$in{'group'}\">\n";
print "<td align=center>",
"<input type=submit value=\"$text{'edit_clone'}\">",
"</td></form>\n";
print "<form action=delete_group.cgi>\n";
print "<input type=hidden name=group value=\"$in{'group'}\">\n";
print "<td align=right><input type=submit name=delete ",
"value='$text{'delete'}'></td></form>\n";
}
print "</tr></table>\n";
&ui_print_footer("", $text{'index_return'});

27
acl/edit_rbac.cgi Executable file
View File

@ -0,0 +1,27 @@
#!/usr/local/bin/perl
# Show RBAC status
require './acl-lib.pl';
$access{'rbacenable'} || &error($text{'rbac_ecannot'});
&ui_print_header(undef, $text{'rbac_title'}, "");
print "$text{'rbac_desc'}<p>\n";
if ($gconfig{'os_type'} ne 'solaris') {
print &text('rbac_esolaris', $gconfig{'real_os_type'}),"<p>\n";
}
elsif (!&supports_rbac()) {
if (&foreign_available("cpan")) {
print &text('rbac_eperl', "<tt>Authen::SolarisRBAC</tt>",
"../cpan/download.cgi?source=0&local=$module_root_directory/Authen-SolarisRBAC-0.1.tar.gz&mode=2&return=/$module_name/&returndesc=".&urlize($text{'index_return'})),"<p>\n";
}
else {
print &text('rbac_ecpan', "<tt>Authen::SolarisRBAC</tt>"),
"<p>\n";
}
}
else {
print "$text{'rbac_ok'}<p>\n";
}
&ui_print_footer("", $text{'index_return'});

37
acl/edit_sync.cgi Executable file
View File

@ -0,0 +1,37 @@
#!/usr/local/bin/perl
# edit_sync.cgi
# Display unix/webmin user synchronization
require './acl-lib.pl';
$access{'sync'} && $access{'create'} && $access{'delete'} ||
&error($text{'sync_ecannot'});
&ui_print_header(undef, $text{'sync_title'}, "");
@glist = &list_groups();
if (!@glist) {
print "<p>$text{'sync_nogroups'}<p>\n";
&ui_print_footer("", $text{'index_return'});
exit;
}
print "<form action=save_sync.cgi>\n";
print "<b>$text{'sync_desc'}</b><p>\n";
printf "<input type=checkbox name=create value=1 %s> %s<p>\n",
$config{'sync_create'} ? "checked" : "", $text{'sync_create'};
printf "<input type=checkbox name=delete value=1 %s> %s<p>\n",
$config{'sync_delete'} ? "checked" : "", $text{'sync_delete'};
printf "<input type=checkbox name=unix value=1 %s> %s<p>\n",
$config{'sync_unix'} ? "checked" : "", $text{'sync_unix'};
print "$text{'sync_group'} <select name=group>\n";
foreach $g (@glist) {
printf "<option %s>%s\n",
$g->{'name'} eq $config{'sync_group'} ? "selected" : "",
$g->{'name'};
}
print "</select><p>\n";
print "<input type=submit value='$text{'save'}'></form>\n";
&ui_print_footer("", $text{'index_return'});

87
acl/edit_unix.cgi Executable file
View File

@ -0,0 +1,87 @@
#!/usr/local/bin/perl
# edit_unix.cgi
# Choose a user whose permissions will be used for logins that don't
# match any webmin user, but have unix accounts
require './acl-lib.pl';
$access{'unix'} && $access{'create'} && $access{'delete'} ||
&error($text{'unix_ecannot'});
&ui_print_header(undef, $text{'unix_title'}, "");
print "$text{'unix_desc'}<p>\n";
&get_miniserv_config(\%miniserv);
print "<form action=save_unix.cgi>\n";
print "<table>\n";
# Enable Unix auth
@unixauth = &get_unixauth(\%miniserv);
print "<tr> <td colspan=2>\n";
print &ui_radio("unix_def", @unixauth ? 0 : 1,
[ [ 1, $text{'unix_def'} ], [ 0, $text{'unix_sel'} ] ]),"<br>\n";
print &ui_columns_start([ $text{'unix_mode'}, $text{'unix_who'},
$text{'unix_to'} ]);
$i = 0;
@webmins = map { [ $_->{'name'} ] }
sort { $a->{'name'} cmp $b->{'name'} } &list_users();
foreach $ua (@unixauth, [ ], [ ]) {
print &ui_columns_row([
&ui_select("mode_$i", $ua->[0] eq "" ? 0 :
$ua->[0] eq "*" ? 1 :
$ua->[0] =~ /^\@/ ? 2 : 3,
[ [ 0, " " ],
[ 1, $text{'unix_mall'} ],
[ 2, $text{'unix_group'} ],
[ 3, $text{'unix_user'} ] ]),
&ui_textbox("who_$i", $ua->[0] eq "*" || $ua->[0] eq "" ? "" :
$ua->[0] =~ /^\@(.*)$/ ? $1 : $ua->[0], 20),
&ui_select("to_$i", $ua->[1], \@webmins),
]);
$i++;
}
print &ui_columns_end(),"\n";
# Allow users who can sudo to root?
print &ui_checkbox("sudo", 1, $text{'unix_sudo'},
$miniserv{'sudo'}),"<br>\n";
# Allow PAM-only users?
print &ui_checkbox("pamany", 1, &text('unix_pamany',
&ui_select("pamany_user",
$miniserv{'pamany'},
\@webmins)),
$miniserv{'pamany'}),"<br>\n";
print "</td> </tr>\n";
print "<tr> <td colspan=2><hr></td> </tr>\n";
print "<tr> <td colspan=2>$text{'unix_restrict'}<p></td> </tr>\n";
# Who can do Unix auth?
print "<tr> <td valign=top>\n";
printf "<input type=radio name=access value=0 %s>\n",
$miniserv{"allowusers"} || $miniserv{"denyusers"} ? "" : "checked";
print "$text{'unix_all'}<br>\n";
printf "<input type=radio name=access value=1 %s>\n",
$miniserv{"allowusers"} ? "checked" : "";
print "$text{'unix_allow'}<br>\n";
printf "<input type=radio name=access value=2 %s>\n",
$miniserv{"denyusers"} ? "checked" : "";
print "$text{'unix_deny'}<br>\n";
print "</td> <td valign=top>\n";
printf "<textarea name=users rows=6 cols=30>%s</textarea></td> </tr>\n",
$miniserv{"allowusers"} ? join("\n", split(/\s+/, $miniserv{"allowusers"})) :
$miniserv{"denyusers"} ? join("\n", split(/\s+/, $miniserv{"denyusers"})) : "";
# Block login by shell?
print "<tr> <td colspan=2>\n";
printf "<input type=checkbox name=shells_deny value=1 %s> %s\n",
$miniserv{'shells_deny'} ? "checked" : "",$text{'unix_shells'};
printf "<input name=shells size=25 value='%s'> %s</td> </tr>\n",
$miniserv{'shells_deny'} || "/etc/shells",
&file_chooser_button("shells");
print "</table>\n";
print "<input type=submit value='$text{'save'}'></form>\n";
&ui_print_footer("", $text{'index_return'});

380
acl/edit_user.cgi Executable file
View File

@ -0,0 +1,380 @@
#!/usr/local/bin/perl
# edit_user.cgi
# Edit a new or existing webmin user
require './acl-lib.pl';
&foreign_require("webmin", "webmin-lib.pl");
&ReadParse();
if ($in{'user'}) {
# Editing an existing user
&can_edit_user($in{'user'}) || &error($text{'edit_euser'});
&ui_print_header(undef, $text{'edit_title'}, "");
foreach $u (&list_users()) {
if ($u->{'name'} eq $in{'user'}) {
%user = %$u;
}
if ($u->{'name'} eq $base_remote_user) {
$me = $u;
}
}
}
else {
# Creating a new user
$access{'create'} || &error($text{'edit_ecreate'});
&ui_print_header(undef, $text{'edit_title2'}, "");
foreach $u (&list_users()) {
if ($u->{'name'} eq $in{'clone'}) {
$user{'modules'} = $u->{'modules'};
$user{'lang'} = $u->{'lang'};
}
if ($u->{'name'} eq $base_remote_user) {
$me = $u;
}
}
$user{'skill'} = $user{'risk'} = 'high' if ($in{'risk'});
}
# Give up if readonly
if ($user{'readonly'} && !$in{'readwrite'}) {
%minfo = &get_module_info($user{'readonly'});
print &text('edit_readonly', $minfo{'desc'},
"edit_user.cgi?user=$in{'user'}&readwrite=1"),"<p>\n";
&ui_print_footer("", $text{'index_return'});
exit;
}
print "<form action=save_user.cgi method=post>\n";
if ($in{'user'}) {
print "<input type=hidden name=old value=\"$user{'name'}\">\n";
print "<input type=hidden name=oldpass value=\"$user{'pass'}\">\n";
}
if ($in{'clone'}) {
print "<input type=hidden name=clone value=\"$in{'clone'}\">\n";
}
print "<table border width=100%>\n";
print "<tr $tb> <td><b>$text{'edit_rights'}</b></td> </tr>\n";
print "<tr $cb> <td><table width=100%>\n";
print "<tr> <td><b>$text{'edit_user'}</b></td>\n";
if ($access{'rename'} || !$in{'user'}) {
print "<td><input name=name size=25 ",
"value=\"$user{'name'}\"></td>\n";
}
else {
print "<td>$user{'name'}</td>\n";
}
# Find and show parent group
@glist = &list_groups();
@mcan = $access{'gassign'} eq '*' ?
( ( map { $_->{'name'} } @glist ), '_none' ) :
split(/\s+/, $access{'gassign'});
map { $gcan{$_}++ } @mcan;
if (@glist && %gcan && !$in{'risk'} && !$user{'risk'}) {
print "<td><b>$text{'edit_group'}</b></td>\n";
print "<td><select name=group>\n";
foreach $g (@glist) {
local $mem = &indexof($user{'name'}, @{$g->{'members'}}) >= 0;
next if (!$gcan{$g->{'name'}} && !$mem);
printf "<option %s>%s\n",
$mem ? 'selected' : '', $g->{'name'};
$group = $g if ($mem);
}
printf "<option value='' %s>&lt;%s&gt;\n",
$group ? '' : 'selected', $text{'edit_none'}
if ($gcan{'_none'});
print "</select></td>\n";
}
print "</tr>\n";
# Show password type menu and current password
$passmode = !$in{'user'} ? 0 :
$user{'pass'} eq 'x' ? 3 :
$user{'sync'} ? 2 :
$user{'pass'} eq 'e' ? 5 :
$user{'pass'} eq '*LK*' ? 4 : 1;
print "<tr> <td><b>$text{'edit_pass'}</b></td> <td colspan=3>\n";
print "<select name=pass_def>\n";
printf "<option value=0 %s> $text{'edit_set'} ..\n",
$passmode == 0 ? "selected" : "";
if ($in{'user'}) {
printf "<option value=1 %s> %s\n",
$passmode == 1 ? "selected" : "", $text{'edit_dont'};
}
printf "<option value=3 %s> $text{'edit_unix'}\n",
$passmode == 3 ? "selected" : "";
if ($user{'sync'}) {
printf "<option value=2 %s> $text{'edit_same'}\n",
$passmode == 2 ? "selected" : "";
}
&get_miniserv_config(\%miniserv);
if ($miniserv{'extauth'}) {
printf "<option value=5 %s> $text{'edit_extauth'}\n",
$passmode == 5 ? "selected" : "";
}
printf "<option value=4 %s> $text{'edit_lock'}\n",
$passmode == 4 ? "selected" : "";
print "</select><input type=password name=pass size=25>\n";
if ($passmode == 1) {
# Show temporary lock option
print &ui_checkbox("lock", 1, $text{'edit_templock'},
$user{'pass'} =~ /^\!/ ? 1 : 0);
}
print "</td> </tr>\n";
if ($access{'chcert'}) {
# SSL certificate name
print "<tr> <td><b>$text{'edit_cert'}</b></td> <td colspan=3>\n";
print &ui_opt_textbox("cert", $user{'cert'}, 50, $text{'edit_none'}),
"</td></tr>\n";
}
if ($access{'lang'}) {
# Current language
print "<tr> <td><b>$text{'edit_lang'}</b></td> <td colspan=3>\n";
printf "<input type=radio name=lang_def value=1 %s> %s\n",
$user{'lang'} ? '' : 'checked', $text{'default'};
printf "<input type=radio name=lang_def value=0 %s>\n",
$user{'lang'} ? 'checked' : '';
print "<select name=lang>\n";
foreach $l (&list_languages()) {
printf "<option value=%s %s>%s (%s)\n",
$l->{'lang'},
$user{'lang'} eq $l->{'lang'} ? 'selected' : '',
$l->{'desc'}, uc($l->{'lang'});
}
print "</select></td> </tr>\n";
}
if ($access{'cats'}) {
# Show categorized modules?
print "<tr> <td><b>$text{'edit_notabs'}</b></td> <td colspan=2>\n";
printf "<input type=radio name=notabs value=1 %s> %s\n",
$user{'notabs'} == 1 ? 'checked' : '', $text{'yes'};
printf "<input type=radio name=notabs value=2 %s> %s\n",
$user{'notabs'} == 2 ? 'checked' : '', $text{'no'};
printf "<input type=radio name=notabs value=0 %s> %s</td> </tr>\n",
$user{'notabs'} == 0 ? 'checked' : '', $text{'default'};
}
if ($access{'logouttime'}) {
# Show logout time
print "<tr> <td><b>$text{'edit_logout'}</b></td> <td colspan=2>\n";
print &ui_opt_textbox("logouttime", $user{'logouttime'}, 5,
$text{'default'})," $text{'edit_mins'}</td> </tr>\n";
}
if ($access{'theme'}) {
# Current theme
print "<tr> <td><b>$text{'edit_theme'}</b></td> <td colspan=2>\n";
printf "<input type=radio name=theme_def value=1 %s> %s\n",
defined($user{'theme'}) ? "" : "checked", $text{'edit_themeglobal'};
printf "<input type=radio name=theme_def value=0 %s>\n",
defined($user{'theme'}) ? "checked" : "";
print "<select name=theme>\n";
foreach $t ( { 'desc' => $text{'edit_themedef'} },
&foreign_call("webmin", "list_themes")) {
printf "<option value='%s' %s>%s\n",
$t->{'dir'}, $user{'theme'} eq $t->{'dir'} ? 'selected' : '',
$t->{'desc'};
}
print "</select></td> </tr>\n";
}
if ($access{'ips'}) {
# Allowed IP addresses
print "<tr> <td>",&hlink("<b>$text{'edit_ips'}</b>", "ips"),"</td>\n";
print "<td colspan=3><table><tr>\n";
printf "<td nowrap><input name=ipmode type=radio value=0 %s> %s<br>\n",
$user{'allow'} || $user{'deny'} ? '' : 'checked',
$text{'edit_all'};
printf "<input name=ipmode type=radio value=1 %s> %s<br>\n",
$user{'allow'} ? 'checked' : '', $text{'edit_allow'};
printf "<input name=ipmode type=radio value=2 %s> %s</td> <td>\n",
$user{'deny'} ? 'checked' : '', $text{'edit_deny'};
print "<textarea name=ips rows=4 cols=30>",
join("\n", split(/\s+/, $user{'allow'} ? $user{'allow'}
: $user{'deny'})),
"</textarea></td>\n";
print "</td></tr></table> </tr>\n";
}
if (&supports_rbac() && $access{'mode'} == 0) {
# Deny access to modules not managed by RBAC?
print "<tr> <td><b>$text{'edit_rbacdeny'}</b></td> <td colspan=3>\n";
print &ui_radio("rbacdeny", $user{'rbacdeny'} ? 1 : 0,
[ [ 0, $text{'edit_rbacdeny0'} ],
[ 1, $text{'edit_rbacdeny1'} ] ]);
print "</td> </tr>\n";
}
if ($access{'times'}) {
# Show allowed days of the week
%days = map { $_, 1 } split(/,/, $user{'days'});
print "<tr> <td valign=top><b>$text{'edit_days'}</b></td>\n";
print "<td colspan=3>\n";
print &ui_radio("days_def", $user{'days'} eq '' ? 1 : 0,
[ [ 1, $text{'edit_alldays'} ],
[ 0, $text{'edit_seldays'} ] ]),"<br>\n";
for(my $i=0; $i<7; $i++) {
print &ui_checkbox("days", $i, $text{'day_'.$i}, $days{$i});
}
print "</td> </tr>\n";
# Show allow hour/minute range
($hf, $mf) = split(/\./, $user{'hoursfrom'});
($ht, $mt) = split(/\./, $user{'hoursto'});
print "<tr> <td valign=top><b>$text{'edit_hours'}</b></td>\n";
print "<td colspan=3>\n";
print &ui_radio("hours_def", $user{'hoursfrom'} eq '' ? 1 : 0,
[ [ 1, $text{'edit_allhours'} ],
[ 0, &text('edit_selhours',
&ui_textbox("hours_hfrom", $hf, 2),
&ui_textbox("hours_mfrom", $mf, 2),
&ui_textbox("hours_hto", $ht, 2),
&ui_textbox("hours_mto", $mt, 2)) ] ]);
print "</td> </tr>\n";
}
if ($user{'risk'} || $in{'risk'}) {
# Creating or editing a risk-level user
print "<tr> <td><b>$text{'edit_risk'}</b></td> <td colspan=3>\n";
foreach $s ('high', 'medium', 'low') {
printf "<input type=radio name=risk value='%s' %s> %s\n",
$s, $user{'risk'} eq $s ? 'checked' : '',
$text{"edit_risk_$s"};
}
print "</td> </tr>\n";
print "<tr> <td><b>$text{'edit_skill'}</b></td> <td colspan=3>\n";
foreach $s ('high', 'medium', 'low') {
printf "<input type=radio name=skill value='%s' %s> %s\n",
$s, $user{'skill'} eq $s ? 'checked' : '',
$text{"skill_$s"};
}
print "</td> </tr>\n";
}
else {
# Creating or editing a normal user
@mcan = $access{'mode'} == 1 ? @{$me->{'modules'}} :
$access{'mode'} == 2 ? split(/\s+/, $access{'mods'}) :
&list_modules();
map { $mcan{$_}++ } @mcan;
map { $has{$_}++ } @{$user{'modules'}};
map { $has{$_} = 0 } $group ? @{$group->{'modules'}} : ();
# Show all modules, under categories
@mlist = grep { $access{'others'} || $has{$_->{'dir'}} || $mcan{$_->{'dir'}} } &list_module_infos();
print "<tr> <td valign=top><b>$text{'edit_modules'}</b><br>",
"$text{'edit_groupmods'}</td>\n";
print "<td colspan=3>\n";
print &select_all_link("mod", 0, $text{'edit_selall'}),"&nbsp;\n";
print &select_invert_link("mod", 0, $text{'edit_invert'}),"<br>\n";
@cats = &unique(map { $_->{'category'} } @mlist);
&read_file("$config_directory/webmin.catnames", \%catnames);
print "<table width=100% cellpadding=0 cellspacing=0>\n";
foreach $c (sort { $b cmp $a } @cats) {
@cmlist = grep { $_->{'category'} eq $c } @mlist;
print "<tr> <td colspan=2 $tb><b>",
$catnames{$c} || $text{'category_'.$c},
"</b></td> </tr>\n";
$sw = 0;
foreach $m (@cmlist) {
local $md = $m->{'dir'};
if (!$sw) { print "<tr>\n"; }
print "<td width=50%>";
if ($mcan{$md}) {
printf"<input type=checkbox name=mod value=$md %s>\n",
$has{$md} ? "checked" : "";
if ($access{'acl'} && $in{'user'}) {
# Show link for editing ACL
printf "<a href='edit_acl.cgi?mod=%s&%s=%s'>".
"%s</a>\n",
&urlize($m->{'dir'}),
"user", &urlize($in{'user'}),
$m->{'desc'};
}
else {
print "$m->{'desc'}\n";
}
}
else {
printf "<img src=images/%s.gif> %s\n",
$has{$md} ? 'tick' : 'empty', $m->{'desc'};
}
print "</td>";
if ($sw) { print "<tr>\n"; }
$sw = !$sw;
}
}
if ($access{'acl'}) {
print "<tr> <td colspan=2 $tb><b>",
$text{'edit_special'},"</b></td> </tr>\n";
print "<tr>\n";
print "<td><a href='edit_acl.cgi?mod=&user=",&urlize($in{'user'}),
"'>",$text{'index_global'},"</a></td>\n";
print "</tr>\n";
}
print "</table>\n";
print &select_all_link("mod", 0, $text{'edit_selall'}),"&nbsp;\n";
print &select_invert_link("mod", 0, $text{'edit_invert'}),"\n";
print "</td> </tr>\n";
}
print "</table></td> </tr></table>\n";
print "<table width=100%> <tr>\n";
print "<td align=left width=16%><input type=submit value=\"$text{'save'}\"></td></form>\n";
if ($in{'user'}) {
if (!$group) {
print "<form action=hide_form.cgi>\n";
print "<input type=hidden name=user value=\"$in{'user'}\">\n";
print "<td align=center width=16%>",
"<input type=submit value=\"$text{'edit_hide'}\"></td></form>\n";
}
else { print "<td width=16%></td>\n"; }
if ($access{'create'} && !$group) {
print "<form action=edit_user.cgi>\n";
print "<input type=hidden name=clone value=\"$in{'user'}\">\n";
print "<td align=center width=16%>",
"<input type=submit value=\"$text{'edit_clone'}\">",
"</td></form>\n";
}
else { print "<td width=16%></td>\n"; }
&read_acl(\%acl);
if (&foreign_check("webminlog") &&
$acl{$base_remote_user,'webminlog'}) {
print "<form action=/webminlog/search.cgi>\n";
print "<input type=hidden name=uall value=0>\n";
print "<input type=hidden name=user value='$in{'user'}'>\n";
print "<input type=hidden name=mall value=1>\n";
print "<input type=hidden name=tall value=0>\n";
print "<td align=center width=16%>",
"<input type=submit value=\"$text{'edit_log'}\">",
"</td></form>\n";
}
else { print "<td width=16%></td>\n"; }
if ($access{'switch'} && $main::session_id) {
print "<form action=switch.cgi>\n";
print "<input type=hidden name=user value=\"$in{'user'}\">\n";
print "<td align=center width=16%>",
"<input type=submit value=\"$text{'edit_switch'}\">",
"</td></form>\n";
}
else { print "<td width=16%></td>\n"; }
if ($access{'delete'}) {
print "<form action=delete_user.cgi>\n";
print "<input type=hidden name=user value=\"$in{'user'}\">\n";
print "<td align=right width=16%>",
"<input type=submit value=\"$text{'delete'}\"></td></form>\n";
}
else { print "<td width=16%></td>\n"; }
}
print "</tr> </table>\n";
&ui_print_footer("", $text{'index_return'});

14
acl/feedback_files.pl Normal file
View File

@ -0,0 +1,14 @@
do 'acl-lib.pl';
sub feedback_files
{
return ( "$config_directory/miniserv.conf",
"$config_directory/miniserv.users",
"$config_directory/webmin.acl",
"$config_directory/webmin.groups",
"$config_directory/config" );
}
1;

8
acl/help/ips.ca.html Normal file
View File

@ -0,0 +1,8 @@
<header>Control d'Accés IP</header>
El control d'accés IP d'usuari funciona de la mateixa manera que el control
d'accés IP global del mòdul de Configuració Webmin. Només si un usuari passa
els controls globals es comprovaran també aquí aquests.
<footer>

5
acl/help/ips.da.html Executable file
View File

@ -0,0 +1,5 @@
<header>IP adgangskontrol</header>
Bruger IP adgangskontrol virker på samme måde som den globale IP adgangskontrol i Webmin konfigurationsmodulet. Kun hvis en bruger passerer den globale adgangskontrol vil denne også blive tjekket.
<footer>

17
acl/help/ips.fa.html Normal file
View File

@ -0,0 +1,17 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<p dir="rtl"><b><header> مهار دسترسي IP </header>
</b>
<body>
</p>
<p dir="rtl">
<body>
<header>مهار دسترسي IP در بخش مهار دسترسي کاربران مانند مهار دسترسي IP عمومي در
بخش پيکربندي وب مين عمل مي نمايد. زماني که کاربر يک کنترل را ارسال مي کند، در اين
قسمت مورد بررسي قرار مي گيرد.</header></p>
</html>

5
acl/help/ips.fr.html Executable file
View File

@ -0,0 +1,5 @@
<header>Contrôle d'accès IP</header>
Le contrôle d'accès utilisateur par adresse IP fonctionne de la même manière que le contrôle d'accès IP global dans le module Configuration de Webmin. Seul un utilisateur ayant passé le contrôle global sera vérifié de nouveau avec ces règles.
<footer>

6
acl/help/ips.html Normal file
View File

@ -0,0 +1,6 @@
<header>IP access control</header>
User IP access control works in the same way as the global IP access control in the Webmin Configuration module. Only if a user passes the global controls will those here be checked as well.
<footer>

5
acl/help/ips.sk.html Executable file
View File

@ -0,0 +1,5 @@
<header>Kontrola prístupu pomocou IP</header>
Kontrola u¾ívateµov pomocou IP adries funguje rovnakým spôsobom ako globálna kontrola IP adries vo Webmine. Iba ak u¾ívateµ prejde globálnou kontrolou, dostane sa a¾ ku kontrole u¾ívateµskej.
<footer>

22
acl/hide.cgi Executable file
View File

@ -0,0 +1,22 @@
#!/usr/local/bin/perl
# hide.cgi
# Remove from user's module list
require './acl-lib.pl';
&ReadParse();
%hide = map { $_, 1 } split(/\0/, $in{'hide'});
if ($in{'user'}) {
&can_edit_user($in{'user'}) || &error($text{'edit_euser'});
($user) = grep { $_->{'name'} eq $in{'user'} } &list_users();
$user->{'modules'} = [ grep { !$hide{$_} } @{$user->{'modules'}} ];
&modify_user($user->{'name'}, $user);
}
else {
$access{'groups'} || &error($text{'gedit_ecannot'});
($group) = grep { $_->{'name'} eq $in{'group'} } &list_groups();
$group->{'modules'} = [ grep { !$hide{$_} } @{$group->{'modules'}} ];
&modify_group($group->{'name'}, $group);
}
&restart_miniserv();
&redirect("");

57
acl/hide_form.cgi Executable file
View File

@ -0,0 +1,57 @@
#!/usr/local/bin/perl
# hide_form.cgi
# Build up a list of modules that should be hidden due to their managed
# servers not being installed
require './acl-lib.pl';
&ReadParse();
if ($in{'user'}) {
&can_edit_user($in{'user'}) || &error($text{'edit_euser'});
$what = $in{'user'};
@whos = &list_users();
}
else {
$access{'groups'} || &error($text{'gedit_ecannot'});
$what = $in{'group'};
@whos = &list_groups();
}
($who) = grep { $_->{'name'} eq $what } @whos;
&ui_print_header(undef, $text{'hide_title'}, "");
# Find modules to hide which the user has and which theoretically support
# this OS
%got = map { $_, 1 } @{$who->{'modules'}};
foreach $m (sort { $a->{'desc'} cmp $b->{'desc'} }
&get_all_module_infos()) {
if (&check_os_support($m) && $got{$m->{'dir'}} &&
!&foreign_installed($m->{'dir'}, 0)) {
push(@hide, $m);
}
}
if (@hide) {
print "<form action=hide.cgi>\n";
print "<input type=hidden name=user value='$in{'user'}'>\n";
print "<input type=hidden name=group value='$in{'group'}'>\n";
print &text('hide_desc', "<tt>$what</tt>"),"<br>\n";
print "<ul>\n";
foreach $h (@hide) {
print "<li>$h->{'desc'}\n";
if ($h->{'clone'}) {
print &text('hide_clone', "<tt>$h->{'dir'}</tt>"),"\n";
}
print "<input type=hidden name=hide value='$h->{'dir'}'>\n";
}
print "</ul><p>\n";
print "$text{'hide_desc2'}<p>\n";
print "<input type=submit value='$text{'hide_ok'}'></form>\n";
}
else {
print &text('hide_none', "<tt>$what</tt>"),"<p>\n";
}
&ui_print_footer(
$in{'user'} ? ( "edit_user.cgi?user=$who", $text{'edit_return'} )
: ( "edit_group.cgi?group=$who", $text{'edit_return2'} ),
"", $text{'index_return'});

Binary file not shown.

BIN
acl/images/.xvpics/sync.gif Normal file

Binary file not shown.

BIN
acl/images/cert.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
acl/images/convert.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
acl/images/empty.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 B

BIN
acl/images/icon.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
acl/images/rbac.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

BIN
acl/images/sessions.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
acl/images/smallicon.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
acl/images/sync.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
acl/images/tick.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 B

BIN
acl/images/unix.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Some files were not shown because too many files have changed in this diff Show More