Permalink
Browse files

Linux-related fixes.

  • Loading branch information...
1 parent 9e7cce3 commit a642694ef45e36b6c1ba5d9d588636b6b50f33a4 @codebutler committed Jul 31, 2011
View
@@ -3,18 +3,18 @@ ACLOCAL_AMFLAGS = -I .
SUBDIRS = backend
XPI_OUT_DIR = $(top_builddir)/build
-XPI = $(XPI_OUT_DIR)/Firesheep-$(MOZ_ABI).xpi
+XPI = $(XPI_OUT_DIR)/Firesheep-$(FIRESHEEP_PLATFORM).xpi
-PLATFORM_DEST = $(top_builddir)/xpi/platform/$(MOZ_ABI)
+PLATFORM_DEST = $(top_builddir)/xpi/platform/$(FIRESHEEP_PLATFORM)
FIRESHEEP_BACKEND = $(PLATFORM_DEST)/firesheep-backend
-LIBFIRESHEEP = $(PLATFORM_DEST)/libfiresheep.dylib
+LIBFIRESHEEP = $(PLATFORM_DEST)/libfiresheep.$(DLL_EXT)
all: platform zip
platform:
mkdir -p $(PLATFORM_DEST)
cp $(top_builddir)/backend/backend $(FIRESHEEP_BACKEND)
- cp $(top_builddir)/backend/.libs/libfiresheep.dylib $(LIBFIRESHEEP)
+ cp $(top_builddir)/backend/.libs/libfiresheep.$(DLL_EXT) $(LIBFIRESHEEP)
#if PLATFORM_WIN32
# cp -f `which cygwin1.dll` $(PLATFORM_DEST)
View
@@ -26,7 +26,6 @@ libfiresheep_la_SOURCES = \
if PLATFORM_OSX
CXXFLAGS += -DPLATFORM_OSX -arch i386 -arch x86_64
-CFLAGS += $(CXXFLAGS)
libfiresheep_la_SOURCES += src/osx_platform.cpp
libfiresheep_la_LDFLAGS = -framework Security
libfiresheep_la_LDFLAGS += -framework SystemConfiguration
@@ -43,11 +42,10 @@ CXXFLAGS += -DPLATFORM_WIN32
endif
if PLATFORM_LINUX
CXXFLAGS += -DPLATFORM_LINUX
-#LIBFIRESHEEP_SOURCES += src/linux_platform.cpp
-#LIBFIRESHEEP_CFLAGS += $(PCAP_CFLAGS)
-#LIBFIRESHEEP_CFLAGS += $(BOOST_CPPFLAGS)
-#LIBFIRESHEEP_CFLAGS += $(HAL_CFLAGS)
-#LIBFIRESHEEP_LIBS += $(PCAP_LIBS)
-#LIBFIRESHEEP_LIBS += $(BOOST_FORMAT_LIBS) $(BOOST_STRING_ALGO_LIBS)
-#LIBFIRESHEEP_LIBS += $(HAL_LIBS)
+libfiresheep_la_SOURCES += src/linux_platform.cpp
+libfiresheep_la_CXXFLAGS = $(PCAP_CFLAGS) $(BOOST_CPPFLAGS) $(HAL_CFLAGS)
+libfiresheep_la_CFLAGS = $(libfiresheep_la_CXXFLAGS)
+libfiresheep_la_LIBADD = $(PCAP_LIBS) $(BOOST_FORMAT_LIBS) $(BOOST_STRING_ALGO_LIBS) $(HAL_LIBS)
endif
+
+CFLAGS += $(CXXFLAGS)
@@ -35,9 +35,12 @@ LinuxPlatform::LinuxPlatform(string path) : UnixPlatform(path) { }
bool LinuxPlatform::run_privileged()
{
- const char *path = this->path().c_str();
- execl("/usr/bin/pkexec", "pkexec", path, "--fix-permissions", NULL);
- return true;
+ string cmd = string("/usr/bin/pkexec ");
+ cmd += this->path();
+ cmd += " --fix-permissions";
+
+ int ret = system(cmd.c_str());
+ return (ret == 0);
}
string device_get_property_string(LibHalContext *context, string device, string key, DBusError *error)
View
@@ -20,6 +20,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
+#include <cstdio>
+
#include "http_sniffer.hpp"
#include "http_packet.hpp"
#include "json_spirit_writer_template.h"
View
@@ -38,29 +38,43 @@ fi
m4_define_default([PKG_CHECK_MODULES], [AC_MSG_FAILURE([pkg-config was not found])])
AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+
+case "$build_cpu" in
+ i[[3456]]86*)
+ build_arch="x86"
+ ;;
+ amd64*|x86_64*)
+ build_arch="x86_64"
+ ;;
+esac
+
case "$host_os" in
cygwin)
- TARGET=WIN32
- MOZ_ABI="WINNT_x86-msvc"
- AC_SUBST(MOZ_ABI)
+ DLL_EXT="dll"
+ FIRESHEEP_PLATFORM_NAME=WIN32
+ FIRESHEEP_PLATFORM="WINNT_x86-msvc"
;;
darwin*)
- TARGET=OSX
+ DLL_EXT="dylib"
+ FIRESHEEP_PLATFORM_NAME=OSX
+ FIRESHEEP_PLATFORM="osx"
CFLAGS="-isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6"
- MOZ_ABI="OSX"
- AC_SUBST(MOZ_ABI)
-
;;
linux*)
- TARGET=LINUX
- MOZ_ABI="Linux_$(BUILD_ARCH)-gcc3"
- AC_SUBST(MOZ_ABI)
+ DLL_EXT="so"
+ FIRESHEEP_PLATFORM_NAME=LINUX
+ FIRESHEEP_PLATFORM="Linux_${build_arch}-gcc3"
;;
esac
-AM_CONDITIONAL(PLATFORM_WIN32, test x$TARGET = xWIN32)
-AM_CONDITIONAL(PLATFORM_OSX, test x$TARGET = xOSX)
-AM_CONDITIONAL(PLATFORM_LINUX, test x$TARGET = xLINUX)
+AC_SUBST(DLL_EXT)
+AC_SUBST(FIRESHEEP_PLATFORM)
+AC_SUBST(FIRESHEEP_PLATFORM_NAME)
+
+AM_CONDITIONAL(PLATFORM_WIN32, test x$FIRESHEEP_PLATFORM_NAME = xWIN32)
+AM_CONDITIONAL(PLATFORM_OSX, test x$FIRESHEEP_PLATFORM_NAME = xOSX)
+AM_CONDITIONAL(PLATFORM_LINUX, test x$FIRESHEEP_PLATFORM_NAME = xLINUX)
# BEGIN PCAP LIBS
AC_PATH_PROG([PCAP_CONFIG], [pcap-config], [no], [$PATH])
@@ -85,32 +99,11 @@ BOOST_STRING_ALGO
AC_SUBST(BOOST_STRING_ALGO_LIBS)
# END BOOST LIBS
-# BEGIN LINUX
-# Use generic CPU arch for xpi/platform
-# on Linux
-case "$build_cpu" in
- i[[3456]]86*)
- build_arch="x86"
- build_target="-mtune=generic -m32"
- ;;
- amd64*|x86_64*)
- build_arch="x86_64"
- build_target="-mtune=generic -m64"
- ;;
-esac
-
-BUILD_ARCH=$build_arch
-AC_SUBST(BUILD_ARCH)
-
-BUILD_TARGET=$build_target
-AC_SUBST(BUILD_TARGET)
-
-if test x$TARGET = xLINUX; then
+if test x$FIRESHEEP_PLATFORM_NAME = xLINUX; then
PKG_CHECK_MODULES(HAL, [hal])
AC_SUBST(HAL_CFLAGS)
AC_SUBST(HAL_LIBS)
fi
-# END LINUX
CXXFLAGS="-Wall -g -O0"
AC_SUBST(CXXFLAGS)
@@ -125,5 +118,5 @@ AC_OUTPUT
echo "
Firesheep-$VERSION
- Mozilla SDK Arch: ${MOZ_ABI}
+ Platform: ${FIRESHEEP_PLATFORM}
"
View
@@ -8,4 +8,6 @@ overlay chrome://global/content/customizeToolbar.xul chrome://firesh
style chrome://firesheep/content/sidebar.xul chrome://firesheep/skin/sidebar-osx.css OS=Darwin
style chrome://firesheep/content/preferences/prefsWindow.xul chrome://firesheep/skin/preferences-osx.css OS=Darwin
+style chrome://firesheep/content/sidebar.xul chrome://firesheep/skin/sidebar-win.css OS=WINNT
+
resource firesheep modules/
@@ -26,11 +26,6 @@ Components.utils.import('resource://firesheep/util/Preferences.js');
function loadInterfaces () {
try {
- sizeToContent();
- var vbox = document.getElementById('captureBox');
- vbox.height = vbox.boxObject.height;
- sizeToContent();
-
var currentId = Firesheep.captureInterface;
var list = document.getElementById('captureInterfaceMenuList');
@@ -25,11 +25,11 @@
<overlay id="websitesPaneOverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="websitesPane.js" />
- <prefpane id="websitesPane" label="Websites" onpaneload="loadScripts()">
+ <prefpane id="websitesPane" label="Websites" onpaneload="loadScripts()" flex="1">
<preferences>
</preferences>
- <vbox id="websitesBox">
- <richlistbox id="scriptsList" flex="1" ondblclick="editScript()" onselect="onSelect()" />
+ <vbox id="websitesBox" flex="1">
+ <richlistbox id="scriptsList" ondblclick="editScript()" onselect="onSelect()" />
<hbox>
<button label="Add" id="addButton" oncommand="addScript()" />
<button label="Edit" id="editButton" oncommand="editScript()" disabled="true" />
@@ -40,4 +40,4 @@
</hbox>
</vbox>
</prefpane>
-</overlay>
+</overlay>
@@ -1,6 +1,6 @@
prefwindow {
- width: 500px;
- min-height: 350px;
+ width: 550px;
+ height: 450px;
}
caption {
@@ -30,4 +30,4 @@ caption {
#firesheepPrefs[animated="false"] #scriptsList {
-moz-box-flex: 1;
-}
+}
@@ -28,11 +28,11 @@
#firesheepSidebar richlistbox {
background: white;
+ -moz-appearance: none;
}
#bottombar {
background: white url(chrome://firesheep/skin/bottombar_bg.png) repeat-x;
- border-top: 0 !important;
}
#bottombar button {
@@ -43,4 +43,16 @@
min-width: 15px;
max-width: 15px;
display: block !important;
-}
+}
+
+splitter {
+ -moz-appearance: none;
+ min-height: 0;
+ height: 1px;
+ background: #B4B4B4;
+}
+
+
+#detailsTree {
+ -moz-appearance: none;
+}
@@ -0,0 +1,11 @@
+#firesheepSidebar #toolbar {
+ border-bottom: 1px solid threedshadow;
+}
+
+#bottombar {
+ border-top: 1px solid threedshadow;
+}
+
+#firesheepSidebar richlistbox {
+ -moz-appearance: none;
+}
@@ -1,15 +1,12 @@
#firesheepSidebar #toolbar {
padding: 6px;
- border-bottom: 1px solid threedshadow;
}
#firesheepSidebar richlistbox {
margin: 0;
- -moz-appearance: none;
}
#detailsTree {
- -moz-appearance: none;
margin: 0;
border: 0;
height: 150px;
@@ -24,17 +21,6 @@
color: white;
}
-splitter {
- -moz-appearance: none;
- min-height: 0;
- height: 1px;
- background: #B4B4B4;
-}
-
-#bottombar {
- border-top: 1px solid threedshadow;
-}
-
#bottombar button {
-moz-appearance: none;
border: 0;
@@ -66,4 +52,4 @@ splitter {
#splitterHandle {
display: none !important;
-}
+}

0 comments on commit a642694

Please sign in to comment.