initial commit of file from CVS for e-smith-base on Thu 26 Oct 11:24:52 BST 2023

This commit is contained in:
Brian Read 2023-10-26 11:24:52 +01:00
parent bbc22988a8
commit 9510d1a360
678 changed files with 22721 additions and 2 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*.rpm
*.log
*spec-20*
*.tar.xz

21
Makefile Normal file
View File

@ -0,0 +1,21 @@
# Makefile for source rpm: e-smith-base
# $Id: Makefile,v 1.1 2016/02/04 23:18:11 vip-ire Exp $
NAME := e-smith-base
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attept a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

View File

@ -1,3 +1,17 @@
# e-smith-base # <img src="https://www.koozali.org/images/koozali/Logo/Png/Koozali_logo_2016.png" width="25%" vertical="auto" style="vertical-align:bottom"> e-smith-base
SMEServer Koozali developed git repo for e-smith-base smeserver SMEServer Koozali developed git repo for e-smith-base smeserver
## Wiki
<br />https://wiki.koozali.org/
## Bugzilla
Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=e-smith-base&product=SME%20Server%2010.X&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED)
## Description
<br />*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.*
*Once it has been checked, then this comment will be deleted*
<br />
E-smith-base is a powerful software suite designed to improve the security and performance of web servers. It includes a full suite of web server applications, such as Apache, MySQL, and PHP, as well as many other tools and features. E-smith-base also includes a wide range of security features, such as an intrusion detection system, malware scanning, and a secure shell. Additionally, it is highly customizable and can be used to create and manage multiple websites on one server. E-smith-base is an ideal choice for organizations looking to improve their web server performance and security.

340
additional/COPYING Normal file
View File

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

1
additional/CVS/Entries Normal file
View File

@ -0,0 +1 @@
D

View File

@ -0,0 +1 @@
rpms/e-smith-base/sme10/e-smith-base-5.8.0

1
additional/CVS/Root Normal file
View File

@ -0,0 +1 @@
:ext:jpp@shell.koozali.org:/cvs/smeserver

View File

@ -0,0 +1,8 @@
#include <unistd.h>
#define CONSOLE_PATH "/sbin/e-smith/console.pl"
int main(ac, av)
char **av;
{
execv(CONSOLE_PATH, av);
return 0;
}

672
additional/createlinks.orig Executable file
View File

@ -0,0 +1,672 @@
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
templates2events("/etc/sysconfig/i18n", qw(post-install post-upgrade e-smith-base-update));
templates2events("/etc/selinux/config", qw(post-install post-upgrade e-smith-base-update));
# give the correct configuration file of dhcpd.conf
templates2events("/etc/dhcp/dhcpd.conf", qw(bootstrap-console-save e-smith-base-update));
# ppp-conf-users
foreach (qw(pap-secrets chap-secrets))
{
templates2events("/etc/ppp/$_", qw(
bootstrap-console-save
console-save
remoteaccess-update
e-smith-base-update));
}
foreach (qw(
/var/service/wan/pppoe.pppd.conf
/var/service/wan/run.pppoe.conf
/etc/ppp/ip-down.local
/etc/ppp/ip-up.local
))
{
templates2events("$_", qw(
console-save
bootstrap-console-save
e-smith-base-update
));
}
safe_symlink("daemontools", "root/etc/rc.d/init.d/wan");
service_link_enhanced("wan", "S37", "7");
service_link_enhanced("wan", "K90", "6");
service_link_enhanced("wan", "K90", "0");
service_link_enhanced("wan", "K90", "1");
# conf-dialup
foreach (qw(
/etc/sysconfig/network-scripts/ifcfg-ppp0
/etc/sysconfig/network-scripts/chat-ppp0
/etc/ppp/ip-up.local
/etc/ppp/ip-down.local
/etc/diald.conf
/etc/diald.filter
/etc/diald/link
/var/service/ippp/config
/etc/ppp/ioptions
))
{
templates2events($_, qw(console-save bootstrap-console-save e-smith-base-update));
}
# conf-networking
foreach (qw(
/etc/sysconfig/network-scripts/ifcfg-bond0
/etc/modprobe.d/bonding.conf
/etc/sysconfig/network
/etc/nsswitch.conf
/etc/HOSTNAME
/etc/hosts
/etc/resolv.conf
/etc/sysctl.conf
/var/service/wan/dhclient.config
))
{
templates2events($_, qw(console-save bootstrap-console-save e-smith-base-update));
}
event_link("update-ifcfg", "console-save", "05");
event_link("update-ifcfg", "bootstrap-console-save", "05");
# conf-other
templates2events("/etc/crontab", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
email-update
logrotate
e-smith-base-update
));
templates2events("/etc/mime.types", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
email-update
logrotate
e-smith-base-update
));
templates2events("/etc/sysconfig/rsyslog", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
email-update
logrotate
e-smith-base-update
));
templates2events("/etc/rsyslog.conf", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
email-update
logrotate
e-smith-base-update
));
templates2events("/etc/updatedb.conf", qw(
bootstrap-console-save
e-smith-base-update
));
templates2events("/etc/openssl.conf", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
domain-create
domain-delete
network-create
network-delete
ip-change
e-smith-base-update
));
# conf-routes
event_link("update-ifcfg", "network-create", "05");
event_link("update-ifcfg", "network-delete", "05");
# conf-security
templates2events("/etc/securetty", qw(
console-save
bootstrap-console-save
ibay-create
ibay-delete
ibay-modify
ibay-modify-servers
network-create
network-delete
ip-change
email-update
remoteaccess-update
e-smith-base-update
));
templates2events("/etc/services", qw(
console-save
bootstrap-console-save
ibay-create
ibay-delete
ibay-modify
ibay-modify-servers
network-create
network-delete
ip-change
email-update
remoteaccess-update
e-smith-base-update
));
templates2events("/etc/shells", qw(
console-save
bootstrap-console-save
ibay-create
ibay-delete
ibay-modify
ibay-modify-servers
network-create
network-delete
ip-change
email-update
remoteaccess-update
e-smith-base-update
));
templates2events("/etc/hosts.deny", qw(
console-save
bootstrap-console-save
ibay-create
ibay-delete
ibay-modify
ibay-modify-servers
network-create
network-delete
ip-change
email-update
remoteaccess-update
e-smith-base-update
));
templates2events("/etc/hosts.allow", qw(
console-save
bootstrap-console-save
ibay-create
ibay-delete
ibay-modify
ibay-modify-servers
network-create
network-delete
ip-change
email-update
remoteaccess-update
e-smith-base-update
));
foreach my $file (qw(
/etc/pam.d/login
/etc/pam.d/system-auth
/etc/pam.d/passwd
/etc/pam.d/pwauth
/etc/pam_ldap.conf
/etc/pam_ldap.secret
/etc/security/pam_abl.conf
))
{
templates2events($file, qw(console-save bootstrap-console-save e-smith-base-update));
}
foreach (qw(
/etc/cpu.conf
/etc/cpu-system.conf
))
{
templates2events("$_", qw(
post-upgrade
console-save
bootstrap-console-save
ldap-update
e-smith-base-update
));
}
# conf-userlists
foreach (qw(users.allow accounts.allow accounts.deny))
{
templates2events("/etc/e-smith/pam/$_", qw(
bootstrap-console-save
ibay-create
ibay-delete
user-create
user-delete
password-modify
e-smith-base-update
));
}
# fstab-conf
templates2events("/etc/fstab", qw(post-install post-upgrade e-smith-base-update));
# init-conf
templates2events("/etc/inittab", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
remoteaccess-update
e-smith-base-update
));
# lynx-conf
templates2events("/etc/lynx.cfg", qw(console-save bootstrap-console-save e-smith-base-update));
templates2events("/etc/elinks.conf", qw(bootstrap-console-save e-smith-base-update));
#
# Set up generic logfile timestamp renaming/symlinking
foreach (qw(
/var/log/messages
/var/log/boot.log
/var/log/secure
/var/log/cron
/var/log/spooler
/var/log/maillog
))
{
safe_touch "root/etc/e-smith/events/logrotate/logfiles2timestamp/$_";
safe_touch "root/etc/e-smith/events/post-install/logfiles2timestamp/$_";
safe_touch "root/etc/e-smith/events/post-upgrade/logfiles2timestamp/$_";
safe_touch "root/etc/e-smith/events/e-smith-base-update/logfiles2timestamp/$_";
}
#--------------------------------------------------
# functions for manager panel
#--------------------------------------------------
my $panel = "manager";
panel_link("groups", $panel);
panel_link("localnetworks", $panel);
panel_link("online-manual", $panel);
panel_link("reboot", $panel);
panel_link("remoteaccess", $panel);
panel_link("review", $panel);
panel_link("useraccounts", $panel);
#--------------------------------------------------
# actions for e-smith-base-update event
#--------------------------------------------------
my $event = "e-smith-base-update";
templates2events("/etc/smartd.conf", $event);
templates2events("/home/e-smith/ssl.pem/pem", $event);
event_link("fix-startup", $event, "05");
event_link("rotate_timestamped_logfiles", $event, "05");
event_link("init-accounts", $event, "05");
event_link("set-hostname", $event, "10");
event_link("rmmod-bonding", $event, "10");
event_link("conf-startup", $event, "10");
event_link("user-lock-passwd", $event, "15");
event_link("group-modify-unix", $event, "15");
event_link("update-passwd", $event, "20");
event_link("count-active-user-accounts", $event, "25");
event_link("conf-modules", $event, "30");
event_link("create-mnt-floppy", $event, "50");
event_link("conf-routes", $event, "89");
event_link("reset-unsavedflag", $event, "95")
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/wan");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dhcpd");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/crond");
#--------------------------------------------------
# actions for console-save event
#--------------------------------------------------
my $event = "console-save";
templates2events("/etc/smartd.conf", $event);
templates2events("/home/e-smith/ssl.pem/pem", $event);
event_link("set-hostname", $event, "10");
event_link("conf-modules", $event, "30");
event_link("conf-startup", $event, "60");
event_link("reset-unsavedflag", $event, "95");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/wan");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dhcpd");
#--------------------------------------------------
# actions for bootstrap-console-save event
#--------------------------------------------------
$event = "bootstrap-console-save";
templates2events("/etc/smartd.conf", $event);
templates2events("/home/e-smith/ssl.pem/pem", $event);
event_link("rmmod-bonding", $event, "10");
event_link("set-hostname", $event, "10");
event_link("conf-modules", $event, "30");
event_link("conf-startup", $event, "60");
event_link("conf-routes", $event, "89");
event_link("reset-unsavedflag", $event, "95");
#--------------------------------------------------
# actions for bootstrap-ldap-save
#--------------------------------------------------
$event = "bootstrap-ldap-save";
templates2events("/etc/nsswitch.conf", $event);
templates2events("/etc/pam.d/system-auth", $event);
event_link("user-lock-passwd", $event, "15");
event_link("user-modify-unix", $event, "15");
#--------------------------------------------------
# actions for group-create event
#--------------------------------------------------
$event = "group-create";
event_link("group-create-unix", $event, "04");
#--------------------------------------------------
# actions for group-delete event
#--------------------------------------------------
$event = "group-delete";
event_link("group-delete-unix", $event, "15");
#--------------------------------------------------
# actions for group-modify event
#--------------------------------------------------
$event = "group-modify";
event_link("group-modify-unix", $event, "15");
#--------------------------------------------------
# actions for halt event
#--------------------------------------------------
$event = "halt";
event_link("halt", $event, "70");
#--------------------------------------------------
# actions for ip-change event
#--------------------------------------------------
$event = "ip-change";
event_link("set-external-ip", $event, "03");
event_link("update-dns", $event, "85");
#--------------------------------------------------
# actions for network-create event
#--------------------------------------------------
$event = "network-create";
event_link("conf-routes", $event, "89");
#--------------------------------------------------
# actions for network-delete event
#--------------------------------------------------
$event = "network-delete";
event_link("conf-routes", $event, "89");
#--------------------------------------------------
# actions for post-install event
#--------------------------------------------------
$event = "post-install";
event_link("fix-startup", $event, "05");
event_link("rotate_timestamped_logfiles", $event, "05");
event_link("init-accounts", $event, "05");
event_link("init-passwords", $event, "10");
event_link("conf-startup", $event, "10");
event_link("conf-modules", $event, "30");
event_link("create-mnt-floppy", $event, "50");
#--------------------------------------------------
# actions for post-upgrade event
#--------------------------------------------------
$event = "post-upgrade";
event_link("fix-startup", $event, "05");
event_link("rotate_timestamped_logfiles", $event, "05");
event_link("init-accounts", $event, "05");
event_link("conf-startup", $event, "10");
event_link("user-lock-passwd", $event, "15");
event_link("group-modify-unix", $event, "15");
event_link("update-passwd", $event, "20");
event_link("count-active-user-accounts", $event, "25");
event_link("conf-modules", $event, "30");
event_link("create-mnt-floppy", $event, "50");
event_link("copy-anaconda-logs", $event, "90");
#--------------------------------------------------
# actions for reboot event
#--------------------------------------------------
$event = "reboot";
safe_symlink("stop", "root/etc/e-smith/events/$event/services2adjust/wan");
event_link("reboot", $event, "99");
#--------------------------------------------------
# actions for remoteaccess-update event
#--------------------------------------------------
$event = "remoteaccess-update";
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dhcpd");
#--------------------------------------------------
# actions for user-create event
#--------------------------------------------------
$event = "user-create";
event_link("user-create-unix", $event, "04");
event_link("count-active-user-accounts", $event, "25");
event_link("user-group-modify", $event, "85");
#--------------------------------------------------
# actions for user-delete event
#--------------------------------------------------
$event = "user-delete";
event_link("user-delete-groups-and-pseudonyms", $event, "02");
event_link("user-delete-unix", $event, "15");
event_link("initialize-default-databases", $event, "23");
event_link("count-active-user-accounts", $event, "25");
#--------------------------------------------------
# actions for user-modify event
#--------------------------------------------------
$event = "user-modify";
event_link("user-modify-unix", $event, "15");
event_link("user-group-modify", $event, "85");
$event = "user-modify-admin";
event_link("user-modify-unix", $event, "15");
#--------------------------------------------------
# actions for user-lock event
#--------------------------------------------------
$event = "user-lock";
event_link("user-lock-passwd", $event, "15");
event_link("count-active-user-accounts", $event, "25");
#--------------------------------------------------
# actions for password-modify event
#--------------------------------------------------
$event = "password-modify";
event_link("count-active-user-accounts", $event, "25");
#--------------------------------------------------
# actions for timeserver-update event
#--------------------------------------------------
$event = "timeserver-update";
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/crond");
#--------------------------------------------------
# actions for ip-up event
#--------------------------------------------------
$event = "ip-up";
event_link("set-gateway-ip", $event, "55");
#--------------------------------------------------
# actions for ip-down event
#--------------------------------------------------
$event = "ip-down";
event_link("isdn-down-notify", $event, "50");
#--------------------------------------------------
# actions for logrotate event
#--------------------------------------------------
$event = "logrotate";
event_link("rotate_timestamped_logfiles", $event, "05");
event_link("purge-old-logs", $event, "75");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog");
#--------------------------------------------------
# actions for local event
#--------------------------------------------------
$event = "local";
#--------------------------------------------------
# actions for ldap-update event
#--------------------------------------------------
$event = "ldap-update";
templates2events("/home/e-smith/ssl.pem/pem", $event);
#--------------------------------------------------
# actions for ldap-update event
#--------------------------------------------------
$event = "ssl-update";
templates2events("/home/e-smith/ssl.pem/pem", $event);
#--------------------------------------------------
# actions for email-update event:
# email parameters have been changed in the e-smith
# manager; update system security, rewrite email config
# files, configure other system files (crontab is the
# important one), and restart server
#--------------------------------------------------
$event = "email-update";
my %service2order =
(
# Start rsyslog up before network!
raidmonitor => "15",
network => "37",
dhcpd => "65",
'local' => "99",
);
foreach my $service (keys %service2order)
{
service_link_enhanced($service, $service2order{$service}, 7);
}
%service2order =
(
dhcpd => "K35",
);
foreach my $service (keys %service2order)
{
service_link_enhanced($service, $service2order{$service}, 0);
service_link_enhanced($service, $service2order{$service}, 6);
service_link_enhanced($service, $service2order{$service}, 1);
}
# Set up links to daemontools.
safe_symlink("daemontools", "root/etc/rc.d/init.d/raidmonitor");
safe_symlink("run.dhclient", "root/var/service/wan/run.DHCPHostname");
safe_symlink("run.dhclient", "root/var/service/wan/run.DHCPEthernetAddress");
# Local event
safe_symlink("../daemontools", "root/etc/rc.d/init.d/supervise/local");
safe_symlink("/var/service/local" , 'root/service/local');
safe_touch("root/var/service/local/down");
# no template headers for /etc/pam_ldap.secret
safe_touch("root/etc/e-smith/templates/etc/pam_ldap.secret/template-begin");
system('mkdir -p root/usr/lib/systemd/system/multi-user.target.wants/');
unlink "root/usr/lib/systemd/system/multi-user.target.wants/bootstrap-console.service";
symlink("/usr/lib/systemd/system/bootstrap-console.service",
"root/usr/lib/systemd/system/multi-user.target.wants/bootstrap-console.service")
or die "Can't symlink to root/usr/lib/systemd/system/multi-user.target.wants/bootstrap-console.service: $!";
# languages links
foreach (qw(fr-be fr-lu fr-mc fr-ch))
{
safe_symlink("fr", "root/etc/e-smith/locale/$_");
}
foreach (qw(en-bz en-ca en-ie en-in en-jm en-my en-ph en-sg en-tt en-za en-zw))
{
safe_symlink("en-us", "root/etc/e-smith/locale/$_");
}
foreach (qw(es-ar es-bo es-cl es-co es-cr es-do es-ec es-es es-gt es-hn es-mx es-ni es-pa es-pe es-pr es-py es-sv es-us es-uy es-ve))
{
safe_symlink("es", "root/etc/e-smith/locale/$_");
}
foreach (qw(de-at de-ch de-de de-li de-lu))
{
safe_symlink("de", "root/etc/e-smith/locale/$_");
}
foreach (qw(it-ch it-it))
{
safe_symlink("it", "root/etc/e-smith/locale/$_");
}
foreach (qw(ro-ro ro-md))
{
safe_symlink("ro", "root/etc/e-smith/locale/$_");
}
foreach (qw(sv-fi sv-se))
{
safe_symlink("sv", "root/etc/e-smith/locale/$_");
}
safe_symlink("zh-tw", "root/etc/e-smith/locale/zh-hk");

1
contriborbase Normal file
View File

@ -0,0 +1 @@
sme10

724
createlinks Executable file
View File

@ -0,0 +1,724 @@
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
templates2events("/etc/sysconfig/i18n", qw(post-install post-upgrade e-smith-base-update));
templates2events("/etc/selinux/config", qw(post-install post-upgrade e-smith-base-update));
templates2events("/etc/systemd/system-preset/49-koozali.preset", qw(post-install post-upgrade e-smith-base-update console-save bootstrap-console-save bootstrap-ldap-save));
# give the correct configuration file of dhcpd.conf
templates2events("/etc/dhcp/dhcpd.conf", qw(bootstrap-console-save e-smith-base-update));
# ppp-conf-users
foreach (qw(pap-secrets chap-secrets))
{
templates2events("/etc/ppp/$_", qw(
bootstrap-console-save
console-save
remoteaccess-update
e-smith-base-update));
}
foreach (qw(
/var/service/wan/pppoe.pppd.conf
/var/service/wan/run.pppoe.conf
/etc/ppp/ip-down.local
/etc/ppp/ip-up.local
))
{
templates2events("$_", qw(
console-save
bootstrap-console-save
e-smith-base-update
));
}
# conf-dialup
foreach (qw(
/etc/sysconfig/network-scripts/ifcfg-ppp0
/etc/sysconfig/network-scripts/chat-ppp0
/etc/ppp/ip-up.local
/etc/ppp/ip-down.local
/etc/diald.conf
/etc/diald.filter
/etc/diald/link
/var/service/ippp/config
/etc/ppp/ioptions
))
{
templates2events($_, qw(console-save bootstrap-console-save e-smith-base-update));
}
# conf-networking
foreach (qw(
/etc/sysconfig/network-scripts/ifcfg-bond0
/etc/modprobe.d/bonding.conf
/etc/sysconfig/network
/etc/nsswitch.conf
/etc/HOSTNAME
/etc/hosts
/etc/resolv.conf
/etc/sysctl.conf
/var/service/wan/dhclient.config
))
{
templates2events($_, qw(console-save bootstrap-console-save e-smith-base-update));
}
event_link("update-ifcfg", "console-save", "05");
event_link("update-ifcfg", "bootstrap-console-save", "05");
# conf-other
templates2events("/etc/crontab", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
email-update
logrotate
e-smith-base-update
));
templates2events("/etc/mime.types", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
email-update
logrotate
e-smith-base-update
));
templates2events("/etc/sysconfig/rsyslog", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
email-update
logrotate
e-smith-base-update
));
templates2events("/etc/rsyslog.conf", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
email-update
logrotate
e-smith-base-update
));
templates2events("/etc/logrotate.conf", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
email-update
logrotate
e-smith-base-update
));
templates2events("/etc/systemd/journald.conf", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
email-update
logrotate
e-smith-base-update
));
templates2events("/etc/updatedb.conf", qw(
bootstrap-console-save
e-smith-base-update
));
templates2events("/etc/openssl.conf", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
domain-create
domain-delete
network-create
network-delete
ip-change
e-smith-base-update
));
# conf-routes
event_link("update-ifcfg", "network-create", "05");
event_link("update-ifcfg", "network-delete", "05");
# conf-security
templates2events("/etc/securetty", qw(
console-save
bootstrap-console-save
ibay-create
ibay-delete
ibay-modify
ibay-modify-servers
network-create
network-delete
ip-change
email-update
remoteaccess-update
e-smith-base-update
));
templates2events("/etc/services", qw(
console-save
bootstrap-console-save
ibay-create
ibay-delete
ibay-modify
ibay-modify-servers
network-create
network-delete
ip-change
email-update
remoteaccess-update
e-smith-base-update
));
templates2events("/etc/shells", qw(
console-save
bootstrap-console-save
ibay-create
ibay-delete
ibay-modify
ibay-modify-servers
network-create
network-delete
ip-change
email-update
remoteaccess-update
e-smith-base-update
));
templates2events("/etc/hosts.deny", qw(
console-save
bootstrap-console-save
ibay-create
ibay-delete
ibay-modify
ibay-modify-servers
network-create
network-delete
ip-change
email-update
remoteaccess-update
e-smith-base-update
));
templates2events("/etc/hosts.allow", qw(
console-save
bootstrap-console-save
ibay-create
ibay-delete
ibay-modify
ibay-modify-servers
network-create
network-delete
ip-change
email-update
remoteaccess-update
e-smith-base-update
));
foreach my $file (qw(
/etc/pam.d/login
/etc/pam.d/system-auth
/etc/pam.d/passwd
/etc/pam.d/pwauth
/etc/pam_ldap.conf
/etc/pam_ldap.secret
/etc/security/pam_abl.conf
))
{
templates2events($file, qw(console-save bootstrap-console-save e-smith-base-update));
}
foreach (qw(
/etc/cpu.conf
/etc/cpu-system.conf
))
{
templates2events("$_", qw(
post-upgrade
console-save
bootstrap-console-save
ldap-update
e-smith-base-update
));
}
# conf-userlists
foreach (qw(users.allow accounts.allow accounts.deny))
{
templates2events("/etc/e-smith/pam/$_", qw(
bootstrap-console-save
ibay-create
ibay-delete
user-create
user-delete
password-modify
e-smith-base-update
));
}
# fstab-conf
templates2events("/etc/fstab", qw(post-install post-upgrade e-smith-base-update));
# init-conf
templates2events("/etc/inittab", qw(
console-save
bootstrap-console-save
post-install
post-upgrade
remoteaccess-update
e-smith-base-update
));
# lynx-conf
templates2events("/etc/lynx.cfg", qw(console-save bootstrap-console-save e-smith-base-update));
templates2events("/etc/elinks.conf", qw(bootstrap-console-save e-smith-base-update));
#--------------------------------------------------
# functions for manager panel
#--------------------------------------------------
my $panel = "manager";
panel_link("groups", $panel);
panel_link("localnetworks", $panel);
panel_link("online-manual", $panel);
panel_link("reboot", $panel);
panel_link("remoteaccess", $panel);
panel_link("review", $panel);
panel_link("useraccounts", $panel);
#--------------------------------------------------
# actions for e-smith-base-update event
#--------------------------------------------------
my $event = "e-smith-base-update";
event_link("remove-templates-custom", $event, "02");
templates2events("/etc/smartmontools/smartd.conf", $event);
templates2events("/home/e-smith/ssl.pem/pem", $event);
templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event);
event_link("systemd-journald", $event, "02");
event_link("fix-startup", $event, "05");
event_link("init-accounts", $event, "05");
event_link("logrotate-migrate", $event, "06");
event_link("rotate_logfiles", $event, "07");
event_link("set-hostname", $event, "10");
event_link("rmmod-bonding", $event, "10");
event_link("conf-startup", $event, "10");
event_link("user-lock-passwd", $event, "15");
event_link("group-modify-unix", $event, "15");
event_link("user-rsshd", $event, "16");
event_link("update-passwd", $event, "20");
event_link("count-active-user-accounts", $event, "25");
event_link("conf-modules", $event, "30");
event_link("create-mnt-floppy", $event, "50");
event_link("ldap-update" , $event, "80");
event_link("conf-routes", $event, "89");
event_link("systemd-default", $event, "88");
event_link("systemd-isolate", $event, "89");
event_link("systemd-reload", $event, "89");
event_link("raidmonitor-check", $event, "92");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/network");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/wan");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dhcpd");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/crond");
#--------------------------------------------------
# actions for console-save event
#--------------------------------------------------
my $event = "console-save";
event_link("remove-templates-custom", $event, "02");
templates2events("/etc/smartmontools/smartd.conf", $event);
templates2events("/home/e-smith/ssl.pem/pem", $event);
templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event);
event_link("set-hostname", $event, "10");
event_link("user-rsshd", $event, "16");
event_link("conf-modules", $event, "30");
event_link("conf-startup", $event, "60");
event_link("systemd-default", $event, "88");
event_link("systemd-reload", $event, "89");
event_link("raidmonitor-check", $event, "92");
event_link("reset-unsavedflag", $event, "95");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/wan");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dhcpd");
#--------------------------------------------------
# actions for bootstrap-console-save event
#--------------------------------------------------
$event = "bootstrap-console-save";
event_link("remove-templates-custom", $event, "02");
templates2events("/etc/smartmontools/smartd.conf", $event);
templates2events("/home/e-smith/ssl.pem/pem", $event);
templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event);
event_link("rmmod-bonding", $event, "10");
event_link("set-hostname", $event, "10");
event_link("conf-modules", $event, "30");
event_link("conf-startup", $event, "60");
event_link("systemd-default", $event, "88");
event_link("conf-routes", $event, "89");
event_link("systemd-reload", $event, "89");
event_link("reset-unsavedflag", $event, "95");
#--------------------------------------------------
# actions for bootstrap-ldap-save
#--------------------------------------------------
$event = "bootstrap-ldap-save";
templates2events("/etc/nsswitch.conf", $event);
templates2events("/etc/pam.d/system-auth", $event);
event_link("user-lock-passwd", $event, "15");
event_link("user-modify-unix", $event, "15");
event_link("systemd-default", $event, "88");
event_link("systemd-reload", $event, "89");
#--------------------------------------------------
# actions for group-create event
#--------------------------------------------------
$event = "group-create";
event_link("group-create-unix", $event, "04");
#--------------------------------------------------
# actions for group-delete event
#--------------------------------------------------
$event = "group-delete";
event_link("group-delete-unix", $event, "15");
#--------------------------------------------------
# actions for group-modify event
#--------------------------------------------------
$event = "group-modify";
event_link("group-modify-unix", $event, "15");
#--------------------------------------------------
# actions for halt event
#--------------------------------------------------
$event = "halt";
event_link("halt", $event, "70");
#--------------------------------------------------
# actions for ip-change event
#--------------------------------------------------
$event = "ip-change";
event_link("set-external-ip", $event, "03");
#event_link("update-dns", $event, "85");
#--------------------------------------------------
# actions for network-create event
#--------------------------------------------------
$event = "network-create";
event_link("conf-routes", $event, "89");
#--------------------------------------------------
# actions for network-delete event
#--------------------------------------------------
$event = "network-delete";
event_link("conf-routes", $event, "89");
#--------------------------------------------------
# actions for post-install event
#--------------------------------------------------
$event = "post-install";
templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event);
event_link("systemd-journald", $event, "02");
event_link("fix-startup", $event, "05");
event_link("init-accounts", $event, "05");
event_link("rotate_logfiles", $event, "07");
event_link("init-passwords", $event, "10");
event_link("conf-startup", $event, "10");
event_link("user-rsshd", $event, "16");
event_link("conf-modules", $event, "30");
event_link("create-mnt-floppy", $event, "50");
event_link("systemd-default", $event, "88");
event_link("systemd-reload", $event, "89");
#--------------------------------------------------
# actions for post-upgrade event
#--------------------------------------------------
$event = "post-upgrade";
event_link("remove-templates-custom", $event, "02");
templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event);
event_link("systemd-journald", $event, "02");
event_link("fix-startup", $event, "05");
event_link("init-accounts", $event, "05");
event_link("logrotate-migrate", $event, "06");
event_link("rotate_logfiles", $event, "07");
event_link("conf-startup", $event, "10");
event_link("user-lock-passwd", $event, "15");
event_link("group-modify-unix", $event, "15");
event_link("user-rsshd", $event, "16");
event_link("update-passwd", $event, "20");
event_link("count-active-user-accounts", $event, "25");
event_link("conf-modules", $event, "30");
event_link("create-mnt-floppy", $event, "50");
event_link("copy-anaconda-logs", $event, "90");
event_link("systemd-default", $event, "88");
event_link("systemd-reload", $event, "89");
event_link("raidmonitor-check", $event, "92");
#--------------------------------------------------
# actions for reboot event
#--------------------------------------------------
$event = "reboot";
safe_symlink("stop", "root/etc/e-smith/events/$event/services2adjust/wan");
event_link("reboot", $event, "99");
#--------------------------------------------------
# actions for remoteaccess-update event
#--------------------------------------------------
$event = "remoteaccess-update";
event_link("remove-templates-custom", $event, "02");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dhcpd");
event_link("systemd-default", $event, "88");
event_link("systemd-reload", $event, "89");
#--------------------------------------------------
# actions for user-create event
#--------------------------------------------------
$event = "user-create";
event_link("user-create-unix", $event, "04");
event_link("user-rsshd", $event, "16");
event_link("count-active-user-accounts", $event, "25");
event_link("user-group-modify", $event, "85");
#--------------------------------------------------
# actions for user-delete event
#--------------------------------------------------
$event = "user-delete";
event_link("user-delete-groups-and-pseudonyms", $event, "02");
event_link("user-delete-unix", $event, "15");
event_link("initialize-default-databases", $event, "23");
event_link("count-active-user-accounts", $event, "25");
#--------------------------------------------------
# actions for user-modify event
#--------------------------------------------------
$event = "user-modify";
event_link("user-modify-unix", $event, "15");
event_link("user-rsshd", $event, "16");
event_link("user-group-modify", $event, "85");
$event = "user-modify-admin";
event_link("user-modify-unix", $event, "15");
#--------------------------------------------------
# actions for user-lock event
#--------------------------------------------------
$event = "user-lock";
event_link("user-lock-passwd", $event, "15");
event_link("count-active-user-accounts", $event, "25");
#--------------------------------------------------
# actions for password-modify event
#--------------------------------------------------
$event = "password-modify";
event_link("count-active-user-accounts", $event, "25");
#--------------------------------------------------
# actions for timeserver-update event
#--------------------------------------------------
$event = "timeserver-update";
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/crond");
#--------------------------------------------------
# actions for ip-up event
#--------------------------------------------------
$event = "ip-up";
event_link("set-gateway-ip", $event, "55");
#--------------------------------------------------
# actions for ip-down event
#--------------------------------------------------
$event = "ip-down";
event_link("isdn-down-notify", $event, "50");
#--------------------------------------------------
# actions for logrotate event
#--------------------------------------------------
$event = "logrotate";
event_link("logrotate-migrate", $event, "06");
event_link("rotate_logfiles", $event, "07");
event_link("purge-old-logs", $event, "75");
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog");
#--------------------------------------------------
# actions for local event
#--------------------------------------------------
$event = "local";
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rc-local");
#--------------------------------------------------
# actions for ldap-update event
#--------------------------------------------------
$event = "ldap-update";
templates2events("/home/e-smith/ssl.pem/pem", $event);
#--------------------------------------------------
# actions for ldap-update event
#--------------------------------------------------
$event = "ssl-update";
templates2events("/home/e-smith/ssl.pem/pem", $event);
#--------------------------------------------------
# actions for email-update event:
# email parameters have been changed in the e-smith
# manager; update system security, rewrite email config
# files, configure other system files (crontab is the
# important one), and restart server
#--------------------------------------------------
$event = "email-update";
event_link("systemd-default", $event, "88");
event_link("systemd-reload", $event, "89");
#--------------------------------------------------
# actions for webapps-update event
#--------------------------------------------------
$event = "webapps-update";
event_link("systemd-default", $event, "88");
event_link("systemd-reload", $event, "89");
# Set up links to daemontools.
safe_symlink("run.dhclient", "root/var/service/wan/run.DHCPHostname");
safe_symlink("run.dhclient", "root/var/service/wan/run.DHCPEthernetAddress");
# no template headers for /etc/pam_ldap.secret
safe_touch("root/etc/e-smith/templates/etc/pam_ldap.secret/template-begin");
foreach my $target (qw(multi-user sme-server))
{
system('mkdir -p root/usr/lib/systemd/system/'.$target.'.target.wants/');
unlink "root/usr/lib/systemd/system/$target.target.wants/bootstrap-console.service";
foreach my $unit (qw(
dbus.service
getty.target
plymouth-quit.service
plymouth-quit-wait.service
systemd-ask-password-wall.path
systemd-logind.service
systemd-update-utmp-runlevel.service
systemd-user-sessions.service
networking.service
mdmonitor.service
))
{
symlink("../$unit",
"root/usr/lib/systemd/system/$target.target.wants/$unit")
or die "Can't symlink to root/usr/lib/systemd/system/$target.target.wants/$unit: $!";
}
}
foreach my $target (qw(halt reboot shutdown))
{
$unit="bootstrap-fix.service";
safe_symlink("../$unit", "root/usr/lib/systemd/system/$target.target.wants/$unit");
}
$unit="bootstrap-console.service";
$target="basic";
symlink("../$unit",
"root/usr/lib/systemd/system/$target.target.wants/$unit")
or die "Can't symlink to root/usr/lib/systemd/system/$target.target.wants/$unit: $!";
symlink("mdmonitor.service",
"root/usr/lib/systemd/system/raidmonitor.service");
# languages links
foreach (qw(fr-be fr-lu fr-mc fr-ch))
{
safe_symlink("fr", "root/etc/e-smith/locale/$_");
}
foreach (qw(en-bz en-ca en-ie en-in en-jm en-my en-ph en-sg en-tt en-za en-zw))
{
safe_symlink("en-us", "root/etc/e-smith/locale/$_");
}
foreach (qw(es-ar es-bo es-cl es-co es-cr es-do es-ec es-es es-gt es-hn es-mx es-ni es-pa es-pe es-pr es-py es-sv es-us es-uy es-ve))
{
safe_symlink("es", "root/etc/e-smith/locale/$_");
}
foreach (qw(de-at de-ch de-de de-li de-lu))
{
safe_symlink("de", "root/etc/e-smith/locale/$_");
}
foreach (qw(it-ch it-it))
{
safe_symlink("it", "root/etc/e-smith/locale/$_");
}
foreach (qw(ro-ro ro-md))
{
safe_symlink("ro", "root/etc/e-smith/locale/$_");
}
foreach (qw(sv-fi sv-se))
{
safe_symlink("sv", "root/etc/e-smith/locale/$_");
}
safe_symlink("zh-tw", "root/etc/e-smith/locale/zh-hk");
# sme-server.target.d links
safe_symlink("/etc/e-smith/templates/etc/systemd/system-preset/49-koozali.preset/05config", "root/etc/e-smith/templates/usr/lib/systemd/system/sme-server.target.d/50koozali.conf/05config");

2315
e-smith-base.spec Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,28 @@
#!/usr/bin/perl -w
use strict;
use esmith::ConfigDB;
use esmith::templates;
use esmith::event;
use Digest::file qw(digest_file_hex);
my $c = esmith::ConfigDB->open_ro;
my $s = $c->get('SystemName')->value;
my $d = $c->get('DomainName')->value;
my $pem = "/home/e-smith/ssl.pem/$s.$d.pem";
if (!-e $pem){
die "$pem doesn't exist. This shouldn't happen. Please report a bug\n";
}
my $old_hash = digest_file_hex( $pem, 'SHA-1' );
esmith::templates::processTemplate({
TEMPLATE_PATH => '/home/e-smith/ssl.pem/pem',
});
my $new_hash = digest_file_hex( $pem, 'SHA-1' );
if ($old_hash ne $new_hash){
event_signal("ssl-update");
}

View File

@ -0,0 +1,4 @@
if [ "$reason" = "BOUND" ]
then
/sbin/e-smith/signal-event ip-change "$new_ip_address" "$interface"
fi

View File

@ -0,0 +1,14 @@
# This file is used by /usr/share/diald/connect to determine how
# to establish a connection using the given device.
#
# First match is used. List specific device names before generic types.
#
# Device type Dial method
# ----------- -----------
/dev/ttyS0 modem/generic
/dev/ttyS1 modem/generic
/dev/ttyS2 modem/generic
/dev/ttyS3 modem/generic
modem modem/generic
ippp isdn
isdn isdn

130
root/etc/diald/scripts/connect Executable file
View File

@ -0,0 +1,130 @@
#!/bin/sh
# $DIALD_LINK is the name of the link we are connecting.
# $DIALD_DEVICE is the device we are calling out on.
#CFG_SCRIPTS='/usr/share/diald'
CFG_SCRIPTS='/etc/diald/scripts'
CFG_DEVICE='/etc/diald/device.conf'
CFG_LINK="/etc/diald/link"
CFG_SEQ='/var/run'
# $DIALD_DEVTYPE is a sanitized version of $DIALD_DEVICE.
case "$DIALD_DEVICE" in
ippp*) DIALD_DEVTYPE='isdn' ;;
isdn*) DIALD_DEVTYPE='isdn' ;;
*) DIALD_DEVTYPE='modem' ;;
esac
connect()
{
status=0
# If this device has a dial script we use it to bring up
# the physical link.
if [ -n "$dial_script" -a "$dial_script" != '-' ]; then
"$CFG_SCRIPTS/$dial_script"
status=$?
if [ $status -ne 0 ]; then
exit $status
fi
fi
# If we need to do some form of login when connecting this
# link over this device, do it now.
if [ -n "$LOGIN" -a "$LOGIN" != '-' ]; then
"$CFG_SCRIPTS/login/$LOGIN"
status=$?
fi
# If everything worked we start from the beginning of the
# list again next time
if [ $status -eq 0 ]; then
echo 1 > "$CFG_SEQ/dialdseq.$DIALD_LINK"
fi
exit $status
}
# Save stdin, we need it later if we are dialling a modem.
exec 9<&0
# Find out what dial script to use on this device.
exec < "$CFG_DEVICE"
gotdev=
while read dev dial_script dial_args
do
# Ignore blank lines and comments.
case "$dev" in
'#'*|'')
continue ;;
esac
if [ "$dev" = "$DIALD_DEVICE" -o "$dev" = "$DIALD_DEVTYPE" ]; then
gotdev=1
break
fi
done
if [ -z "$gotdev" ]; then
echo "<3>No entry for $DIALD_DEVICE, type $DIALD_DEVTYPE in $CFG_DEVICE"
exit 1
fi
seq=0
if [ -r "$CFG_SEQ/dialdseq.$DIALD_LINK" ]; then
seq=`cat "$CFG_SEQ/dialdseq.$DIALD_LINK"`
fi
seq=`expr $seq + 1`
echo $seq > "$CFG_SEQ/dialdseq.$DIALD_LINK"
passes=2
while [ $passes -gt 0 ]; do
passes=`expr $passes - 1`
exec < "$CFG_LINK"
dev_type=
link_params=
base_params=
counted=0
while read dev_type link_params
do
# Ignore blank lines and comments.
case "$dev_type" in
'#'*|'')
continue ;;
esac
if [ "$dev_type" = '=' ]; then
base_params="$link_params"
elif [ "$dev_type" = '+' ]; then
base_params="$base_params $link_params"
elif [ "$dev_type" = "$DIALD_DEVICE" \
-o "$dev_type" = "$DIALD_DEVTYPE" ]; then
counted=`expr $counted + 1`
seq=`expr $seq - 1`
if [ $seq -eq 0 ]; then
passes=0
exec 0<&9
eval "$dial_args $base_params $link_params connect"
exit $?
fi
fi
done
# If no entries match there is a problem
if [ $counted -eq 0 ]; then
echo "<3>No entry for $DIALD_DEVICE, type $DIALD_DEVTYPE in $CFG_LINK"
exit 1
fi
# One or more entries exists, we have just run off the end
# of the list so we have to start again from the top.
echo 1 > "$CFG_SEQ/dialdseq.$DIALD_LINK"
seq=1
done
exit 1

106
root/etc/diald/scripts/disconnect Executable file
View File

@ -0,0 +1,106 @@
#!/bin/sh
# $DIALD_LINK is the name of the link we are disconnecting.
# $DIALD_DEVICE is the device we are called out on.
#CFG_SCRIPTS='/usr/share/diald'
CFG_SCRIPTS='/etc/diald/scripts'
CFG_DEVICE='/etc/diald/device.conf'
CFG_LINK="/etc/diald/link"
CFG_SEQ='/var/run'
# $DIALD_DEVTYPE is a sanitized version of $DIALD_DEVICE.
case "$DIALD_DEVICE" in
ippp*) DIALD_DEVTYPE='isdn' ;;
isdn*) DIALD_DEVTYPE='isdn' ;;
*) DIALD_DEVTYPE='modem' ;;
esac
disconnect()
{
status=0
# If this device has a hangup script we use it to hang up
# the physical link.
if [ -n "$dial_script" -a "$dial_script" != '-' \
-a -x "$CFG_SCRIPTS/$dial_script.hangup" ]; then
"$CFG_SCRIPTS/$dial_script.hangup"
status=$?
if [ $status -ne 0 ]; then
exit $status
fi
fi
exit $status
}
# Save stdin, we need it later if we are dialling a modem.
exec 9<&0
# Find out what dial script to use on this device.
exec < "$CFG_DEVICE"
gotdev=
while read dev dial_script dial_args
do
# Ignore blank lines and comments.
case "$dev" in
'#'*|'')
continue ;;
esac
if [ "$dev" = "$DIALD_DEVICE" -o "$dev" = "$DIALD_DEVTYPE" ]; then
gotdev=1
break
fi
done
if [ -z "$gotdev" ]; then
echo "<3>No entry for $DIALD_DEVICE, type $DIALD_DEVTYPE in $CFG_DEVICE"
exit 1
fi
seq=1
if [ -r "$CFG_SEQ/dialdseq.$DIALD_LINK" ]; then
seq=`cat "$CFG_SEQ/dialdseq.$DIALD_LINK"`
fi
exec < "$CFG_LINK"
dev_type=
link_params=
base_params=
counted=0
while read dev_type link_params
do
# Ignore blank lines and comments.
case "$dev_type" in
'#'*|'')
continue ;;
esac
if [ "$dev_type" = '=' ]; then
base_params="$link_params"
elif [ "$dev_type" = '+' ]; then
base_params="$base_params $link_params"
elif [ "$dev_type" = "$DIALD_DEVICE" \
-o "$dev_type" = "$DIALD_DEVTYPE" ]; then
seq=`expr $seq - 1`
counted=`expr $counted + 1`
if [ $seq -eq 0 ]; then
exec 0<&9
eval "$dial_args $base_params $link_params disconnect"
exit $?
fi
fi
done
# If no entries match there is a problem
if [ $counted -eq 0 ]; then
echo "<3>No entry for $DIALD_DEVICE, type $DIALD_DEVTYPE in $CFG_LINK"
exit 1
fi
echo "<3>Did not find entry matching sequence number $seq for $DIALD_DEVICE, type $DIALD_DEVTYPE in $CFG_LINK"
exit 1

83
root/etc/diald/scripts/isdn Executable file
View File

@ -0,0 +1,83 @@
#!/bin/sh
#exec > /tmp/isdn.log 2>&1
#set -x
end_dial() {
for n in $PHONE
do
/usr/sbin/isdnctrl delphone "$DIALD_DEVICE" out "$n"
done
/usr/sbin/isdnctrl eaz "$DIALD_DEVICE" "$EAZ_IN"
if [ $status -ne 0 ]; then
# You should have specified "lock" in diald's config
# otherwise if we try and dial out on a device that
# is already connected we will hang it up.
/usr/sbin/isdnctrl hangup "$DIALD_DEVICE"
fi
exit $status
}
trap 'end_dial' 0
for n in $PHONE
do
/usr/sbin/isdnctrl addphone "$DIALD_DEVICE" out "$n"
done
/usr/sbin/isdnctrl eaz "$DIALD_DEVICE" "$EAZ_OUT"
/usr/sbin/isdnctrl dial "$DIALD_DEVICE"
status=$?
if [ $status -eq 0 ]; then
status=1
while true
do
msg=`/sbin/ifconfig "$DIALD_DEVICE" 2>&1`
if echo "$msg" | grep 'P-t-P:0.0.0.0' > /dev/null 2>&1
then
# no link yet...
WAITTIME=`expr $WAITTIME - 1`
if [ $WAITTIME -ge 0 ]; then
# still waiting...
sleep 1
else
echo "Timed out" 1>&2
break
fi
elif echo "$msg" | grep 'P-t-P:\[NONE SET\]' > /dev/null 2>&1
then
# no link yet...
WAITTIME=`expr $WAITTIME - 1`
if [ $WAITTIME -ge 0 ]; then
# still waiting...
sleep 1
else
echo "Timed out" 1>&2
break
fi
elif [ -n "$REMOTEIP" ]; then
if echo "$msg" | grep "P-t-P:$REMOTEIP" > /dev/null 2>&1
then
echo "Interface up: remote host ok" 1>&2
status=0
break
fi
elif [ -z "$REMOTEIP" ]; then
# The remote has a dynamic IP so we have no way
# of knowing whether the dial succeeded or some
# incoming connection was accepted. (If diald
# is not using device locking we may even have
# dialled somewhere else!)
echo "Interface up: host indeterminate" 1>&2
status=0
break
else
# Dial failed and something else is using this link.
echo "Interface up: wrong host - not my link" 1>&2
break
fi
done
fi
exit $status

View File

@ -0,0 +1,37 @@
#!/bin/sh
/usr/sbin/isdnctrl eaz "$DIALD_DEVICE" "$EAZ_IN"
/usr/sbin/isdnctrl hangup "$DIALD_DEVICE"
status=$?
if [ $status -eq 0 ]; then
status=1
while true
do
msg=`/sbin/ifconfig "$DIALD_DEVICE" 2>&1`
if echo "$msg" | grep 'P-t-P:' > /dev/null 2>&1
then
# no link yet...
WAITTIME=`expr $WAITTIME - 1`
if [ $WAITTIME -ge 0 ]; then
# still waiting...
sleep 1
else
echo "Timed out - link still up" 1>&2
break
fi
else
echo "Link is down" 1>&2
status=0
break
fi
done
else
echo "Error return $status from isdnctrl hangup command" 2>&1
fi
# Set fake IPs for ippp0 device, to help diald
/sbin/ifconfig "$DIALD_DEVICE" \
$(/sbin/e-smith/db configuration get LocalIP) pointopoint 0.0.0.0 \
|| echo "Error ($?) while forcing ippp0 device down" 2>&1
exit $status

View File

@ -0,0 +1 @@
enabled

View File

@ -0,0 +1 @@
shared

View File

@ -0,0 +1 @@
no

View File

@ -0,0 +1 @@
Primary i-bay

View File

@ -0,0 +1 @@
no

View File

@ -0,0 +1 @@
no

View File

@ -0,0 +1 @@
global

View File

@ -0,0 +1 @@
no

View File

@ -0,0 +1 @@
wr-admin-rd-group

View File

@ -0,0 +1 @@
ibay

View File

@ -0,0 +1 @@
Local

View File

@ -0,0 +1 @@
Administrator

View File

@ -0,0 +1 @@
no

View File

@ -0,0 +1 @@
no

View File

@ -0,0 +1 @@
/sbin/e-smith/console

View File

@ -0,0 +1 @@
no

View File

@ -0,0 +1 @@
system

View File

@ -0,0 +1 @@
admin

View File

@ -0,0 +1 @@
no

View File

@ -0,0 +1 @@
internal

View File

@ -0,0 +1 @@
pseudonym

View File

@ -0,0 +1 @@
url

View File

@ -0,0 +1 @@
url

View File

@ -0,0 +1 @@
url

View File

@ -0,0 +1 @@
url

View File

@ -0,0 +1 @@
url

View File

@ -0,0 +1 @@
system

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1 @@
system

View File

@ -0,0 +1 @@
url

View File

@ -0,0 +1 @@
url

View File

@ -0,0 +1 @@
url

View File

@ -0,0 +1 @@
url

View File

@ -0,0 +1 @@
internal

View File

@ -0,0 +1 @@
system

View File

@ -0,0 +1 @@
url

View File

@ -0,0 +1 @@
placeholder for webmail URL

View File

@ -0,0 +1 @@
url

View File

View File

@ -0,0 +1,4 @@
{
use esmith::AccountsDB;
$DB = esmith::AccountsDB->open;
}

View File

@ -0,0 +1,10 @@
{
# Delete any pre-existing Primary=system record
my $p = $DB->get('Primary');
return unless defined $p;
my $type = $p->prop('type');
return unless defined $type;
$p->delete if $type eq 'system';
}

View File

@ -0,0 +1,11 @@
{
use esmith::ConfigDB;
my $conf = esmith::ConfigDB->open_ro() or return;
my $pw_set = $conf->get_value("PasswordSet") || "no";
my $admin = $DB->get('admin') || return;
$admin->set_prop('PasswordSet', $pw_set);
}

View File

@ -0,0 +1,6 @@
{
foreach my $user ($DB->get_all_by_prop(EmailForward => 'procmail'))
{
$user->set_prop('EmailForward','local');
}
}

View File

@ -0,0 +1,18 @@
{
# Migrate PPTPAccess -> VPNClientAccess and ensure a default for
# all user/admin accounts
foreach my $account ($DB->get_all)
{
next unless ( ($account->key eq 'admin') or
($account->prop('type') eq 'user') );
next if (defined $account->prop('VPNClientAccess'));
my $access = $account->prop('PPTPAccess') || 'no';
$account->delete_prop('PPTPAccess');
$account->set_prop('VPNClientAccess', $access);
}
}

View File

@ -0,0 +1 @@
dedicated

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1 @@
login

View File

@ -0,0 +1 @@
long

View File

@ -0,0 +1 @@
long

View File

@ -0,0 +1 @@
long

View File

@ -0,0 +1 @@
every15min

View File

@ -0,0 +1 @@
everyhour

View File

@ -0,0 +1 @@
everyhour

View File

@ -0,0 +1 @@
/dev/ttyS1

View File

@ -0,0 +1 @@
useraccount

View File

@ -0,0 +1 @@
userpassword

View File

@ -0,0 +1 @@
mycompany.local

View File

@ -0,0 +1 @@
returntosender

View File

@ -0,0 +1 @@
unknown

View File

@ -0,0 +1 @@
unknown

View File

@ -0,0 +1 @@
off

View File

@ -0,0 +1 @@
none

View File

@ -0,0 +1 @@
interface

View File

@ -0,0 +1 @@
255.255.255.0

View File

@ -0,0 +1 @@
miimon=200 mode=active-backup

View File

@ -0,0 +1 @@
eth0

View File

@ -0,0 +1 @@
255.255.255.0

View File

@ -0,0 +1 @@
interface

View File

@ -0,0 +1 @@
255.255.255.0

View File

@ -0,0 +1 @@
5000

View File

@ -0,0 +1 @@
no

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@
off

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