This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.69 for maacom.pl 0.01.
|
# Generated by GNU Autoconf 2.69 for maacom.pl 0.02.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
||||||
@@ -576,8 +576,8 @@ MAKEFLAGS=
|
|||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='maacom.pl'
|
PACKAGE_NAME='maacom.pl'
|
||||||
PACKAGE_TARNAME='maacom-pl'
|
PACKAGE_TARNAME='maacom-pl'
|
||||||
PACKAGE_VERSION='0.01'
|
PACKAGE_VERSION='0.02'
|
||||||
PACKAGE_STRING='maacom.pl 0.01'
|
PACKAGE_STRING='maacom.pl 0.02'
|
||||||
PACKAGE_BUGREPORT=''
|
PACKAGE_BUGREPORT=''
|
||||||
PACKAGE_URL=''
|
PACKAGE_URL=''
|
||||||
|
|
||||||
@@ -1234,7 +1234,7 @@ if test "$ac_init_help" = "long"; then
|
|||||||
# Omit some internal or obsolete options to make the list less imposing.
|
# Omit some internal or obsolete options to make the list less imposing.
|
||||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures maacom.pl 0.01 to adapt to many kinds of systems.
|
\`configure' configures maacom.pl 0.02 to adapt to many kinds of systems.
|
||||||
|
|
||||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
@@ -1304,7 +1304,7 @@ fi
|
|||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
case $ac_init_help in
|
case $ac_init_help in
|
||||||
short | recursive ) echo "Configuration of maacom.pl 0.01:";;
|
short | recursive ) echo "Configuration of maacom.pl 0.02:";;
|
||||||
esac
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
@@ -1392,7 +1392,7 @@ fi
|
|||||||
test -n "$ac_init_help" && exit $ac_status
|
test -n "$ac_init_help" && exit $ac_status
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
maacom.pl configure 0.01
|
maacom.pl configure 0.02
|
||||||
generated by GNU Autoconf 2.69
|
generated by GNU Autoconf 2.69
|
||||||
|
|
||||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||||
@@ -1409,7 +1409,7 @@ cat >config.log <<_ACEOF
|
|||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by maacom.pl $as_me 0.01, which was
|
It was created by maacom.pl $as_me 0.02, which was
|
||||||
generated by GNU Autoconf 2.69. Invocation command line was
|
generated by GNU Autoconf 2.69. Invocation command line was
|
||||||
|
|
||||||
$ $0 $@
|
$ $0 $@
|
||||||
@@ -2272,7 +2272,7 @@ fi
|
|||||||
|
|
||||||
# Define the identity of the package.
|
# Define the identity of the package.
|
||||||
PACKAGE='maacom-pl'
|
PACKAGE='maacom-pl'
|
||||||
VERSION='0.01'
|
VERSION='0.02'
|
||||||
|
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
@@ -3455,7 +3455,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
|||||||
# report actual input values of CONFIG_FILES etc. instead of their
|
# report actual input values of CONFIG_FILES etc. instead of their
|
||||||
# values after options handling.
|
# values after options handling.
|
||||||
ac_log="
|
ac_log="
|
||||||
This file was extended by maacom.pl $as_me 0.01, which was
|
This file was extended by maacom.pl $as_me 0.02, which was
|
||||||
generated by GNU Autoconf 2.69. Invocation command line was
|
generated by GNU Autoconf 2.69. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
@@ -3508,7 +3508,7 @@ _ACEOF
|
|||||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
maacom.pl config.status 0.01
|
maacom.pl config.status 0.02
|
||||||
configured by $0, generated by GNU Autoconf 2.69,
|
configured by $0, generated by GNU Autoconf 2.69,
|
||||||
with options \\"\$ac_cs_config\\"
|
with options \\"\$ac_cs_config\\"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
AC_INIT(maacom.pl,0.01)
|
AC_INIT(maacom.pl,0.02)
|
||||||
AM_INIT_AUTOMAKE
|
AM_INIT_AUTOMAKE
|
||||||
AC_PREFIX_DEFAULT(/usr/local)
|
AC_PREFIX_DEFAULT(/usr/local)
|
||||||
|
|
||||||
|
|||||||
@@ -707,9 +707,6 @@ sub trusted_delete {
|
|||||||
$id;
|
$id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
#--------------
|
#--------------
|
||||||
@@ -725,19 +722,32 @@ use Cwd qw(cwd getcwd chdir);
|
|||||||
use Mojo::Util qw(dumper);
|
use Mojo::Util qw(dumper);
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my $class = shift;
|
my ($class, $user, $group) = @_;
|
||||||
my $self = {};
|
my $self = {
|
||||||
|
user => $user,
|
||||||
|
group => $group
|
||||||
|
};
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub fork {
|
sub fork {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my $pid = fork;
|
my $pid = fork;
|
||||||
if ($pid > 0) {
|
if ($pid > 0) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
chdir("/");
|
chdir("/");
|
||||||
|
|
||||||
|
my $uid = getpwnam($self->{user}) if $self->{user};
|
||||||
|
my $gid = getgrnam($self->{group}) if $self->{group};
|
||||||
|
|
||||||
|
print $uid, $gid,"\n";
|
||||||
|
|
||||||
|
setuid($uid) if $uid;
|
||||||
|
setgid($gid) if $gid;
|
||||||
|
|
||||||
open(my $stdout, '>&', STDOUT);
|
open(my $stdout, '>&', STDOUT);
|
||||||
open(my $stderr, '>&', STDERR);
|
open(my $stderr, '>&', STDERR);
|
||||||
open(STDOUT, '>>', '/dev/null');
|
open(STDOUT, '>>', '/dev/null');
|
||||||
@@ -1169,6 +1179,9 @@ $app->config(dblogin => '');
|
|||||||
$app->config(dbpassword => '');
|
$app->config(dbpassword => '');
|
||||||
$app->config(dbengine => 'sqlite3');
|
$app->config(dbengine => 'sqlite3');
|
||||||
|
|
||||||
|
$app->config(group => '@app_group@');
|
||||||
|
$app->config(user => '@app_user@');
|
||||||
|
|
||||||
if (-r $app->config('conffile')) {
|
if (-r $app->config('conffile')) {
|
||||||
$app->log->debug("Load configuration from ".$app->config('conffile'));
|
$app->log->debug("Load configuration from ".$app->config('conffile'));
|
||||||
# $app->plugin('JSONConfig', { file => $app->config('conffile') });
|
# $app->plugin('JSONConfig', { file => $app->config('conffile') });
|
||||||
@@ -1317,8 +1330,6 @@ $server->listen(\@listen);
|
|||||||
$server->heartbeat_interval(3);
|
$server->heartbeat_interval(3);
|
||||||
$server->heartbeat_timeout(60);
|
$server->heartbeat_timeout(60);
|
||||||
|
|
||||||
my $d = Daemon->new;
|
|
||||||
$d->fork;
|
|
||||||
|
|
||||||
$server->pid_file($app->config('pidfile'));
|
$server->pid_file($app->config('pidfile'));
|
||||||
|
|
||||||
@@ -1327,6 +1338,14 @@ $app->log(Mojo::Log->new(
|
|||||||
level => $app->config('loglevel')
|
level => $app->config('loglevel')
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
my $user = $app->config('user');
|
||||||
|
my $group = $app->config('group');
|
||||||
|
my $d = Daemon->new($user, $group);
|
||||||
|
$d->fork;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->hook(before_dispatch => sub {
|
$app->hook(before_dispatch => sub {
|
||||||
my $c = shift;
|
my $c = shift;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ CREATE TABLE forwarded (
|
|||||||
id int unique NOT NULL PRIMARY KEY,
|
id int unique NOT NULL PRIMARY KEY,
|
||||||
name text unique
|
name text unique
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE unwanted (
|
CREATE TABLE unwanted (
|
||||||
id int unique NOT NULL PRIMARY KEY,
|
id int unique NOT NULL PRIMARY KEY,
|
||||||
name text unique
|
name text unique
|
||||||
@@ -33,6 +32,4 @@ CREATE TABLE trusted (
|
|||||||
id int unique NOT NULL PRIMARY KEY,
|
id int unique NOT NULL PRIMARY KEY,
|
||||||
name text unique
|
name text unique
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|||||||
-2669
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user