rpms/crossfire/F-7 crossfire-1.10.0-log-login.patch, NONE, 1.1 crossfire-1.9.1-logtimestamp.patch, NONE, 1.1 logwatch.logconf.crossfire, NONE, 1.1 logwatch.script.crossfire, NONE, 1.1 logwatch.serviceconf.crossfire, NONE, 1.1 .cvsignore, 1.3, 1.4 crossfire.spec, 1.4, 1.5 crossfire.te, 1.1, 1.2 sources, 1.3, 1.4

Michael Thomas (wart) fedora-extras-commits at redhat.com
Fri Jul 20 01:43:00 UTC 2007


Author: wart

Update of /cvs/extras/rpms/crossfire/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv17405

Modified Files:
	.cvsignore crossfire.spec crossfire.te sources 
Added Files:
	crossfire-1.10.0-log-login.patch 
	crossfire-1.9.1-logtimestamp.patch logwatch.logconf.crossfire 
	logwatch.script.crossfire logwatch.serviceconf.crossfire 
Log Message:
Update to 1.10.0
Add -logwatch subpackage.
Update selinux policy



crossfire-1.10.0-log-login.patch:

--- NEW FILE crossfire-1.10.0-log-login.patch ---
--- server/login.c.orig	2007-05-22 20:38:19.000000000 -0700
+++ server/login.c	2007-05-22 20:37:36.000000000 -0700
@@ -504,6 +504,8 @@
      */
     if ((fp=open_and_uncompress(filename,1,&comp)) == NULL) {
 	confirm_password(op);
+	LOG(llevInfo,"LOGIN: New player named %s from ip %s\n", op->name,
+	    pl->socket.host);
 	return;
     }
     if (fstat(fileno(fp), &statbuf)) {
@@ -705,6 +707,8 @@
     /* make sure he's a player--needed because of class change. */
     op->type = PLAYER;
 
+    LOG(llevInfo,"LOGIN: Player named %s from ip %s\n", op->name,
+        pl->socket.host);
     enter_exit(op,NULL);
 
     pl->name_changed=1;

crossfire-1.9.1-logtimestamp.patch:

--- NEW FILE crossfire-1.9.1-logtimestamp.patch ---
--- common/logger.c.orig	2007-02-23 15:48:18.000000000 -0800
+++ common/logger.c	2007-02-23 21:28:46.000000000 -0800
@@ -30,6 +30,7 @@
 #include <stdarg.h>
 #include <global.h>
 #include <funcpoint.h>
+#include <time.h>
 
 /*
  * Logs a message to stderr, or to file, and/or even to socket.
@@ -49,6 +50,18 @@
 		     * than any other buffer, since that buffer may
 		     * need to be put in this one.
 		     */
+  char time_buf[2048];
+  time_t now = time((time_t *)NULL);
+  struct tm *time_tmp;
+
+  now = time(NULL);
+  time_tmp = localtime(&now);
+  if (time_tmp == NULL) {
+      perror("localtime");
+  }
+  if (strftime(time_buf, sizeof(time_buf), "%m/%d/%y %H:%M:%S", time_tmp) == 0) {
+      fprintf(stderr, "strftime returned 0");
+  }
 
   va_list ap;
   va_start(ap, format);
@@ -68,8 +81,11 @@
     fputs(buf, stderr); 
   }
 #else
+    fputs(time_buf, logfile);
+    fputs(" ", logfile);
     fputs(loglevel_names[logLevel], logfile);
     fputs(buf, logfile);
+    fflush(logfile);
 #endif
   }
   if (!exiting && !trying_emergency_save &&


--- NEW FILE logwatch.logconf.crossfire ---
##########################################################################
##########################################################################

# What actual file?  Defaults to LogPath if not absolute path....
LogFile = /var/log/crossfire/crossfire.log

# Search the rotated log files
Archive = /var/log/crossfire/crossfire.log.*

# Keep only the lines in the proper date range...
*ApplyUsDate

# vi: shiftwidth=3 tabstop=3 et


--- NEW FILE logwatch.script.crossfire ---
##########################################################################
##########################################################################

use strict;

my ($junk, $Msg, $total);
my %Action = ();
my %Start = ();
my %Login = ();
my %TakeChar = ();
my %DropChar = ();
my %Logout = ();

my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;

# Interesting events:
# 05/22/07 20:46:47 [Info]    LOGIN: New player named wart from ip 192.168.1.7
# 05/22/07 21:01:12 [Info]    LOGIN: Player named wart from ip 192.168.1.7
# 05/22/07 21:00:34 [Info]    LOGOUT: Player named wart from ip 192.168.1.7


while (defined(my $ThisLine = <STDIN>)) {
   chomp($ThisLine);
   if ( ($Msg) = ($ThisLine =~ /LOGIN: (.*)$/)) {
      $Login{$Msg}++;
   }
   if ( ($Msg) = ($ThisLine =~ /LOGOUT: (.*)$/)) {
      $Logout{$Msg}++;
   }
}

if (keys %Login) {
   if ($Detail >= 5) {
      foreach my $Msg (sort keys %Login) {
         if ($Login{$Msg} > 1) {
            print "$Msg ($Login{$Msg} times)\n"
         } else {
            print "$Msg\n"
         }
      }
   } else {
      my $total;
      foreach my $Msg (sort keys %Login) {
         $total += $Login{$Msg};
      }
      print "$total Users logged in\n";
   }
}

if (keys %Logout) {
   if ($Detail >= 5) {
      foreach my $Msg (sort keys %Logout) {
         if ($Logout{$Msg} > 1) {
            print "$Msg ($Logout{$Msg} times)\n"
         } else {
            print "$Msg\n"
         }
      }
   } else {
      my $total;
      foreach my $Msg (sort keys %Logout) {
         $total += $Logout{$Msg};
      }
      print "$total players logged out\n";
   }
}

exit(0);

# vi: shiftwidth=3 tabstop=3 syntax=perl et



--- NEW FILE logwatch.serviceconf.crossfire ---
###########################################################################
###########################################################################

# You can put comments anywhere you want to.  They are effective for the
# rest of the line.

# this is in the format of <name> = <value>.  Whitespace at the beginning
# and end of the lines is removed.  Whitespace before and after the = sign
# is removed.  Everything is case *insensitive*.

# Yes = True  = On  = 1
# No  = False = Off = 0

Title = "Crossfire"

# Which logfile group...
LogFile = crossfire

# vi: shiftwidth=3 tabstop=3 et


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/crossfire/F-7/.cvsignore,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- .cvsignore	9 Jul 2006 21:14:18 -0000	1.3
+++ .cvsignore	20 Jul 2007 01:42:27 -0000	1.4
@@ -1,2 +1 @@
-crossfire-1.9.1.tar.gz
-crossfire-1.9.1.arch.tar.gz
+crossfire-1.10.0.tar.gz


Index: crossfire.spec
===================================================================
RCS file: /cvs/extras/rpms/crossfire/F-7/crossfire.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- crossfire.spec	14 Dec 2006 18:41:36 -0000	1.4
+++ crossfire.spec	20 Jul 2007 01:42:27 -0000	1.5
@@ -1,22 +1,30 @@
 %define selinux_variants mls strict targeted
 %define selinux_policyver %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp) 
 
+%define logwatch_root %{_datadir}/logwatch
+%define logwatch_conf %{logwatch_root}/dist.conf
+%define logwatch_scripts %{logwatch_root}/scripts
+
 Name: crossfire
-Version: 1.9.1
-Release: 3%{?dist}
+Version: 1.10.0
+Release: 1%{?dist}
 Summary: Server for hosting crossfire games
 Group: Amusements/Games
 License: GPL
 URL: http://crossfire.real-time.com
-Source0: http://dl.sourceforge.net/crossfire/%{name}-%{version}.tar.gz
-Source1: http://dl.sourceforge.net/crossfire/%{name}-%{version}.arch.tar.gz
+Source0: http://downloads.sourceforge.net/crossfire/%{name}-%{version}.tar.gz
+Source1: http://downloads.sourceforge.net/crossfire/%{name}-%{version}.arch.tar.gz
 Source2: crossfire.init
 Source3: crossfire.sysconfig
 Source4: crossfire.logrotate
 Source5: crossfire.te
 Source6: crossfire.fc
 Source7: crossfire.if
-Patch0:  crossfire-1.9.1-autoconf.patch
+Source8: logwatch.logconf.crossfire
+Source9: logwatch.script.crossfire
+Source10: logwatch.serviceconf.crossfire
+Patch0:  crossfire-1.9.1-logtimestamp.patch
+Patch1:  crossfire-1.10.0-log-login.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires:       crossfire-maps
 BuildRequires:  checkpolicy selinux-policy-devel hardlink
@@ -24,9 +32,7 @@
 BuildRequires:  libXext-devel
 BuildRequires:  libXaw-devel
 BuildRequires:  python-devel
-%if "%{selinux_policyver}" != ""
-Requires:       selinux-policy >= %{selinux_policyver}
-%endif
+Requires: %{name}-plugins
 
 Requires(post): /sbin/chkconfig
 Requires(post): /sbin/service
@@ -68,7 +74,6 @@
 %package client-images
 Summary: Image cache for crossfire clients
 Group: Amusements/Games
-# crossfire-client provides a directory needed by the images.
 # No version dependency for the client since the images are pretty
 # ignorant of the client version.
 Requires: crossfire-client
@@ -80,16 +85,27 @@
 Summary: SELinux policy files for crossfire
 Group: Amusements/Games
 Requires: %{name} = %{version}-%{release}
+%if "%{selinux_policyver}" != ""
+Requires:       selinux-policy >= %{selinux_policyver}
+%endif
 Requires(post):         /usr/sbin/semodule /usr/sbin/semanage /sbin/fixfiles
-Requires(preun):        /sbin/service /usr/sbin/semodule /usr/sbin/semanage /sbin/fixfiles /usr/sbin/setsebool
+Requires(preun):        /sbin/service /usr/sbin/semodule /usr/sbin/semanage /sbin/fixfiles
 Requires(postun):       /usr/sbin/semodule
 %description selinux
 selinux policy files for the Crossfire game server
 
+%package logwatch
+Summary: logwatch scripts for the Crossfire game server
+Group: Amusements/Games
+Requires: %{name} = %{version}-%{release} logwatch
+%description logwatch
+logwatch scripts for the Crossfire game server
+
 %prep
 %setup -q
 %setup -q -a 1
 %patch0 -p0
+%patch1 -p0
 mkdir SELinux
 cp  %{SOURCE5} %{SOURCE6} %{SOURCE7} SELinux
 
@@ -132,10 +148,10 @@
 make DESTDIR=$RPM_BUILD_ROOT install
 
 # Install the client images
-mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name}/%{name}-client
-tar xf %{name}-images.tar -C $RPM_BUILD_ROOT/%{_datadir}/%{name}/%{name}-client
+mkdir -p $RPM_BUILD_ROOT/%{_datadir}/%{name}-client
+tar xf %{name}-images.tar -C $RPM_BUILD_ROOT/%{_datadir}/%{name}-client
 # Nuke the installation instructions for the image archive.
-rm $RPM_BUILD_ROOT/%{_datadir}/%{name}/%{name}-client/README
+rm $RPM_BUILD_ROOT/%{_datadir}/%{name}-client/README
 
 install -pD -m 0755 %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/crossfire
 
@@ -185,13 +201,18 @@
 pushd SELinux
 for variant in %{selinux_variants}
 do
-    install -d %{buildroot}%{_datadir}/selinux/${variant}
+    install -d $RPM_BUILD_ROOT%{_datadir}/selinux/${variant}
     install -p -m 644 %{name}.pp.${variant} \
-           %{buildroot}%{_datadir}/selinux/${variant}/%{name}.pp
+           $RPM_BUILD_ROOT%{_datadir}/selinux/${variant}/%{name}.pp
 done
 popd
 # Hardlink identical policy module packages together
-/usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux
+/usr/sbin/hardlink -cv $RPM_BUILD_ROOT%{_datadir}/selinux
+
+# Install logwatch files
+install -pD -m 0644 %{SOURCE8} $RPM_BUILD_ROOT%{logwatch_conf}/logfiles/%{name}.conf
+install -pD -m 0755 %{SOURCE9} $RPM_BUILD_ROOT%{logwatch_scripts}/services/%{name}
+install -pD -m 0644 %{SOURCE10} $RPM_BUILD_ROOT%{logwatch_conf}/services/%{name}.conf
 
 
 %pre
@@ -212,7 +233,7 @@
   /usr/sbin/semodule -s ${selinuxvariant} -i \
     %{_datadir}/selinux/${selinuxvariant}/%{name}.pp &> /dev/null || :
 done
-/usr/sbin/semanage port -a -t %{name}_port_t -p tcp 13327 || :
+/usr/sbin/semanage port -a -t %{name}_port_t -p tcp 13327 > /dev/null 2>&1 || :
 /sbin/fixfiles -R %{name} restore || :
 /sbin/service %{name} condrestart > /dev/null 2>&1 || :
 
@@ -225,10 +246,9 @@
 %preun selinux
 if [ "$1" -lt "1" ] ; then
     # Disable the policy and restart the daemon
-    /usr/sbin/setsebool %{name}_disable_trans 1
     /sbin/service %{name} condrestart > /dev/null 2>&1 || :
     # Unload the module
-    /usr/sbin/semanage port -d -t %{name}_port_t -p tcp 13327 || :
+    /usr/sbin/semanage port -d -t %{name}_port_t -p tcp 13327 >/dev/null 2>&1 || :
     for variant in %{selinux_variants} ; do
         /usr/sbin/semodule -s ${variant} -r %{name} &> /dev/null || :
     done
@@ -263,7 +283,6 @@
 %{_bindir}/crossloop
 %{_bindir}/cross_random_map
 %{_datadir}/%{name}
-%exclude %{_datadir}/%{name}/%{name}-client
 %dir %{_libdir}/%{name}
 %dir %{_sysconfdir}/%{name}
 %config(noreplace) %{_sysconfdir}/%{name}/ban_file
@@ -298,15 +317,28 @@
 
 %files client-images
 %defattr(-,root,root,-)
-%{_datadir}/%{name}/%{name}-client
+%{_datadir}/%{name}-client
 
 %files selinux
 %defattr(-,root,root,-)
 %doc SELinux/*.??
 %{_datadir}/selinux/*/%{name}.pp
 
+%files logwatch
+%defattr(-,root,root,-)
+%{logwatch_conf}/logfiles/%{name}.conf
+%{logwatch_conf}/services/%{name}.conf
+%{logwatch_scripts}/services/%{name}
+
 
 %changelog
+* Thu Jul 12 2007 Wart <wart at kobold.org> 1.10.0-1
+- Update to 1.10.0
+- Move client images outside of the server data directory.
+- Update selinux policy
+- Drop patch that was accepted upstream
+- Add logwatch subpackage
+
 * Fri Dec 8 2006 Wart <wart at kobold.org> 1.9.1-3
 - Rebuild for new python 2.5
 


Index: crossfire.te
===================================================================
RCS file: /cvs/extras/rpms/crossfire/F-7/crossfire.te,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- crossfire.te	31 Aug 2006 15:13:57 -0000	1.1
+++ crossfire.te	20 Jul 2007 01:42:27 -0000	1.2
@@ -7,6 +7,7 @@
 
 gen_require(`
     type port_t;
+    type games_data_t;
     attribute port_type;
 ')
 
@@ -60,6 +61,7 @@
 
 # log files
 allow crossfire_t crossfire_var_log_t:file create_file_perms;
+allow crossfire_t crossfire_var_log_t:file append;
 allow crossfire_t crossfire_var_log_t:sock_file create_file_perms;
 allow crossfire_t crossfire_var_log_t:dir { rw_dir_perms setattr };
 logging_log_filetrans(crossfire_t,crossfire_var_log_t,{ sock_file file dir })
@@ -88,8 +90,10 @@
 
 
 # Game data files
-allow crossfire_t crossfire_variable_data_t:file { create_file_perms };
-allow crossfire_t crossfire_variable_data_t:dir { create_dir_perms };
+allow crossfire_t crossfire_variable_data_t:file { manage_file_perms };
+allow crossfire_t crossfire_variable_data_t:dir { manage_dir_perms };
+allow crossfire_t games_data_t:dir search;
+allow crossfire_t games_data_t:dir getattr;
 
 # Misc rules that are needed.  I don't understand the meaning of some
 # of these, and for others I don't yet understand why the game needs
@@ -100,3 +104,4 @@
 kernel_read_kernel_sysctls(crossfire_t)
 term_dontaudit_use_generic_ptys(crossfire_t)
 kernel_read_system_state(crossfire_t)
+allow crossfire_t tmp_t:dir getattr;


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/crossfire/F-7/sources,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sources	9 Jul 2006 21:14:18 -0000	1.3
+++ sources	20 Jul 2007 01:42:27 -0000	1.4
@@ -1,2 +1 @@
-9444daefe1a457b4a18101c255be6cdc  crossfire-1.9.1.tar.gz
-83dfd11c565a76ea05e6be999862796d  crossfire-1.9.1.arch.tar.gz
+d56ad6cac04ea49f8b6b326b441553a3  crossfire-1.10.0.tar.gz




More information about the scm-commits mailing list