[submodule "config"]
path = config
url = ../../../botm/config
+[submodule "exec"]
+ path = exec
+ url = ../../../botm/exec
-Subproject commit 778dbca76f413af0b5d2c442a482b4d4eebaf2cb
+Subproject commit 352e86fd3d4afab9adb6c340d236f501f3d91560
--- /dev/null
+Subproject commit 4cc21a9192d4f85d7dcee52333e5810d8aadc109
endif
PERL = perl
+CC =/usr/bin/gcc
+CF =-g -Wall
+
CHMOD = /usr/bin/chmod
CP = /usr/bin/cp
MKDIR = /usr/bin/mkdir
BIN_PATH = /botm/bin/test-ottbackup/mscha/
LIB_PATH = /botm/lib/test-ottbackup/mscha/
+LOG_PATH = /botm/log/test-ottbackup/mscha/
WWW_PATH = /botm/www/1190/mschatest/
CONF = /botm/etc/www/conf/1190/test-mscha.conf
frame.1.pl\
frameaftertime.1.pl\
mscha.1.conf\
+mscha_lib.1.pm\
viewer.1.pl\
vieweraftertime.1.pl\
frame.pl\
frameaftertime.pl\
mscha.conf\
+mscha_lib.pm\
viewer.pl\
vieweraftertime.pl\
+PERL_WRAP_EXEC=\
+frame\
+frameaftertime\
+viewer\
+vieweraftertime
+
+SETUID=\
+frame\
+frameaftertime\
+viewer\
+vieweraftertime
+
EXEC=\
frame.pl\
frameaftertime.pl\
vieweraftertime.pl
BIN=\
-$(EXEC)
+$(EXEC)\
+$(PERL_WRAP_EXEC)
+
LIB=\
mscha_lib.pm
DIR=\
+$(LOG_PATH)\
$(BIN_PATH)\
$(LIB_PATH)\
$(WWW_PATH)
-all: exec $(TO_GENERATE)
+all: setuid exec $(TO_GENERATE)
install: cp_bin cp_lib cp_conf cp_www
$(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE) configure.pl
$(CONFIGURE_CMD) --v --in $(GENERATE_FROM) --out $(TO_GENERATE)
+$(PERL_WRAP_EXEC): %: exec/exec.c exec/settings.txt configure.pl
+ $(PERL) configure.pl --do path=$(BIN_PATH) target=$*.pl io_path=$(LOG_PATH) stderr=$*-stderr.log exec/settings.txt --in exec/exec.c --out $*.c
+ $(CC) $(CF) -o $@ $*.c
+
+exec: $(EXEC)
+ $(CHMOD) +x $(EXEC)
+
+setuid: $(SETUID)
+ $(CHMOD) u+s,g+s $(SETUID)
+
mktree:
$(MKDIR) -p $(DIR)
cp_www_data:
$(CP) -p -r www-data/* $(WWW_PATH)
-exec: $(EXEC)
- $(CHMOD) +x $(EXEC)
clean:
- $(RM) -f configure.pl $(TO_GENERATE)
+ $(RM) -f configure.pl $(TO_GENERATE) $(PERL_WRAP_EXEC) $(PERL_WRAP_EXEC:=.c)
$(PERL) config/configure.1.pl --do $(DEFAULT_CONFIGFILE) --in makefile.1.mak --out makefile
-PHONY: all clean cp_bin cp_conf cp_lib cp_www cp_www_data exec install install_all mktree
+PHONY: all clean cp_bin cp_conf cp_lib cp_www cp_www_data exec install install_all mktree setuid
endif
PERL = perl
+###MAKE_CC: CC=gcc
+###MAKE_CF: CF=-g -Wall
+
###MAKE_CHMOD: CHMOD = chmod
###MAKE_CP: CP = cp
###MAKE_MKDIR: MKDIR = mkdir
###MAKE_BIN_PATH: BIN_PATH = /botm/bin/ottbackup/mscha
###MAKE_LIB_PATH: LIB_PATH = /botm/lib/ottbackup/mscha
+###MAKE_LOG_PATH: LOG_PATH = /botm/log/ottbackup/mscha
###MAKE_WWW_PATH: WWW_PATH = /botm/www/1190/mscha
###MAKE_CONF: CONF = /botm/etc/www/conf/1190/mscha.conf
frame.1.pl\
frameaftertime.1.pl\
mscha.1.conf\
+mscha_lib.1.pm\
viewer.1.pl\
vieweraftertime.1.pl\
frame.pl\
frameaftertime.pl\
mscha.conf\
+mscha_lib.pm\
viewer.pl\
vieweraftertime.pl\
+PERL_WRAP_EXEC=\
+frame\
+frameaftertime\
+viewer\
+vieweraftertime
+
+SETUID=\
+frame\
+frameaftertime\
+viewer\
+vieweraftertime
+
EXEC=\
frame.pl\
frameaftertime.pl\
vieweraftertime.pl
BIN=\
-$(EXEC)
+$(EXEC)\
+$(PERL_WRAP_EXEC)
+
LIB=\
mscha_lib.pm
DIR=\
+$(LOG_PATH)\
$(BIN_PATH)\
$(LIB_PATH)\
$(WWW_PATH)
-all: exec $(TO_GENERATE)
+all: setuid exec $(TO_GENERATE)
install: cp_bin cp_lib cp_conf cp_www
$(TO_GENERATE): $(GENERATE_FROM) $(CONFIGFILE) configure.pl
$(CONFIGURE_CMD) --v --in $(GENERATE_FROM) --out $(TO_GENERATE)
+$(PERL_WRAP_EXEC): %: exec/exec.c exec/settings.txt configure.pl
+ $(PERL) configure.pl --do path=$(BIN_PATH) target=$*.pl io_path=$(LOG_PATH) stderr=$*-stderr.log exec/settings.txt --in exec/exec.c --out $*.c
+ $(CC) $(CF) -o $@ $*.c
+
+exec: $(EXEC)
+ $(CHMOD) +x $(EXEC)
+
+setuid: $(SETUID)
+ $(CHMOD) u+s,g+s $(SETUID)
+
mktree:
$(MKDIR) -p $(DIR)
cp_www_data:
$(CP) -p -r www-data/* $(WWW_PATH)
-exec: $(EXEC)
- $(CHMOD) +x $(EXEC)
clean:
- $(RM) -f configure.pl $(TO_GENERATE)
+ $(RM) -f configure.pl $(TO_GENERATE) $(PERL_WRAP_EXEC) $(PERL_WRAP_EXEC:=.c)
$(PERL) config/configure.1.pl --do $(DEFAULT_CONFIGFILE) --in makefile.1.mak --out makefile
-PHONY: all clean cp_bin cp_conf cp_lib cp_www cp_www_data exec install install_all mktree
+PHONY: all clean cp_bin cp_conf cp_lib cp_www cp_www_data exec install install_all mktree setuid
-# 04.03.2020
# Library of functions
#
# Library of functions
#
-# Copyright (C) 2020 Balthasar Szczepański
+# Copyright (C) 2020, 2024 Balthasar Szczepański
#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
+# 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 Affero General Public License for more details.
#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
package mscha_lib;
use strict;
#use warnings
+
+use utf8;
+use Encode ('encode', 'decode');
use Exporter;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
+###PERL_EXPORT_VERSION: our $VERSION = 'x.x.x';
+@ISA = qw(Exporter);
+@EXPORT = ();
+@EXPORT_OK = (
+ 'failpage',
+ 'entityencode',
+ 'gethttpheader',
+ 'getcgi',
+ 'urldecode',
+ 'gettimeframe',
+ 'urlencode'
+ 'printframeselection',
+ 'gettatframe',
+ 'redirect'
+);
+
+###PERL_LIB: use lib /botm/lib/ottbackub/mscha
+
use constant entitycode => {
'amp' => '&',
'gt' => '>',
use constant time_data_period => '/eizm/www/time/mscha/time-data-period';
use constant tat_data => '/eizm/www/time/mscha/tat-data';
-$VERSION = 0.000001;
-@ISA = qw(Exporter);
-@EXPORT = ();
-@EXPORT_OK = qw(failpage entityencode gethttpheader getcgi urldecode gettimeframe urlencode printframeselection gettatframe redirect);
-%EXPORT_TAGS = ();
# Function to show an error page
# arguments: 1 - header fields, 2 - page title, 3 - error message, 4 method
cgi_path : /mschatest
conf_path: /botm/etc/www/conf/1190
lib_path : /botm/lib/test-ottbackup/mscha
+log_path : /botm/log/test-ottbackup/mscha
www_path : /botm/www/1190/mschatest
mkdir: /usr/bin/mkdir
perl : /usr/bin/perl
rm : /usr/bin/rm
+
+oldlogs: /botm/bin/oldlogs/oldlogs.pl
+
+CC: /usr/bin/gcc
+CF: -g -Wall
+
+
+log_size_limit: 65536
+logs_uncompressed: 2
+logs_total: 10
+oldlogs_schedule: #0 3 * * *
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-_bin_path = @_PATH($bin_path, )
-_bin_frame_path = @_PATH($bin_path, frame.pl )
-_bin_tat_frame_path = @_PATH($bin_path, frameaftertime.pl )
-_bin_tat_view_path = @_PATH($bin_path, vieweraftertime.pl)
-_bin_view_path = @_PATH($bin_path, viewer.pl )
+_version: 1.1.0
+
+_SHEBANG: #!$0
+
+_PERL_STR: '@_ESCAPE($0,')'
+_PERL_USE_2: use $0 $1;
+_PERL_CONSTANT: use constant $0 => $1;
+_PERL_CONSTANT_STR: @_PERL_CONSTANT($0,@_PERL_STR($1))
+_PERL_OUR: our $0 = $1;
+_PERL_OUR_STR: @_PERL_OUR(\$$0,@_PERL_STR($1))
+
+_bin_path = @_PATH($bin_path, )
+_bin_frame_path = @_PATH($bin_path, frame )
+_bin_tat_frame_path = @_PATH($bin_path, frameaftertime )
+_bin_tat_view_path = @_PATH($bin_path, vieweraftertime)
+_bin_view_path = @_PATH($bin_path, viewer )
_cgi_path = @_PATH($cgi_path, )
_cgi_frame_path = @_PATH($cgi_path, frame )
_conf_path = @_PATH($conf_path, $name\.conf)
_lib_path = @_PATH($lib_path,)
+_log_path = @_PATH($log_path,)
_www_path = @_PATH($www_path,)
CONF_CGI_VIEW = $_cgi_view_path
CONF_CGI_VIEW_2 = $_cgi_view_2_path
-
-
-
-
-
MAKE_TARGET = TARGET = $target
MAKE_CHMOD = CHMOD = $chmod
MAKE_PERL = PERL = $perl
MAKE_RM = RM = $rm
+MAKE_CC = CC =$CC
+MAKE_CF = CF =$CF
+
+MAKE_CONF = CONF = $_conf_path
+
MAKE_BIN_PATH = BIN_PATH = $_bin_path
MAKE_LIB_PATH = LIB_PATH = $_lib_path
+MAKE_LOG_PATH = LOG_PATH = $_log_path
MAKE_WWW_PATH = WWW_PATH = $_www_path
-MAKE_CONF = CONF = $_conf_path
+
+PERL_LIB = @_PERL_USE_2(lib, @_PERL_STR($lib_path))
+
+PERL_SET_PATH = \$ENV{'PATH'} = @_PERL_STR($path);
+
+PERL_EXPORT_VERSION = @_PERL_OUR_STR( VERSION, $_version)
+
+# PERL_PATH_SEPARATOR = @_PERL_CONSTANT_STR( PATH_SEPARATOR, $_PATH_SEPARATOR)
\ No newline at end of file