Permalink
Browse files

Many bugfixes and improuvments. See NEWS for details.

  • Loading branch information...
mclight77
mclight77 committed May 4, 2009
1 parent 42cc887 commit 6e110749d09c76e890fb5e6eca5060eb452899ea
View
@@ -2,7 +2,7 @@
# have all needed files, that a GNU package needs
AUTOMAKE_OPTIONS = foreign 1.4
SUBDIRS = src php doc plugins/loadavg
SUBDIRS = src php doc plugins/loadavg plugins/fsusage
bin_SCRIPTS = scripts/sams_send_email
EXTRA_DIST = Makefile.cvs doc php etc spec debian redhat scripts
View
10 NEWS
@@ -88,3 +88,13 @@
Оптимизирован поиск пользователей. Отключен кеш DNS ответов (необходимо использование TTL ответов)
090429
Немного подправлено построение rpm пакетов.
090502
Исправлено отображение статуса пользователя и ограничение трафика в веб интерфейсе.
При удалении временного интервала в шаблоне теперь не переходит на редактирование другого шаблона.
Правильно устанавливается значение "Запрет доступа ко всем url" при редактировании шаблона.
090503
Период лимита шаблона 1 день.
Правильно устанавливается значение уровня отладочных сообщений при редактировании прокси.
Добавлено управление системными плагинами. Чтобы заработало, необходимо модифицировать БД.
TRUNCATE TABLE sysinfo;
ALTER TABLE sysinfo ADD s_row_id SERIAL PRIMARY KEY FIRST;
View
@@ -3,6 +3,8 @@ AM_INIT_AUTOMAKE(sams2, 2.0.0)
AC_CONFIG_SRCDIR([src/tools.h])
AC_CONFIG_HEADER([src/config.h])
AC_GNU_SOURCE
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
@@ -13,6 +15,7 @@ AC_PROG_MAKE_SET
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
# Checks for header files.
AC_HEADER_DIRENT
AC_CHECK_HEADERS([arpa/inet.h netdb.h syslog.h unistd.h])
@@ -34,6 +37,10 @@ AC_FUNC_MKTIME
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([inet_ntoa memset strerror])
gl_READUTMP
gl_SYS_PROC_UPTIME
gl_GETLOADAVG([plugins/loadavg])
# SCO-ODT-3.0 is reported to need -lufc for crypt.
# NetBSD needs -lcrypt for crypt.
# Uncomment this, if function CryptPassword is used
@@ -71,7 +78,7 @@ if test "$lt_cv_dlopen" = "dlopen"; then
fi
fi
AC_CONFIG_FILES([Makefile src/Makefile php/Makefile doc/Makefile plugins/loadavg/Makefile])
AC_CONFIG_FILES([Makefile src/Makefile php/Makefile doc/Makefile plugins/loadavg/Makefile plugins/fsusage/Makefile])
AC_OUTPUT
eval path_sysconfdir=$sysconfdir
View
@@ -4,3 +4,7 @@ m4_include([m4/unixodbc.m4])
m4_include([m4/pq.m4])
m4_include([m4/pcre.m4])
m4_include([m4/srcdocs.m4])
m4_include([m4/free.m4])
m4_include([m4/readutmp.m4])
m4_include([m4/uptime.m4])
m4_include([m4/getloadavg.m4])
View
@@ -0,0 +1,40 @@
# Check whether free (NULL) is supposed to work.
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# Written by Paul Eggert.
# We can't test for free (NULL) even at runtime, since it might
# happen to "work" for our test program, but not in general. So, be
# conservative and use feature tests for relatively modern hosts,
# where free (NULL) is known to work. This costs a bit of
# performance on some older hosts, but we can fix that later if
# needed.
AC_DEFUN([gl_FUNC_FREE],
[
AC_CACHE_CHECK([whether free (NULL) is known to work],
[gl_cv_func_free],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[@%:@include <unistd.h>]],
[[@%:@if _POSIX_VERSION < 199009L && \
(defined unix || defined _unix || defined _unix_ \
|| defined __unix || defined __unix__)
@%:@error "'free (NULL)' is not known to work"
@%:@endif]])],
[gl_cv_func_free=yes],
[gl_cv_func_free=no])])
if test $gl_cv_func_free = no; then
AC_LIBOBJ(free)
AC_DEFINE(free, rpl_free,
[Define to rpl_free if the replacement function should be used.])
fi
])
# Prerequisites of lib/free.c.
AC_DEFUN([gl_PREREQ_FREE], [:])
View
@@ -0,0 +1,155 @@
# Check for getloadavg.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003,
# 2006 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
# New applications should use gl_GETLOADAVG instead.
# gl_GETLOADAVG(LIBOBJDIR)
# ------------------------
AC_DEFUN([gl_GETLOADAVG],
[gl_have_func=no # yes means we've found a way to get the load average.
# Make sure getloadavg.c is where it belongs, at configure-time.
test -f "$srcdir/$1/getloadavg.c" ||
AC_MSG_ERROR([$srcdir/$1/getloadavg.c is missing])
gl_save_LIBS=$LIBS
# Check for getloadavg, but be sure not to touch the cache variable.
(AC_CHECK_FUNC(getloadavg, exit 0, exit 1)) && gl_have_func=yes
# On HPUX9, an unprivileged user can get load averages through this function.
AC_CHECK_FUNCS(pstat_getdynamic)
# Solaris has libkstat which does not require root.
AC_CHECK_LIB(kstat, kstat_open)
test $ac_cv_lib_kstat_kstat_open = yes && gl_have_func=yes
# Some systems with -lutil have (and need) -lkvm as well, some do not.
# On Solaris, -lkvm requires nlist from -lelf, so check that first
# to get the right answer into the cache.
# For kstat on solaris, we need libelf to force the definition of SVR4 below.
if test $gl_have_func = no; then
AC_CHECK_LIB(elf, elf_begin, LIBS="-lelf $LIBS")
fi
if test $gl_have_func = no; then
AC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS")
# Check for the 4.4BSD definition of getloadavg.
AC_CHECK_LIB(util, getloadavg,
[LIBS="-lutil $LIBS" gl_have_func=yes gl_cv_func_getloadavg_setgid=yes])
fi
if test $gl_have_func = no; then
# There is a commonly available library for RS/6000 AIX.
# Since it is not a standard part of AIX, it might be installed locally.
gl_getloadavg_LIBS=$LIBS
LIBS="-L/usr/local/lib $LIBS"
AC_CHECK_LIB(getloadavg, getloadavg,
[LIBS="-lgetloadavg $LIBS"], [LIBS=$gl_getloadavg_LIBS])
fi
# Make sure it is really in the library, if we think we found it,
# otherwise set up the replacement function.
AC_CHECK_FUNCS(getloadavg, [],
[gl_PREREQ_GETLOADAVG])
# Some definitions of getloadavg require that the program be installed setgid.
AC_CACHE_CHECK(whether getloadavg requires setgid,
gl_cv_func_getloadavg_setgid,
[AC_EGREP_CPP([Yowza Am I SETGID yet],
[#define CONFIGURING_GETLOADAVG
#include "$srcdir/$1/getloadavg.c"
#ifdef LDAV_PRIVILEGED
Yowza Am I SETGID yet
#endif
],
gl_cv_func_getloadavg_setgid=yes,
gl_cv_func_getloadavg_setgid=no)])
if test $gl_cv_func_getloadavg_setgid = yes; then
NEED_SETGID=true
AC_DEFINE(GETLOADAVG_PRIVILEGED, 1,
[Define to 1 if the `getloadavg' function needs to be run setuid
or setgid.])
else
NEED_SETGID=false
fi
AC_SUBST(NEED_SETGID)dnl
if test $gl_cv_func_getloadavg_setgid = yes; then
AC_CACHE_CHECK(group of /dev/kmem, gl_cv_group_kmem,
[ # On Solaris, /dev/kmem is a symlink. Get info on the real file.
ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null`
# If we got an error (system does not support symlinks), try without -L.
test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem`
gl_cv_group_kmem=`echo $ac_ls_output \
| sed -ne ['s/[ ][ ]*/ /g
s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/
/ /s/.* //;p']`
])
AC_SUBST(KMEM_GROUP, $gl_cv_group_kmem)dnl
fi
if test "x$gl_save_LIBS" = x; then
GETLOADAVG_LIBS=$LIBS
else
GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_save_LIBS!!"`
fi
LIBS=$gl_save_LIBS
AC_SUBST(GETLOADAVG_LIBS)dnl
])# gl_GETLOADAVG
# gl_PREREQ_GETLOADAVG
# --------------------
# Set up the AC_LIBOBJ replacement of `getloadavg'.
AC_DEFUN([gl_PREREQ_GETLOADAVG],
[AC_LIBOBJ(getloadavg)
AC_DEFINE(C_GETLOADAVG, 1, [Define to 1 if using `getloadavg.c'.])
# Figure out what our getloadavg.c needs.
gl_have_func=no
AC_CHECK_HEADER(sys/dg_sys_info.h,
[gl_have_func=yes
AC_DEFINE(DGUX, 1, [Define to 1 for DGUX with <sys/dg_sys_info.h>.])
AC_CHECK_LIB(dgc, dg_sys_info)])
# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
# Irix 4.0.5F has the header but not the library.
if test $gl_have_func = no && test "$ac_cv_lib_elf_elf_begin" = yes; then
gl_have_func=yes
AC_DEFINE(SVR4, 1, [Define to 1 on System V Release 4.])
fi
if test $gl_have_func = no; then
AC_CHECK_HEADER(inq_stats/cpustats.h,
[gl_have_func=yes
AC_DEFINE(UMAX, 1, [Define to 1 for Encore UMAX.])
AC_DEFINE(UMAX4_3, 1,
[Define to 1 for Encore UMAX 4.3 that has <inq_status/cpustats.h>
instead of <sys/cpustats.h>.])])
fi
if test $gl_have_func = no; then
AC_CHECK_HEADER(sys/cpustats.h,
[gl_have_func=yes; AC_DEFINE(UMAX)])
fi
if test $gl_have_func = no; then
AC_CHECK_HEADERS(mach/mach.h)
fi
AC_CHECK_HEADERS(nlist.h,
[AC_CHECK_MEMBERS([struct nlist.n_un.n_name],
[AC_DEFINE(NLIST_NAME_UNION, 1,
[Define to 1 if your `struct nlist' has an
`n_un' member. Obsolete, depend on
`HAVE_STRUCT_NLIST_N_UN_N_NAME])], [],
[@%:@include <nlist.h>])
])dnl
])# gl_PREREQ_GETLOADAVG
View
@@ -0,0 +1,62 @@
# readutmp.m4 serial 13
dnl Copyright (C) 2002-2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_READUTMP],
[
dnl Persuade utmpx.h to declare utmpxname
AC_REQUIRE([AC_GNU_SOURCE])
AC_CHECK_HEADERS(utmp.h utmpx.h)
if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
AC_LIBOBJ([readutmp])
dnl Prerequisites of lib/readutmp.h and lib/readutmp.c.
AC_REQUIRE([AC_C_INLINE])
AC_REQUIRE([gl_FUNC_FREE])
AC_CHECK_FUNCS(utmpname utmpxname)
AC_CHECK_DECLS(getutent,,,[
#ifdef HAVE_UTMP_H
# include <utmp.h>
#endif
])
utmp_includes="\
$ac_includes_default
#ifdef HAVE_UTMPX_H
# include <utmpx.h>
#endif
#ifdef HAVE_UTMP_H
# if defined _THREAD_SAFE && defined UTMP_DATA_INIT
/* When including both utmp.h and utmpx.h on AIX 4.3, with _THREAD_SAFE
defined, work around the duplicate struct utmp_data declaration. */
# define utmp_data gl_aix_4_3_workaround_utmp_data
# endif
# include <utmp.h>
#endif
"
AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmpx.ut_pid],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_pid],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmpx.ut_id],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_id],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmpx.ut_exit],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_exit],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_exit],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_exit],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_exit],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_exit.e_exit],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_termination],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_termination],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_termination],,,[$utmp_includes])
AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes])
fi
])
View
@@ -0,0 +1,23 @@
#serial 7
# Copyright (C) 1996, 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
AC_PREREQ(2.13)
AC_DEFUN([gl_SYS_PROC_UPTIME],
[ dnl Require AC_PROG_CC to see if we're cross compiling.
AC_REQUIRE([AC_PROG_CC])
AC_CACHE_CHECK([for /proc/uptime], jm_cv_have_proc_uptime,
[jm_cv_have_proc_uptime=no
test -f /proc/uptime \
&& test "$cross_compiling" = no \
&& cat < /proc/uptime >/dev/null 2>/dev/null \
&& jm_cv_have_proc_uptime=yes])
if test $jm_cv_have_proc_uptime = yes; then
AC_DEFINE(HAVE_PROC_UPTIME, 1,
[ Define if your system has the /proc/uptime special file.])
fi
])
View
@@ -518,7 +518,7 @@ function CreateSAMSdb($db, $odbc, $host, $user ,$passwd, $dbname, $create, $muse
//'0', 'Proxy server','0','http://your.ip.address/sams/icon/classic/blank.gif', 'http://your.ip.address/sams/messages', 'NONE', '0', 'ip', '/usr/bin','+', '0', '0', '0', '1', '1', '1','0', '0', 'real', '0', '0', 'workgroup', '0', 'NONE', '', '1024', '1048576')
//$pgdb[3] = "INSERT INTO proxy SET s_description='main proxy server' ";
$pgdb[3] = "INSERT INTO proxy VALUES ('0', 'Proxy server','0','http://your.ip.address/sams/icon/classic/blank.gif', 'http://your.ip.address/sams/messages', 'NONE', '0', 'ip', '/usr/bin','+', '0', '0', '0', '1', '1', '1','0', '0', 'real', '0', '0', 'workgroup', '0', 'NONE', '', '1024'
$pgdb[3] = "INSERT INTO proxy VALUES ('0', 'Proxy server','0','http://your.ip.address/sams2/icon/classic/blank.gif', 'http://your.ip.address/sams2/messages', 'NONE', '0', 'ip', '/usr/bin','+', '0', '0', '0', '1', '1', '1','0', '0', 'real', '0', '0', 'workgroup', '0', 'NONE', '', '1024'
, '1048576', '0.0.0.0', 'workgroup', 'Administrator', '0', 'Users', '0', '0', '0' ) ";
$pgdb[4] = "CREATE TABLE passwd ( s_user varchar(25) PRIMARY KEY, s_pass varchar(60), s_access int default '0', s_autherrorc smallint default '0', s_autherrort varchar(16) default '0' )";
$pgdb[5] = "INSERT INTO passwd VALUES('Admin','00YfpO1MXDzqQ','2','0','' )";
@@ -553,7 +553,7 @@ function CreateSAMSdb($db, $odbc, $host, $user ,$passwd, $dbname, $create, $muse
$pgdb[25] = "CREATE INDEX idx_squiduser on squiduser ( s_nick, s_name, s_shablon_id, s_group_id )";
$pgdb[26] = "CREATE INDEX idx_samslog on samslog ( s_code, s_issuer )";
$pgdb[27] = "CREATE INDEX idx_url on url ( s_redirect_id, s_url )";
$pgdb[28] = "CREATE TABLE sysinfo ( s_proxy_id INT NOT NULL , s_name VARCHAR( 50 ) NOT NULL , s_version VARCHAR( 10 ) NOT NULL ,
$pgdb[28] = "CREATE TABLE sysinfo ( s_row_id SERIAL PRIMARY KEY, s_proxy_id INT NOT NULL , s_name VARCHAR( 50 ) NOT NULL , s_version VARCHAR( 10 ) NOT NULL ,
s_author VARCHAR( 30 ) NULL DEFAULT 'anonymous', s_info VARCHAR( 1024 ) NOT NULL DEFAULT 'not available', s_date DATETIME NOT NULL ,
s_status INT NOT NULL)";
View
@@ -43,6 +43,6 @@ $pgdb[2] = "CREATE TABLE proxy (
s_udscript varchar(25) NOT NULL default 'NONE',
s_adminaddr varchar(60) ) ";
$pgdb[3] = "INSERT INTO proxy VALUES('1','main proxy server','0''http://your.ip.address/sams/icon/classic/blank.gif','http://your.ip.address/sams/messages','none','1','1','ip','/usr/bin','Y','+','0','0','0','1','0','','1','1','0','real','0','0','workgroup','0','NONE','')";
$pgdb[3] = "INSERT INTO proxy VALUES('1','main proxy server','0''http://your.ip.address/sams2/icon/classic/blank.gif','http://your.ip.address/sams2/messages','none','1','1','ip','/usr/bin','Y','+','0','0','0','1','0','','1','1','0','real','0','0','workgroup','0','NONE','')";
?>
?>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit 6e11074

Please sign in to comment.