From 939c5b324dba2fca9fdfe92cfee519c4a36a00ad Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sun, 30 Nov 2008 14:30:22 +0000 Subject: Makefile fix for creating datadir in correct place on install --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6676fc5b..80b1c25a 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,7 @@ BIN = $(DESTDIR)$(PREFIX)/bin CONFIG = $(DESTDIR)$(SYSCONFDIR) MODULES = $(DESTDIR)$(PREFIX)/lib/prosody/modules SOURCE = $(DESTDIR)$(PREFIX)/lib/prosody - -DATADIR?=data +DATA = $(DESTDIR)$(DATADIR) INSTALLEDSOURCE = $(PREFIX)/lib/prosody INSTALLEDCONFIG = $(SYSCONFDIR) @@ -17,7 +16,7 @@ all: prosody.install prosody.cfg.lua.install $(MAKE) all -C util-src install: prosody.install prosody.cfg.lua.install util/encodings.so util/encodings.so - install -d $(BIN) $(CONFIG) $(MODULES) $(SOURCE) $(DATADIR) + install -d $(BIN) $(CONFIG) $(MODULES) $(SOURCE) $(DATA) install -d $(CONFIG)/certs install -d $(SOURCE)/core $(SOURCE)/net $(SOURCE)/util install ./prosody.install $(BIN)/prosody -- cgit v1.2.3 From 8932fbc85ca4a43bba31099569bb579c6a803f22 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sun, 30 Nov 2008 20:58:48 +0500 Subject: Added function latin1toutf8 to sasl.lua, for processing non-utf8 responses --- util/sasl.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/util/sasl.lua b/util/sasl.lua index fa818b9a..02d47719 100644 --- a/util/sasl.lua +++ b/util/sasl.lua @@ -4,6 +4,8 @@ local log = require "util.logger".init("sasl"); local tostring = tostring; local st = require "util.stanza"; local generate_uuid = require "util.uuid".generate; +local t_insert, t_concat = table.insert, table.concat; +local to_byte, to_char = string.byte, string.char; local s_match = string.match; local gmatch = string.gmatch local string = string @@ -66,6 +68,20 @@ local function new_digest_md5(realm, password_handler) return data end + local function latin1toutf8(str) + local p = {}; + for ch in gmatch(str, ".") do + ch = to_byte(ch); + if (ch < 0x80) then + t_insert(p, to_char(ch)); + elseif (ch < 0xC0) then + t_insert(p, to_char(0xC2, ch)); + else + t_insert(p, to_char(0xC3, ch - 64)); + end + end + return t_concat(p); + end local function parse(data) message = {} for k, v in gmatch(data, [[([%w%-]+)="?([^",]*)"?,?]]) do -- FIXME The hacky regex makes me shudder -- cgit v1.2.3