Commit 6cff7ae8 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Branch for Wildfire 3.2.3 (and before project is renamed to OpenFire)

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/branches@7512 b35dd754-fafc-0310-a699-88a17e54d16e
parent bbec5255

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/plugins-dev" />
<exclude-output />
<exclude-exploded />
<content url="file://$MODULE_DIR$/src/plugins">
<sourceFolder url="file://$MODULE_DIR$/src/plugins/broadcast/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/plugins/contentFilter/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/plugins/gateway/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/plugins/gateway/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/plugins/presence/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/plugins/registration/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/plugins/search/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/plugins/userImportExport/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/plugins/userservice/src/java" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/src/plugins/enterprise" />
<excludeFolder url="file://$MODULE_DIR$/src/plugins/fastpath" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="Wildfire" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/userImportExport/lib/xsdlib.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/userImportExport/lib/msv.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/userImportExport/lib/relaxngDatatype.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/userImportExport/lib/isorelax.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module" module-name="Admin" />
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/userImportExport/lib/commons-fileupload-1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/gateway/lib/ymsg_network.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/gateway/lib/picocontainer.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/gateway/lib/ymsg_support.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/gateway/lib/irclib.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/gateway/lib/cindy.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/gateway/lib/jml.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/gateway/lib/joscar-protocol.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/gateway/lib/joscar-common.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/gateway/lib/joscar-client.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/gateway/lib/dwr.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/gateway/lib/concurrent.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/gateway/lib/jainsipri.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/gateway/lib/jakarta-regexp.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/gateway/lib/log4j.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/src/plugins/gateway/lib/jainsipapi.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntryProperties />
</component>
</module>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#
# $RCSfile$
# $Revision$
# $Date$
#
#
# Directory where the jar files will be deployed (see the deployjar task)
#
deploy.jar.dir=
#
# Directory where plugin development is done. This is assumed to be the
# root directory:
#
# /home/joeuser/java/myplugins/ <- Point to this directory
# |- fooplugin/
# |- barplugin/
#
plugin.dev.dir=
#
# Path to your Install4j installation. Typically this is c:\Program Files\install4j
# This property is set by default in the build.xml file as c:\Program Files\install4j so
# if you used the standard location you won't need to edit the property below.
#
# installer.install4j.home=
\ No newline at end of file
This diff is collapsed.
wildfire (@version@) unstable; urgency=medium
* For full changelog, see http://www.igniterealtime.org/builds/wildfire/docs/latest/changelog.html
-- Jive Software <webmaster@jivesoftware.com> @builddate@
Source: wildfire
Section: net
Priority: optional
Maintainer: Jive Software <webmaster@jivesoftware.com>
Build-Depends: debhelper (>= 5), sun-java5-jdk, ant
Standards-Version: 3.7.2
Package: wildfire
Section: net
Priority: optional
Depends: sun-java5-jdk
Architecture: all
Description: A high performance XMPP (Jabber) server.
Wildfire is an instant messaging server that implements the XMPP
(Jabber) protocol. It features high performance, a robust
administration console, and a full plugin system. The server
is 100% Java.
.
Wildfire is a professional Open Source project, led by Jive Software.
This package was debianized by Jive Software
<webmaster@jivesoftware.com> on March 12, 2007.
The source was downloaded from http://www.igniterealtime.org.
Upstream author: Jive Software <webmaster@jivesoftware.com>
This software is copyright (c) 2007 by Jive Software
You are free to distribute this software under the terms of
the GNU General Public License. On Debian systems, the complete
text of the GNU General Public License can be found in the file
'/usr/share/common-licenses/GPL'.
/var/log/wildfire
# move the
/etc/wildfire
\ No newline at end of file
#!/usr/bin/make -f
# -*- makefile -*-
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
DESTINATION=${CURDIR}/debian/wildfire/
build: build-stamp
build-stamp:
dh_testdir
dh_installdirs
ant -f build/build.xml
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp install-stamp
-ant -f build/build.xml clean
dh_clean
install: install-stamp
install-stamp:
mv $(CURDIR)/target/wildfire $(DESTINATION)/opt/
# Move the conf-dir to etc an create a symlink back.
mv ${DESTINATION}/opt/wildfire/conf ${DESTINATION}/etc/wildfire
ln -s /etc/wildfire ${DESTINATION}/opt/wildfire/conf
# Move the resource dir to etc and symlink back.
mv ${DESTINATION}/opt/wildfire/resources/security ${DESTINATION}/etc/wildfire/security
ln -s /etc/wildfire/security ${DESTINATION}/opt/wildfire/resources/security
# Move the logs dir to /var/log an symlink back.
mv ${DESTINATION}/opt/wildfire/logs ${DESTINATION}/var/log/wildfire
ln -s /var/log/wildfire ${DESTINATION}/opt/wildfire/logs
touch $@
# Build architecture-dependent files here.
binary-indep: install
dh_testdir
dh_testroot
dh_installdocs
dh_installexamples
dh_installdebconf
dh_installinit
dh_link
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep
.PHONY: build clean binary-indep binary install configure
/etc/wildfire/wildfire.xml
/etc/wildfire/security/keystore
/etc/wildfire/security/truststore
# Defaults for wildfire initscript
# sourced by /etc/init.d/wildfire
# installed at /etc/default/wildfire by the maintainer scripts
#
# This is a POSIX shell fragment
#
# Additional options that are passed to the Daemon.
DAEMON_OPTS=""
/etc/
/opt/wildfire
/var/log/wildfire
#! /bin/sh
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl
#
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/java
NAME=wildfire
DESC=wildfire
DAEMON_DIR=/opt/wildfire
DAEMON_LIB=${DAEMON_DIR}/lib
test -x $DAEMON || exit 0
# Include wildfire defaults if available
if [ -f /etc/default/wildfire ] ; then
. /etc/default/wildfire
fi
DAEMON_OPTS="-server -DwildfireHome=${DAEMON_DIR} \
-Dwildfire.lib.dir=${DAEMON_LIB} -classpath ${DAEMON_LIB}/startup.jar\
-jar ${DAEMON_LIB}/startup.jar $DAEMON_OPTS"
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --background \
--pidfile /var/run/$NAME.pid --make-pidfile \
--exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON
echo "$NAME."
;;
restart|force-reload)
#
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart".
#
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON
sleep 1
start-stop-daemon --start --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
#!/bin/sh
# postrm script for wildfire
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
purge)
rm -Rf /opt/wildfire
;;
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
This diff is collapsed.
Name | Version
---------------------------------------------
ant.jar | Jetty 6.1.0 (1.6.5)
ant-contrib.jar | 1.0b1
ant-subdirtask.jar | Revision 1.4 (CVS)
bouncycastle.jar | JDK 1.5, 135 (bcprov-jdk15-135.jar)
commons-logging.jar | Jetty 5.1.10
commons-el.jar | Jetty 6.0.1 (1.0)
commons-httpclient.jar | 3.0
commons-codec.jar | 1.3
dom4j.jar | 1.6.1
dbutil.jar | Jive Code, no release version.
hsqldb.jar | 1.8.0.5
jetty.jar | Jetty 6.1.0
jetty-util.jar | Jetty 6.1.0
jasper-compiler.jar | Jetty 6.1.0 (5.5.15)
jasper-runtime.jar | Jetty 6.1.0 (5.5.15)
jaxen.jar | 1.1 beta 4 (from DOM4J 1.6.1)
junit.jar | 3.8.1
jdic.jar | 0.9.1 (for windows only)
jstl.jar | Jakarta standard taglib 1.1.2
jmdns.jar | PRE 1.0, patched
jsp-api.jar | Jetty 6.0.1 (2.0)
jtds.jar | 1.2
jzlib.jar | 1.0.7
mail.jar | 1.4.0 (JavaMail)
mina-core-1.2.0.jar | https://svn.apache.org/repos/asf/mina/branches/1.1
mina-filter-compression-1.2.0.jar | https://svn.apache.org/repos/asf/mina/branches/1.1
mina-filter-ssl-1.2.0.jar | https://svn.apache.org/repos/asf/mina/branches/1.1
mysql.jar | 3.1.13
pack200task.jar | August 5, 2004
postgres.jar | 8.1-404 JDBC 3
servlet.jar | Jetty 6.1.0 (2.5)
shaj.jar | 0.5
sitemesh.jar | 2.2.1
standard.jar | Jakarta standard taglib 1.1.2
whack.jar | March-03-2006
xmltask.jar | 1.11
xpp3.jar | XPP_3 1.1.4c
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>EnvironmentVariables</key>
<dict>
<key>WILDFIRE_HOME</key>
<string>/usr/local/wildfire/</string>
</dict>
<key>Label</key>
<string>org.jivesoftware.wildfire</string>
<key>OnDemand</key>
<false/>
<key>Program</key>
<string>/usr/local/wildfire/bin/extra/wildfire-launchd-wrapper.sh</string>
<key>RunAtLoad</key>
<false/>
<key>ServiceDescription</key>
<string>Wildfire</string>
<key>StandardErrorPath</key>
<string>/usr/local/wildfire/logs/launchd.stderr</string>
<key>StandardOutPath</key>
<string>/usr/local/wildfire/logs/launchd.stdout</string>
<key>UserName</key>
<string>wildfire</string>
<key>WorkingDirectory</key>
<string>/usr/local/wildfire/lib</string>
</dict>
</plist>
#!/bin/sh
WILDFIRE_HOME=/usr/local/wildfire/
WILDFIRE_GID=`cat /private/tmp/wildfiregid`
rm /private/tmp/wildfiregid
chown -R wildfire $WILDFIRE_HOME
chgrp -R $WILDFIRE_GID $WILDFIRE_HOME
/bin/launchctl load /Library/LaunchDaemons/org.jivesoftware.wildfire.plist
#!/bin/sh
if [ -f /tmp/wildfire.xml ]; then
mv /tmp/wildfire.xml /usr/local/wildfire/conf/
fi
if [ -f /tmp/security ]; then
mv /tmp/security /usr/local/wildfire/resources/
fi
if [ -f /tmp/embedded-db ]; then
mv /tmp/embedded-db /usr/local/wildfire/embedded-db
fi
if [ -f /tmp/enterprise ]; then
mv /tmp/enterprise /usr/local/wildfire/enterprise
fi
if [ -f /tmp/plugins ]; then
mv /tmp/plugins /usr/local/wildfire/plugins
fi
WILDFIRE_HOME=/usr/local/wildfire/
WILDFIRE_GID=`cat /private/tmp/wildfiregid`
rm /private/tmp/wildfiregid
chown -R wildfire $WILDFIRE_HOME
chgrp -R $WILDFIRE_GID $WILDFIRE_HOME
/bin/launchctl load /Library/LaunchDaemons/org.jivesoftware.wildfire.plist
\ No newline at end of file
#!/bin/bash
#determine safe uid/gid
NIUTIL_PRESENT=`which niutil`
if [ -z $NIUTIL_PRESENT] ; then
echo "No niutil"
WILDFIRE_USER=`dscl . -search /Users name wildfire | awk '{print $1}'`
WILDFIRE_GID=`dscl . -readall /Users PrimaryGroupID | awk '/PrimaryGroupID/{print $2}' | sort -n | egrep -v "\b[5-9][0-9]{2,5}\b" | tail -n 1`
let "WILDFIRE_GID=$WILDFIRE_GID+1"
echo $WILDFIRE_GID > /private/tmp/wildfiregid
if [ -z $WILDFIRE_USER ] ; then
WILDFIRE_UID=`dscl . -readall /Users UniqueID | awk '/UniqueID/{print $2}' | sort -n | egrep -v "\b[5-9][0-9]{2,5}\b" | tail -n 1`
let "WILDFIRE_UID=$WILDFIRE_UID+1"
echo $WILDFIRE_UID
#create user
dscl . -create /Users/wildfire
#set properties
dscl . -create /Users/wildfire PrimaryGroupID $WILDFIRE_GID
dscl . -create /Users/wildfire UniqueID $WILDFIRE_UID
dscl . -create /Users/wildfire UserShell /usr/bin/false
dscl . -create /Users/wildfire NFSHomeDirectory /usr/local/wildfire/
dscl . -create /Users/wildfire RealName "Jive Wildfire"
dscl . -passwd /Users/wildfire '*'
fi
else
WILDFIRE_USER=`nireport / /users name | grep "wildfire"`
WILDFIRE_GID=`nireport / /users gid | sort -n | egrep -v "\b[5-9][0-9]{2,5}\b" | tail -n 1`
let "WILDFIRE_GID=$WILDFIRE_GID+1"
echo $WILDFIRE_GID > /private/tmp/wildfiregid
if [ -z $WILDFIRE_USER] ; then
WILDFIRE_UID=`nireport / /users uid | sort -n | egrep -v "\b[5-9][0-9]{2,5}\b" | tail -n 1`
let "WILDFIRE_UID=$WILDFIRE_UID+1"
echo $WILDFIRE_UID
#create user
niutil -create . /users/wildfire
#set properties
niutil -createprop . /users/wildfire gid $WILDFIRE_GID
niutil -createprop . /users/wildfire uid $WILDFIRE_UID
niutil -createprop . /users/wildfire shell /usr/bin/false
niutil -createprop . /users/wildfire home /usr/local/wildfire/
niutil -createprop . /users/wildfire realname "Jive Wildfire"
niutil -createprop . /users/wildfire passwd '*'
fi
fi
#!/bin/sh
# stop wildfire
/bin/launchctl unload /Library/LaunchDaemons/org.jivesoftware.wildfire.plist
# preserve these files, they should never be upgraded
cp /usr/local/wildfire/conf/wildfire.xml /tmp/
cp -r /usr/local/wildfire/resources/security /tmp/
cp -r /usr/local/wildfire/embedded-db /tmp/
cp -r /usr/local/wildfire/enterprise /tmp/
cp -r /usr/local/wildfire/plugins /tmp/
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = NSObject; LANGUAGE = ObjC; },
{
CLASS = NSPreferencePane;
LANGUAGE = ObjC;
OUTLETS = {
"_firstKeyView" = id;
"_initialKeyView" = id;
"_lastKeyView" = id;
"_window" = id;
};
SUPERCLASS = NSObject;
},
{CLASS = SFAuthorizationView; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = WilfireStartStop; LANGUAGE = ObjC; SUPERCLASS = NSButton; },
{
ACTIONS = {openAdminInterface = id; toggleAutoStart = id; toggleServer = id; };
CLASS = wildfirePrefPane;
LANGUAGE = ObjC;
OUTLETS = {
authView = SFAuthorizationView;
autoStartCheckbox = NSButton;
startButton = NSButton;
statusDescription = NSTextField;
statusMessage = NSTextField;
statusProgress = NSProgressIndicator;
viewAdminButton = NSButton;
};
SUPERCLASS = NSPreferencePane;
}
);
IBVersion = 1;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>35 145 481 349 0 0 1280 778 </string>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>12</integer>
</array>
<key>IBSystem Version</key>
<string>8N1150</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Wildfire</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.apple.prefpanel</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>Jive Software</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>wildfirePrefPane</string>
<key>NSPrefPaneIconFile</key>
<string>wildfirePrefPaneLogo.tiff</string>
<key>NSPrefPaneIconLabel</key>
<string>Wildfire</string>
<key>NSPrincipalClass</key>
<string>wildfirePrefPane</string>
</dict>
</plist>
#include <unistd.h>
#include <stdbool.h>
#include <CoreFoundation/CoreFoundation.h>
static void CFQRelease(CFTypeRef cf)
// A version of CFRelease that's tolerant of NULL.
{
if (cf != NULL) {
CFRelease(cf);
}
}
static int GetPathToSelf(char **pathToSelfPtr)
// A drop-in replacement for GetPathToSelf() from MoreAuthSample's MoreSecurity.c,
// implemented using CoreFoundation. From CocoaDev.com
{
int err = 0;
assert( pathToSelfPtr != NULL);
assert(*pathToSelfPtr == NULL);
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef executableURL = NULL;
CFStringRef pathStringRef = NULL;
char *path = NULL;
if (mainBundle != NULL) {
executableURL = CFBundleCopyExecutableURL(mainBundle);
if (executableURL != NULL) {
pathStringRef = CFURLCopyFileSystemPath(executableURL, kCFURLPOSIXPathStyle);
if (pathStringRef != NULL) {
CFIndex pathSize = CFStringGetLength(pathStringRef) + 1;
path = (char *)calloc(pathSize,1);
if (path != NULL) {
Boolean gotCString = CFStringGetCString(pathStringRef, path, pathSize, kCFStringEncodingUTF8);
if (!gotCString) {
free(path);
path = NULL;
}
}
}
}
}
*pathToSelfPtr = path;
// Do the CF memory management.
CFQRelease(executableURL);
CFQRelease(pathStringRef);
assert(*pathToSelfPtr != NULL);
if (*pathToSelfPtr == NULL)
{
err = -1;
}
return err;
}
static bool wildfireIsRunning()
{
FILE *ps;
char buff[1024];
if((ps=popen("/bin/ps auxww | fgrep -v 'fgrep' | fgrep wildfire/lib/startup.jar", "r")) == NULL)
{
return false;
}
else
{
bool running = false;
if(fgets(buff, 1024, ps)) {
running = true;
}
pclose(ps);
return running;
}
}
static void toggleStartWildfireAtBoot()
{
CFURLRef propFile = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
CFSTR("/Library/LaunchDaemons/org.jivesoftware.wildfire.plist"),
kCFURLPOSIXPathStyle,
false);
CFDataRef xmlData;
CFURLCreateDataAndPropertiesFromResource (kCFAllocatorDefault,
propFile,
&xmlData,
NULL,
NULL,
NULL);
CFPropertyListRef props = CFPropertyListCreateFromXMLData(kCFAllocatorDefault,
xmlData,
kCFPropertyListMutableContainersAndLeaves,
NULL);
if(CFGetTypeID(props) == CFDictionaryGetTypeID()) {
CFMutableDictionaryRef propsDict = (CFMutableDictionaryRef)props;
CFBooleanRef currentValue = CFDictionaryGetValue(propsDict,CFSTR("RunAtLoad"));
CFDictionaryReplaceValue(propsDict, CFSTR("RunAtLoad"), ((currentValue == kCFBooleanTrue) ? kCFBooleanFalse : kCFBooleanTrue));
CFQRelease(xmlData);
xmlData = CFPropertyListCreateXMLData(kCFAllocatorDefault,(CFPropertyListRef)propsDict);
CFURLWriteDataAndPropertiesToResource(propFile,xmlData,NULL,NULL);
}
CFQRelease(props);
CFQRelease(xmlData);
CFQRelease(propFile);
}
static void toggleWildfire()
{
char *args[4];
args[0] = "launchctl";
if(wildfireIsRunning())
args[1] = "unload";
else
args[1] = "load";
args[2] = "/Library/LaunchDaemons/org.jivesoftware.wildfire.plist";
args[3] = NULL;
execv("/bin/launchctl", args);
}
int main(int inArgsCount, char * const inArgs[])
{
char* selfPath = NULL;
int err = GetPathToSelf(&selfPath);
const char* correctPath = "/Library/PreferencePanes/Wildfire.prefPane/Contents/MacOS/HelperTool";
if(err == 0 && strncmp(correctPath, selfPath, strlen(correctPath)) == 0) {
setuid(0);
if(inArgs[1] && strlen(inArgs[1]) == strlen("boot") && strncmp("boot", inArgs[1], strlen("boot")) == 0) {
toggleStartWildfireAtBoot();
} else {
toggleWildfire();
}
}
return 1;
}
\ No newline at end of file
//
// wildfirePrefPane.h
// Preference panel for Wildfire
//
// Created by Daniel Henninger on 7/7/06.
// Copyright (c) 2006 Jive Software. All rights reserved.
//
// Concept taken from MySQL preference panel, as well as some borrowed code.
//
#import <PreferencePanes/PreferencePanes.h>
#import <Security/Security.h>
#import <SecurityInterface/SFAuthorizationView.h>
#include <unistd.h>
// 'ps' command to use to check for running wildfire daemon
char *pscmd = "/bin/ps auxww | fgrep -v 'fgrep' | fgrep wildfire/lib/startup.jar";
// The path to the plist file
NSString *plistPath = @"/Library/LaunchDaemons/org.jivesoftware.wildfire.plist";
@interface wildfirePrefPane : NSPreferencePane
{
IBOutlet NSButton *startButton;
IBOutlet NSButton *autoStartCheckbox;
IBOutlet NSButton *viewAdminButton;
IBOutlet NSTextField *statusMessage;
IBOutlet NSTextField *statusDescription;
IBOutlet NSProgressIndicator *statusProgress;
IBOutlet SFAuthorizationView *authView;
NSTimer *statusTimer;
}
- (IBAction)toggleServer:(id)sender;
- (IBAction)toggleAutoStart:(id)sender;
- (IBAction)openAdminInterface:(id)sender;
- (void)mainViewDidLoad;
- (void)updateStatus;
- (void)startServer;
- (void)stopServer;
- (void)checkStatus;
- (BOOL)isRunning;
@end
//
// wildfirePrefPane.m
// Preference panel for Wildfire
//
// Created by Daniel Henninger on 7/7/06.
// Copyright (c) 2006 Jive Software. All rights reserved.
//
// Concept taken from MySQL preference panel, as well as some borrowed code.
//
#import <Security/Security.h>
#import <CoreFoundation/CoreFoundation.h>
#import "wildfirePrefPane.h"
@implementation wildfirePrefPane
- (void)mainViewDidLoad
{
AuthorizationItem authItems[1]; // we only want to get authorization for one command
authItems[0].name = kAuthorizationRightExecute; // we want the right to execute
char *cmd = [[[NSBundle bundleForClass:[self class]] pathForAuxiliaryExecutable:@"HelperTool"] fileSystemRepresentation];
authItems[0].value = cmd; // the path to the helper tool
authItems[0].valueLength = strlen(cmd); // length of the command
authItems[0].flags = 0; // no extra flags
AuthorizationRights authRights;
authRights.count = 1; // we have one item
authRights.items = authItems; // here is the values for our item
[authView setAuthorizationRights:&authRights];
[authView setAutoupdate:YES];
[authView setDelegate:self];
[authView updateStatus:self];
[statusProgress setStyle:NSProgressIndicatorSpinningStyle];
[statusProgress setDisplayedWhenStopped:NO];
[self updateStatus];
}
- (BOOL)isRunning
{
FILE *ps;
char buff[1024];
if((ps=popen(pscmd, "r")) == NULL)
{
// There was an error opening the pipe. Alert the user.
NSBeginAlertSheet(
@"Error!",
@"OK",
nil,
nil,
[NSApp mainWindow],
self,
nil,
nil,
self,
@"An error occured while detecting a running Wildfire process.",
nil);
return NO;
}
else
{
BOOL running = NO;
if(fgets(buff, 1024, ps)) {
running = YES;
printf(buff);
}
pclose(ps);
return running;
}
}
- (IBAction)openAdminInterface:(id)sender
{
NSString *stringURL = @"http://localhost:9090/";
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:stringURL]];
}
- (IBAction)toggleAutoStart:(id)sender
{
char *args[2];
args[0] = "boot";
args[1] = NULL;
OSStatus ourStatus = AuthorizationExecuteWithPrivileges([[authView authorization] authorizationRef],
[authView authorizationRights]->items[0].value,
kAuthorizationFlagDefaults, args, NULL);
if(ourStatus != errAuthorizationSuccess)
{
// alert user the startup has failed
NSBeginAlertSheet(
@"Error!",
@"OK",
nil,
nil,
[NSApp mainWindow],
self,
nil,
nil,
self,
@"Could not start the Wildfire server.",
nil);
[statusTimer invalidate];
[self checkStatus];
}
[self updateStatus];
}
- (IBAction)toggleServer:(id)sender
{
[statusMessage setHidden:YES];
[statusProgress startAnimation:self];
[startButton setEnabled:NO];
if(![self isRunning])
{
[self startServer];
statusTimer = [NSTimer scheduledTimerWithTimeInterval:4 target:self
selector:@selector(checkStatus) userInfo:nil repeats:NO];
}
else
{
[self stopServer];
statusTimer = [NSTimer scheduledTimerWithTimeInterval:4 target:self
selector:@selector(checkStatus) userInfo:nil repeats:NO];
}
[self updateStatus];
}
- (void)checkStatus
{
[statusProgress stopAnimation:self];
[statusMessage setHidden:NO];
[startButton setEnabled:YES];
[self updateStatus];
}
- (void)updateStatus
{
if ([self isRunning] == NO)
{
[statusMessage setStringValue:@"Stopped"];
[statusMessage setTextColor:[NSColor redColor]];
[statusDescription setStringValue:@"The server may take a few seconds to start up."];
[startButton setTitle:@"Start Wildfire"];
[viewAdminButton setEnabled:NO];
}
else
{
[statusMessage setStringValue:@"Running"];
[statusMessage setTextColor:[NSColor greenColor]];
[statusDescription setStringValue:@"The server may take a few seconds to stop."];
[startButton setTitle:@"Stop Wildfire"];
[viewAdminButton setEnabled:YES];
}
BOOL isStartingAtBoot = [[[NSMutableDictionary dictionaryWithContentsOfFile:plistPath] objectForKey:@"RunAtLoad"] boolValue];
[autoStartCheckbox setState:(isStartingAtBoot ? NSOnState : NSOffState)];
}
- (void)startServer
{
char *args[0];
args[1] = NULL;
OSStatus ourStatus = AuthorizationExecuteWithPrivileges([[authView authorization] authorizationRef],
[authView authorizationRights]->items[0].value,
kAuthorizationFlagDefaults, args, NULL);
// wait for the server to start
if(ourStatus != errAuthorizationSuccess)
{
// alert user the startup has failed
NSBeginAlertSheet(
@"Error!",
@"OK",
nil,
nil,
[NSApp mainWindow],
self,
nil,
nil,
self,
@"Could not start the Wildfire server.",
nil);
[statusTimer invalidate];
[self checkStatus];
}
}
- (void) stopServer
{
char *args[1];
args[0] = NULL;
OSStatus ourStatus = AuthorizationExecuteWithPrivileges([[authView authorization] authorizationRef],
[authView authorizationRights]->items[0].value,
kAuthorizationFlagDefaults, args, NULL);
if(ourStatus != errAuthorizationSuccess)
{
// alert user the startup has failed
NSBeginAlertSheet(
@"Error!",
@"OK",
nil,
nil,
[NSApp mainWindow],
self,
nil,
nil,
self,
@"Could not stop the Wildfire server.",
nil);
[statusTimer invalidate];
[self checkStatus];
}
}
@end
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment