]> granicus.if.org Git - ejabberd/commitdiff
Seek epam binary into priv/bin (EJAB-573)
authorChristophe Romain <christophe.romain@process-one.net>
Fri, 21 Mar 2008 15:35:40 +0000 (15:35 +0000)
committerChristophe Romain <christophe.romain@process-one.net>
Fri, 21 Mar 2008 15:35:40 +0000 (15:35 +0000)
SVN Revision: 1241

ChangeLog
src/ejabberd.erl
src/ejabberdctl.template
src/pam/epam.erl
tools/ejabberdctl

index 52807ceb887f6b4a817b2ed4c84042a2338353d6..175dd9b6366cfdc0e213b2bd3a3e56f7ad154c54 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-03-21  Christophe Romain <christophe.romain@process-one.net>
+
+       * src/pam/epam.erl: Seek epam binary into priv/bin (EJAB-573)
+       * src/ejabberd.erl: Likewise
+       * src/ejabberdctl.template: Likewise
+       * tools/ejabberdctl: Likewise
+
 2008-03-21  Badlop  <badlop@process-one.net>
 
        * src/cyrsasl_digest.erl: Rewrite io:format calls to loglevel
index 323b4c9126daad14067908e9dafc53cb7b6aec67..de2727ca0dcfeb3087cb8e9d65384ec3d7f5913f 100644 (file)
@@ -28,7 +28,7 @@
 -author('alexey@process-one.net').
 
 -export([start/0, stop/0,
-        get_so_path/0]).
+        get_so_path/0, get_bin_path/0]).
 
 start() ->
     application:start(ejabberd).
@@ -49,3 +49,16 @@ get_so_path() ->
        Path ->
            Path
     end.
+
+get_bin_path() ->
+    case os:getenv("EJABBERD_BIN_PATH") of
+       false ->
+           case code:priv_dir(ejabberd) of
+               {error, _} ->
+                   ".";
+               Path ->
+                   filename:join([Path, "bin"])
+           end;
+       Path ->
+           Path
+    end.
index fd5a1d08cf2f7f174806ab1ef1fcf774cfdb9859..f50b98580a7de5598c06c79a1eca624961104f16 100644 (file)
@@ -45,6 +45,7 @@ ERLANG_OPTS="+K $POLL -smp $SMP +P $ERL_PROCESSES"
 EJABBERD_EBIN=$ROOTDIR/var/lib/ejabberd/ebin
 EJABBERD_MSGS_PATH=$ROOTDIR/var/lib/ejabberd/priv/msgs
 EJABBERD_SO_PATH=$ROOTDIR/var/lib/ejabberd/priv/lib
+EJABBERD_BIN_PATH=$ROOTDIR/var/lib/ejabberd/priv/bin
 EJABBERD_LOG_PATH=$LOGS_DIR/ejabberd.log
 SASL_LOG_PATH=$LOGS_DIR/sasl.log
 DATETIME=`date "+%Y%m%d-%H%M%S"`
@@ -57,6 +58,7 @@ export EJABBERD_CONFIG_PATH
 export EJABBERD_MSGS_PATH
 export EJABBERD_LOG_PATH
 export EJABBERD_SO_PATH
+export EJABBERD_BIN_PATH
 export ERL_CRASH_DUMP
 export ERL_INETRC
 export ERL_MAX_PORTS
index 40431193b723af53f863a8eb00e1ca28e74b1fad..df24496baa032e593e722637e66774e6dd7ef5a7 100644 (file)
@@ -79,7 +79,7 @@ acct_mgmt(Srv, User) when is_list(Srv), is_list(User) ->
 %% gen_server callbacks
 %%====================================================================
 init([]) ->
-    FileName = filename:join(ejabberd:get_so_path(), "epam"),
+    FileName = filename:join(ejabberd:get_bin_path(), "epam"),
     case file:read_file_info(FileName) of
        {ok, Info} ->
            Mode = Info#file_info.mode band 16#801,
index 8b16785d800c08f9333dfccb632dfb04ea313885..9d3f7bd5af6fccc2ba7bbb4b47d050f97a4b3298 100755 (executable)
@@ -13,6 +13,7 @@ export EJABBERD_LOG_PATH=$ROOTDIR/ejabberd.log
 export EJABBERD_CONFIG_PATH=$ROOTDIR/ejabberd.cfg
 export EJABBERD_MSGS_PATH=$ROOTDIR/src/msgs
 export EJABBERD_SO_PATH=$ROOTDIR/src
+export EJABBERD_BIN_PATH=$ROOTDIR/src
 export ERL_MAX_PORTS=32000
 
 [ -d $EJABBERD_DB ] || mkdir -p $EJABBERD_DB