diff --git a/Makefile b/Makefile index 0249f99c..7ffc35e0 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,7 @@ MAN_DIR = usr/share/man INFO_DIR = usr/share/info MIGRATION_EXTRAS_DIR = System/Library/ServerSetup/MigrationExtras PROMOTION_EXTRAS_DIR = System/Library/ServerSetup/PromotionExtras +COMMON_EXTRAS_DIR = System/Library/ServerSetup/CommonExtras RESTORE_EXTRAS_DIR = System/Library/ServerSetup/RestoreExtras JABBERD_BIN_DIR=$(SERVER_INSTALL_PATH_PREFIX)/usr/libexec/jabberd @@ -405,6 +406,7 @@ authreg_apple_od.so \ mod_active.0.so \ mod_amp.0.so \ mod_announce.0.so \ +mod_autobuddy.0.so \ mod_deliver.0.so \ mod_disco.0.so \ mod_echo.0.so \ @@ -505,9 +507,10 @@ jabberd2/makeinstall: $(SILENT) $(INSTALL) -m 755 -o root -g wheel $(OBJROOT)/$(JABBERD2_INSTALL_DIR)/$(firstword $(JABBERD2_ARCHS))/$(JABBERD_BIN_DIR)/jabberd $(OBJROOT)/$(JABBERD2_INSTALL_DIR)/$(JABBERD_BIN_DIR) $(SILENT) $(MKDIRS) $(SYMROOT)/$(JABBERD_MODULES_DIR) $(SILENT) $(MKDIRS) $(OBJROOT)/$(JABBERD2_INSTALL_DIR)/$(JABBERD_MODULES_DIR) +# we don't want to ship .la files + $(SILENT) $(RM) -f $(OBJROOT)/$(JABBERD2_INSTALL_DIR)/$(firstword $(JABBERD2_ARCHS))/$(JABBERD_MODULES_DIR)/*.la # authreg_sqlite gets built, but we don't want it. $(SILENT) $(RM) -f $(OBJROOT)/$(JABBERD2_INSTALL_DIR)/$(firstword $(JABBERD2_ARCHS))/$(JABBERD_MODULES_DIR)/authreg_sqlite.so - $(SILENT) $(RM) -f $(OBJROOT)/$(JABBERD2_INSTALL_DIR)/$(firstword $(JABBERD2_ARCHS))/$(JABBERD_MODULES_DIR)/authreg_sqlite.la # Copy symlinks for jabberd2 modules $(SILENT) $(DITTO) $(OBJROOT)/$(JABBERD2_INSTALL_DIR)/$(firstword $(JABBERD2_ARCHS))/$(JABBERD_MODULES_DIR) $(OBJROOT)/$(JABBERD2_INSTALL_DIR)/$(JABBERD_MODULES_DIR) # This is not working, but it would be nice to make the list of shared libs dynamic based on what jabberd2 builds. @@ -559,7 +562,7 @@ jabberd2/clean-all: BACKUPRESTORE_SRC_DIR=backup_restore MIGRATION_SRC_DIR=migration -PROMOTION_SRC_DIR=promotion +PROMOTION_SRC_DIR=common_extras RESTORE_SRC_DIR=restore_extras INITIALIZATION_SRC_DIR=initialization @@ -669,9 +672,9 @@ install/migration: $(SILENT) $(CP) $(SRCROOT)/$(MIGRATION_SRC_DIR)/jabber_data_migrate_2.0-2.2.pl $(OBJROOT)/$(STAGING_DIR)/$(LIBEXEC_DIR)/ install/promotion: - @echo "# `date +%Y/%m/%d\ %H:%M:%S` ChatServer: [staging]: ...copying PromotionExtras" - $(SILENT) $(MKDIR) -p -m 755 $(OBJROOT)/$(STAGING_DIR)/$(PROMOTION_EXTRAS_DIR) - $(SILENT) $(CP) $(SRCROOT)/$(PROMOTION_SRC_DIR)/70-message_server_promotion.sh $(OBJROOT)/$(STAGING_DIR)/$(PROMOTION_EXTRAS_DIR)/ + @echo "# `date +%Y/%m/%d\ %H:%M:%S` ChatServer: [staging]: ...copying CommonExtras" + $(SILENT) $(MKDIR) -p -m 755 $(OBJROOT)/$(STAGING_DIR)/$(COMMON_EXTRAS_DIR) + $(SILENT) $(CP) $(SRCROOT)/$(PROMOTION_SRC_DIR)/70-message_server_common_extra.pl $(OBJROOT)/$(STAGING_DIR)/$(COMMON_EXTRAS_DIR)/ install/restore_extras: @echo "# `date +%Y/%m/%d\ %H:%M:%S` ChatServer: [staging]: ...copying RestoreExtras" diff --git a/apple_patch/pre_configure/jabberd2/configure.patch b/apple_patch/pre_configure/jabberd2/configure.patch index 1dc52bb9..1d046aa9 100644 --- a/apple_patch/pre_configure/jabberd2/configure.patch +++ b/apple_patch/pre_configure/jabberd2/configure.patch @@ -5,7 +5,7 @@ PACKAGE_NAME='jabberd' PACKAGE_TARNAME='jabberd' -PACKAGE_VERSION='2.2.17' -+PACKAGE_VERSION='2.2.17-399' ++PACKAGE_VERSION='2.2.17-409' PACKAGE_STRING='jabberd 2.2.17' PACKAGE_BUGREPORT='jabberd2@lists.xiaoka.com' PACKAGE_URL='' diff --git a/apple_patch/pre_configure/jabberd2/s2s/out.c.patch b/apple_patch/pre_configure/jabberd2/s2s/out.c.patch index 21c784e3..ffe83558 100644 --- a/apple_patch/pre_configure/jabberd2/s2s/out.c.patch +++ b/apple_patch/pre_configure/jabberd2/s2s/out.c.patch @@ -1,5 +1,14 @@ --- /tmp/jabberd-2.2.17/s2s/out.c 2012-08-21 23:03:58.000000000 -0700 -+++ ./jabberd2/s2s/out.c 2012-08-28 18:49:00.000000000 -0700 ++++ ./jabberd2/s2s/out.c 2012-12-11 19:06:53.000000000 -0800 +@@ -627,7 +627,7 @@ int out_packet(s2s_t s2s, pkt_t pkt) { + nad_free(pkt->nad); + free(pkt); + +- return; ++ return -1; + } + + /* new route key */ @@ -1570,7 +1570,7 @@ static int _out_sx_callback(sx_t s, sx_e elem = nad_find_elem(nad, 0, ns, "starttls", 1); if(elem >= 0) { diff --git a/apple_patch/pre_configure/jabberd2/sm/Makefile.am.patch b/apple_patch/pre_configure/jabberd2/sm/Makefile.am.patch new file mode 100644 index 00000000..71df172f --- /dev/null +++ b/apple_patch/pre_configure/jabberd2/sm/Makefile.am.patch @@ -0,0 +1,23 @@ +--- jabberd-2.2.17/sm/Makefile.am 2011-10-30 11:46:36.000000000 -0700 ++++ jabberd/sm/Makefile.am 2013-06-17 15:11:58.000000000 -0700 +@@ -5,6 +5,7 @@ + pkglib_LTLIBRARIES = mod_active.la \ + mod_announce.la \ + mod_amp.la \ ++ mod_autobuddy.la \ + mod_deliver.la \ + mod_disco.la \ + mod_echo.la \ +@@ -68,6 +69,12 @@ + mod_amp_la_LIBADD = $(top_builddir)/subst/libsubst.la + endif + ++mod_autobuddy_la_SOURCES = mod_autobuddy.c ++mod_autobuddy_la_LDFLAGS = -module -export-dynamic ++if USE_LIBSUBST ++mod_autobuddy_la_LIBADD = $(top_builddir)/subst/libsubst.la ++endif ++ + mod_deliver_la_SOURCES = mod_deliver.c + mod_deliver_la_LDFLAGS = -module -export-dynamic + if USE_LIBSUBST diff --git a/apple_patch/pre_configure/jabberd2/sm/Makefile.in.patch b/apple_patch/pre_configure/jabberd2/sm/Makefile.in.patch index 6e4bd572..00a2cad8 100644 --- a/apple_patch/pre_configure/jabberd2/sm/Makefile.in.patch +++ b/apple_patch/pre_configure/jabberd2/sm/Makefile.in.patch @@ -1,5 +1,5 @@ ---- /tmp/jabberd-2.2.17/sm/Makefile.in 2012-08-26 04:59:55.000000000 -0700 -+++ ./jabberd2/sm/Makefile.in 2012-08-28 18:49:00.000000000 -0700 +--- jabberd-2.2.17/sm/Makefile.in 2012-08-26 04:59:55.000000000 -0700 ++++ jabberd/sm/Makefile.in 2013-06-17 15:50:10.000000000 -0700 @@ -20,7 +20,7 @@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -9,3 +9,70 @@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 +@@ -100,6 +100,13 @@ + mod_announce_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(mod_announce_la_LDFLAGS) $(LDFLAGS) -o $@ ++@USE_LIBSUBST_TRUE@mod_autobuddy_la_DEPENDENCIES = \ ++@USE_LIBSUBST_TRUE@ $(top_builddir)/subst/libsubst.la ++am_mod_autobuddy_la_OBJECTS = mod_autobuddy.lo ++mod_autobuddy_la_OBJECTS = $(am_mod_autobuddy_la_OBJECTS) ++mod_autobuddy_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ ++ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ ++ $(mod_autobuddy_la_LDFLAGS) $(LDFLAGS) -o $@ + @USE_LIBSUBST_TRUE@mod_deliver_la_DEPENDENCIES = \ + @USE_LIBSUBST_TRUE@ $(top_builddir)/subst/libsubst.la + am_mod_deliver_la_OBJECTS = mod_deliver.lo +@@ -273,7 +280,7 @@ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ + SOURCES = $(mod_active_la_SOURCES) $(mod_amp_la_SOURCES) \ +- $(mod_announce_la_SOURCES) $(mod_deliver_la_SOURCES) \ ++ $(mod_announce_la_SOURCES) $(mod_autobuddy_la_SOURCES) $(mod_deliver_la_SOURCES) \ + $(mod_disco_la_SOURCES) $(mod_echo_la_SOURCES) \ + $(mod_help_la_SOURCES) $(mod_iq_last_la_SOURCES) \ + $(mod_iq_ping_la_SOURCES) $(mod_iq_private_la_SOURCES) \ +@@ -286,7 +293,7 @@ + $(mod_vacation_la_SOURCES) $(mod_validate_la_SOURCES) \ + $(sm_SOURCES) + DIST_SOURCES = $(mod_active_la_SOURCES) $(mod_amp_la_SOURCES) \ +- $(mod_announce_la_SOURCES) $(mod_deliver_la_SOURCES) \ ++ $(mod_announce_la_SOURCES) $(mod_autobuddy_la_SOURCES) $(mod_deliver_la_SOURCES) \ + $(mod_disco_la_SOURCES) $(mod_echo_la_SOURCES) \ + $(mod_help_la_SOURCES) $(mod_iq_last_la_SOURCES) \ + $(mod_iq_ping_la_SOURCES) $(mod_iq_private_la_SOURCES) \ +@@ -439,6 +446,7 @@ + pkglib_LTLIBRARIES = mod_active.la \ + mod_announce.la \ + mod_amp.la \ ++ mod_autobuddy.la \ + mod_deliver.la \ + mod_disco.la \ + mod_echo.la \ +@@ -487,6 +495,9 @@ + mod_amp_la_SOURCES = mod_amp.c + mod_amp_la_LDFLAGS = -module -export-dynamic + @USE_LIBSUBST_TRUE@mod_amp_la_LIBADD = $(top_builddir)/subst/libsubst.la ++mod_autobuddy_la_SOURCES = mod_autobuddy.c ++mod_autobuddy_la_LDFLAGS = -module -export-dynamic -framework OpenDirectory -framework CoreFoundation ++@USE_LIBSUBST_TRUE@mod_autobuddy_la_LIBADD = $(top_builddir)/subst/libsubst.la + mod_deliver_la_SOURCES = mod_deliver.c + mod_deliver_la_LDFLAGS = -module -export-dynamic + @USE_LIBSUBST_TRUE@mod_deliver_la_LIBADD = $(top_builddir)/subst/libsubst.la +@@ -621,6 +632,8 @@ + $(mod_amp_la_LINK) -rpath $(pkglibdir) $(mod_amp_la_OBJECTS) $(mod_amp_la_LIBADD) $(LIBS) + mod_announce.la: $(mod_announce_la_OBJECTS) $(mod_announce_la_DEPENDENCIES) $(EXTRA_mod_announce_la_DEPENDENCIES) + $(mod_announce_la_LINK) -rpath $(pkglibdir) $(mod_announce_la_OBJECTS) $(mod_announce_la_LIBADD) $(LIBS) ++mod_autobuddy.la: $(mod_autobuddy_la_OBJECTS) $(mod_autobuddy_la_DEPENDENCIES) $(EXTRA_mod_autobuddy_la_DEPENDENCIES) ++ $(mod_autobuddy_la_LINK) -rpath $(pkglibdir) $(mod_autobuddy_la_OBJECTS) $(mod_autobuddy_la_LIBADD) $(LIBS) + mod_deliver.la: $(mod_deliver_la_OBJECTS) $(mod_deliver_la_DEPENDENCIES) $(EXTRA_mod_deliver_la_DEPENDENCIES) + $(mod_deliver_la_LINK) -rpath $(pkglibdir) $(mod_deliver_la_OBJECTS) $(mod_deliver_la_LIBADD) $(LIBS) + mod_disco.la: $(mod_disco_la_OBJECTS) $(mod_disco_la_DEPENDENCIES) $(EXTRA_mod_disco_la_DEPENDENCIES) +@@ -719,6 +732,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_active.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_amp.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_announce.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_autobuddy.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_deliver.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_disco.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_echo.Plo@am__quote@ diff --git a/apple_patch/pre_configure/jabberd2/sm/mod_autobuddy.c.patch b/apple_patch/pre_configure/jabberd2/sm/mod_autobuddy.c.patch new file mode 100644 index 00000000..7c1f0b6b --- /dev/null +++ b/apple_patch/pre_configure/jabberd2/sm/mod_autobuddy.c.patch @@ -0,0 +1,264 @@ +--- jabberd-2.2.17/sm/mod_autobuddy.c 1969-12-31 16:00:00.000000000 -0800 ++++ jabberd/sm/mod_autobuddy.c 2013-06-20 01:21:58.000000000 -0700 +@@ -0,0 +1,261 @@ ++/* ++ ++ */ ++ ++/** @file sm/mod_autobuddy.c ++ * @brief Apple: Server code for jabber_autobuddy functionality ++ * @author Apple Inc. ++ * $Date: 2013/07/01 $ ++ * $Revision: 1.0 $ ++ */ ++ ++#include "sm.h" ++#include ++#include ++#include ++#include ++#include ++ ++#define CF_SAFE_RELEASE(cfobj) \ ++do { if ((cfobj) != NULL) CFRelease((cfobj)); cfobj = NULL; } while (0) ++ ++static void _log_cferror(char *message, CFErrorRef error) { ++ if (error == NULL) { ++ log_debug(ZONE, "%s", message); ++ } ++ else { ++ char buf[256]; ++ CFStringRef errorString = CFErrorCopyFailureReason(error); ++ CFStringGetCString(errorString, buf, sizeof(buf), kCFStringEncodingUTF8); ++ log_debug(ZONE, "%s: %s", message, buf); ++ } ++} ++ ++static int _autobuddy_user_load(mod_instance_t mi, user_t user) { ++ os_t os; ++ os_object_t o; ++ uuid_t user_uuid; ++ char group_name[2048]; ++ int num_active_users = 0; ++ int num_groups_for_user = 0; ++ int i; ++ ++ // Get GUIDs of groups that user may be in ++ if (storage_get_custom_sql(user->sm->st, "SELECT \"guid\" from \"autobuddy-guids\"", &os, NULL) != st_SUCCESS) { ++ // Error, or no items in table ++ return 0; ++ } ++ if (os_count(os) == 0) { ++ return 0; ++ } ++ if (0 != mbr_user_name_to_uuid(user->jid->node, user_uuid)) { ++ log_debug(ZONE, "Could not resolve uuid for username: %s", user->jid->node); ++ return 0; ++ } ++ char group_guids_for_user[os_count(os)][256]; ++ if (os_iter_first(os)) { ++ do { ++ char *guid; ++ o = os_iter_object(os); ++ if (! os_object_get_str(os, o, "guid", &guid)) { ++ log_debug(ZONE, "object with missing jid, skipping"); ++ continue; ++ } ++ //log_debug(ZONE, "Found guid: %s", guid); ++ if (guid != NULL) { ++ uuid_t group_uuid; ++ uuid_parse(guid, group_uuid); ++ ++ int is_member; ++ if (0 != mbr_check_membership(user_uuid, group_uuid, &is_member) || is_member == 0) ++ continue; ++ // User is a member. Remember this group. ++ num_groups_for_user++; ++ strncpy(group_guids_for_user[num_groups_for_user-1], guid, 256); ++ } ++ } while (os_iter_next(os)); ++ } ++ ++ if (num_groups_for_user == 0) { ++ // No groups that user is a member of. ++ return 0; ++ } ++ ++ os_free(os); ++ ++ // Build a list of active users ++ if (storage_get_custom_sql(user->sm->st, "SELECT \"collection-owner\" from active", &os, NULL) != st_SUCCESS) { ++ // Error, or no items in table ++ return 0; ++ } ++ if (os_count(os) == 0) { ++ // No active users ++ return 0; ++ } ++ ++ jid_t active_jids[os_count(os)]; ++ if (os_iter_first(os)) { ++ char *owner_jid; ++ do { ++ o = os_iter_object(os); ++ if (! os_object_get_str(os, o, "collection-owner", &owner_jid)) { ++ log_debug(ZONE, "object with missing jid, skipping"); ++ continue; ++ } ++ log_debug(ZONE, "Found jid: %s", owner_jid); ++ jid_t jidt = jid_new(owner_jid, strlen(owner_jid)); ++ if (jidt == NULL || jidt->node == NULL) { ++ log_debug(ZONE, "Error getting JID from returned string when reading active table"); ++ continue; ++ } ++ num_active_users++; ++ active_jids[num_active_users-1] = jidt; ++ } while (os_iter_next(os)); ++ } ++ ++// for (i = 0; i < num_active_users; i++) { ++// log_debug(ZONE, "Found jid: %s\n", jid_user(active_jids[i])); ++// } ++ ++ ++ os_free(os); ++ ++ int iter_group; ++ for (iter_group = 0; iter_group < num_groups_for_user; iter_group++) { ++ CFErrorRef cfError = NULL; ++ ODNodeRef gSearchNode = ODNodeCreateWithNodeType(kCFAllocatorDefault, kODSessionDefault, ++ kODNodeTypeAuthentication, &cfError); ++ CFStringRef cfGuid = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%s"), group_guids_for_user[iter_group]); ++ ODQueryRef cfQueryRef = ODQueryCreateWithNode(kCFAllocatorDefault, ++ gSearchNode, ++ kODRecordTypeGroups, ++ kODAttributeTypeGUID, ++ kODMatchEqualTo, ++ cfGuid, ++ NULL, ++ 0, &cfError); ++ if (cfQueryRef == NULL || cfError != NULL) { ++ _log_cferror("ERROR: ODQueryCreateWithNode failed", cfError); ++ CF_SAFE_RELEASE(cfError); ++ CF_SAFE_RELEASE(gSearchNode); ++ CF_SAFE_RELEASE(cfGuid); ++ CF_SAFE_RELEASE(cfQueryRef); ++ break; ++ } ++ CFArrayRef cfGroupRecords = ODQueryCopyResults(cfQueryRef, false, &cfError); ++ if (cfGroupRecords == NULL || cfError != NULL) { ++ _log_cferror("ERROR: ODQueryCopyResults failed", cfError); ++ CF_SAFE_RELEASE(cfError); ++ CF_SAFE_RELEASE(gSearchNode); ++ CF_SAFE_RELEASE(cfGuid); ++ CF_SAFE_RELEASE(cfQueryRef); ++ CF_SAFE_RELEASE(cfGroupRecords); ++ break; ++ } ++ else if (CFArrayGetCount(cfGroupRecords) == 0) { ++ log_debug(ZONE, "Unable to find group record"); ++ CF_SAFE_RELEASE(cfError); ++ CF_SAFE_RELEASE(gSearchNode); ++ CF_SAFE_RELEASE(cfGuid); ++ CF_SAFE_RELEASE(cfQueryRef); ++ CF_SAFE_RELEASE(cfGroupRecords); ++ break; ++ } ++ ODRecordRef groupRecord = (ODRecordRef)CFArrayGetValueAtIndex(cfGroupRecords, 0); ++ CFArrayRef values = ODRecordCopyValues(groupRecord, kODAttributeTypeFullName, &cfError); ++ CFStringRef value = NULL; ++ if (values != NULL) { ++ value = CFArrayGetValueAtIndex(values, 0); ++ } ++ if (value != NULL) { ++ CFStringGetCString(value, group_name, sizeof(group_name), kCFStringEncodingUTF8); ++ log_debug(ZONE, "Found kODAttributeTypeFullName for group: %s", group_name); ++ } ++ else { ++ values = ODRecordCopyValues(groupRecord, kODAttributeTypeRecordName, &cfError); ++ value = CFArrayGetValueAtIndex(values, 0); ++ CFStringGetCString(value, group_name, sizeof(group_name), kCFStringEncodingUTF8); ++ log_debug(ZONE, "Found kODAttributeTypeRecordName for group: %s", group_name); ++ } ++ ++ CF_SAFE_RELEASE(cfError); ++ CF_SAFE_RELEASE(gSearchNode); ++ CF_SAFE_RELEASE(cfGuid); ++ CF_SAFE_RELEASE(cfQueryRef); ++ CF_SAFE_RELEASE(groupRecord); ++ CF_SAFE_RELEASE(cfGroupRecords); ++ CF_SAFE_RELEASE(value); ++ CF_SAFE_RELEASE(values); ++ ++ //log_debug(ZONE, "Iterating over %d JIDs", num_active_users); ++ int iter_user; ++ for (iter_user = 0; iter_user < num_active_users; iter_user++) { ++ // For each user in list, set roster-items and roster-groups to authorize every other ++ // user in the list, if they are a member of the given OD group. ++ if (0 != mbr_user_name_to_uuid(active_jids[iter_user]->node, user_uuid)) ++ continue; ++ ++ uuid_t group_uuid; ++ uuid_parse(group_guids_for_user[iter_group], group_uuid); ++ ++ int is_member; ++ if (0 != mbr_check_membership(user_uuid, group_uuid, &is_member) || is_member == 0) ++ continue; ++ ++ if (strncmp(active_jids[iter_user]->node, user->jid->node, 1023) == 0) { ++ // Found our own username ++ log_debug(ZONE, "Found our own name, continuing"); ++ continue; ++ } ++ ++ os_t osa; ++ os_object_t oa; ++ char filter[4096]; ++ ++ log_debug(ZONE, "saving roster item %s for %s", jid_full(active_jids[iter_user]), jid_user(user->jid)); ++ ++ osa = os_new(); ++ oa = os_object_new(osa); ++ ++ int i_false = 0; ++ int i_true = 1; ++ os_object_put(oa, "jid", jid_full(active_jids[iter_user]), os_type_STRING); ++ os_object_put(oa, "to", &i_true, os_type_BOOLEAN); ++ os_object_put(oa, "from", &i_true, os_type_BOOLEAN); ++ os_object_put(oa, "ask", &i_false, os_type_INTEGER); ++ ++ snprintf(filter, 4096, "(jid=%zu:%s)", strlen(jid_full(active_jids[iter_user])), jid_full(active_jids[iter_user])); ++ ++ log_debug(ZONE, "Adding roster-item, filter is %s", filter); ++ storage_replace(user->sm->st, "roster-items", jid_user(user->jid), filter, osa); ++ ++ os_free(osa); ++ osa = os_new(); ++ oa = os_object_new(osa); ++ ++ os_object_put(oa, "jid", jid_full(active_jids[iter_user]), os_type_STRING); ++ os_object_put(oa, "group", group_name, os_type_STRING); ++ ++ log_debug(ZONE, "Adding roster-group, filter is %s", filter); ++ storage_replace(user->sm->st, "roster-groups", jid_user(user->jid), filter, osa); ++ ++ os_free(osa); ++ } ++ } ++ ++ for (i = 0; i < num_active_users; i++) { ++ jid_free(active_jids[i]); ++ } ++ ++ return 0; ++} ++ ++DLLEXPORT int module_init(mod_instance_t mi, char *arg) { ++ module_t mod = mi->mod; ++ ++ if (mod->init) return 0; ++ ++ mod->user_load = _autobuddy_user_load; ++ ++ return 0; ++} diff --git a/apple_patch/pre_configure/jabberd2/sm/mod_roster.c.patch b/apple_patch/pre_configure/jabberd2/sm/mod_roster.c.patch new file mode 100644 index 00000000..ed356ac2 --- /dev/null +++ b/apple_patch/pre_configure/jabberd2/sm/mod_roster.c.patch @@ -0,0 +1,11 @@ +--- /tmp/jabberd-2.2.17/sm/mod_roster.c 2012-02-12 13:36:18.000000000 -0800 ++++ ./jabberd2/sm/mod_roster.c 2012-12-11 19:54:33.000000000 -0800 +@@ -460,7 +460,7 @@ static void _roster_set_item(pkt_t pkt, + log_debug(ZONE, "added %s to roster (to %d from %d ask %d name %s ngroups %d)", jid_full(item->jid), item->to, item->from, item->ask, item->name, item->ngroups); + + if (sm_storage_rate_limit(sess->user->sm, jid_user(sess->user->jid))) +- return -stanza_err_RESOURCE_CONSTRAINT; ++ return; + + /* save changes */ + _roster_save_item(sess->user, item); diff --git a/apple_patch/pre_configure/jabberd2/storage/storage_sqlite.c.patch b/apple_patch/pre_configure/jabberd2/storage/storage_sqlite.c.patch new file mode 100644 index 00000000..94fa54f2 --- /dev/null +++ b/apple_patch/pre_configure/jabberd2/storage/storage_sqlite.c.patch @@ -0,0 +1,108 @@ +--- jabberd-2.2.17/storage/storage_sqlite.c 2011-10-30 11:46:36.000000000 -0700 ++++ jabberd/storage/storage_sqlite.c 2013-06-19 13:18:39.000000000 -0700 +@@ -666,6 +666,97 @@ + return st_SUCCESS; + } + ++static st_ret_t _st_sqlite_get_custom_sql (st_driver_t drv, const char *request, os_t *os) { ++ drvdata_t data = (drvdata_t) drv->private; ++ int i; ++ unsigned int num_rows = 0; ++ os_object_t o; ++ const char *val; ++ os_type_t ot; ++ int ival; ++ ++ sqlite3_stmt *stmt; ++ int result; ++ ++ if (request == NULL) { ++ return st_NOTFOUND; ++ } ++ ++ log_debug (ZONE, "got prepared sql: %s", request); ++ ++ result = sqlite3_prepare (data->db, request, strlen(request), &stmt, NULL); ++ ++ if (result != SQLITE_OK) { ++ return st_FAILED; ++ } ++ ++ *os = os_new (); ++ ++ do { ++ ++ unsigned int num_cols; ++ ++ result = sqlite3_step (stmt); ++ ++ if (result != SQLITE_ROW) { ++ continue; ++ } ++ ++ o = os_object_new (*os); ++ num_cols = sqlite3_data_count (stmt); ++ ++ for (i = 0; i < num_cols; i++) { ++ ++ const char *colname; ++ int coltype; ++ ++ colname = sqlite3_column_name (stmt, i); ++ coltype = sqlite3_column_type (stmt, i); ++ ++ if (coltype == SQLITE_NULL) { ++ log_debug (ZONE, "coldata is NULL"); ++ continue; ++ } ++ ++ if (coltype == SQLITE_INTEGER) { ++ if (!strcmp (sqlite3_column_decltype (stmt, i), "BOOL")) { ++ ot = os_type_BOOLEAN; ++ } else { ++ ot = os_type_INTEGER; ++ } ++ ++ ival = sqlite3_column_int (stmt, i); ++ os_object_put (o, colname, &ival, ot); ++ ++ } else if (coltype == SQLITE3_TEXT) { ++ ot = os_type_STRING; ++ ++ val = sqlite3_column_text (stmt, i); ++ os_object_put (o, colname, val, ot); ++ ++ } else { ++ log_write (drv->st->log, ++ LOG_NOTICE, ++ "sqlite: unknown field: %s:%d", ++ colname, coltype); ++ } ++ } ++ ++ num_rows++; ++ ++ } while (result == SQLITE_ROW); ++ ++ sqlite3_finalize (stmt); ++ ++ if (num_rows == 0) { ++ os_free(*os); ++ *os = NULL; ++ return st_NOTFOUND; ++ } ++ ++ return st_SUCCESS; ++} ++ + static void _st_sqlite_free (st_driver_t drv) { + + drvdata_t data = (drvdata_t) drv->private; +@@ -726,6 +817,7 @@ + drv->get = _st_sqlite_get; + drv->delete = _st_sqlite_delete; + drv->replace = _st_sqlite_replace; ++ drv->get_custom_sql = _st_sqlite_get_custom_sql; + drv->free = _st_sqlite_free; + + return st_SUCCESS; diff --git a/apple_patch/pre_configure/jabberd2/tools/db-setup.sqlite.patch b/apple_patch/pre_configure/jabberd2/tools/db-setup.sqlite.patch index aeeecb24..2d37358c 100644 --- a/apple_patch/pre_configure/jabberd2/tools/db-setup.sqlite.patch +++ b/apple_patch/pre_configure/jabberd2/tools/db-setup.sqlite.patch @@ -1,6 +1,6 @@ ---- /tmp/jabberd-2.2.17/tools/db-setup.sqlite 2012-02-12 13:38:25.000000000 -0800 -+++ ./jabberd2/tools/db-setup.sqlite 2012-08-28 18:49:00.000000000 -0700 -@@ -52,6 +52,11 @@ CREATE TABLE "roster-items" ( +--- jabberd-2.2.17/tools/db-setup.sqlite 2012-02-12 13:38:25.000000000 -0800 ++++ jabberd/tools/db-setup.sqlite 2013-06-19 22:24:37.000000000 -0700 +@@ -52,6 +52,11 @@ CREATE INDEX i_rosteri_owner ON "roster-items"("collection-owner"); @@ -12,3 +12,16 @@ -- -- Roster groups -- Used by: mod_roster +@@ -240,3 +245,12 @@ + "last-login" INTEGER DEFAULT '0', + "last-logout" INTEGER DEFAULT '0', + "xml" TEXT ); ++ ++-- ++-- Apple: OD group GUIDs to enable autobuddy feature for ++-- Used by: mod_autobuddy ++-- ++CREATE TABLE "autobuddy-guids" ( ++ "guid" text NOT NULL, ++ "object-sequence" INTEGER PRIMARY KEY, ++ diff --git a/backup_restore/75-MessageServer.plist b/backup_restore/75-MessageServer.plist index d5a08aff..8a59b554 100644 --- a/backup_restore/75-MessageServer.plist +++ b/backup_restore/75-MessageServer.plist @@ -58,8 +58,8 @@ /Library/Server/Messages/Config/jabberd/*.xml /Library/Server/Messages/Config/jabberd/jabberd.cfg - /Library/Preferences/com.apple.messageserver.plist - /Library/Preferences/com.apple.Proxy65.plist + /Library/Server/Messages/Config/com.apple.messageserver.plist + /Library/Server/Messages/Config/com.apple.Proxy65.plist /Library/Server/Messages/Config/Rooms.plist diff --git a/backup_restore/MessageServer_backup b/backup_restore/MessageServer_backup index b172f0b9..c2e4e9c9 100755 --- a/backup_restore/MessageServer_backup +++ b/backup_restore/MessageServer_backup @@ -1,10 +1,13 @@ #!/usr/bin/perl -# Copyright (c) 2012 Apple Inc. All Rights Reserved. +# Author:: Apple Inc. +# Documentation:: Apple Inc. +# Copyright (c) 2012-2013 Apple Inc. All Rights Reserved. # # IMPORTANT NOTE: This file is licensed only for use on Apple-branded # computers and is subject to the terms and conditions of the Apple Software # License Agreement accompanying the package this file is a part of. # You may not port this file to another platform without Apple's written consent. +# License:: All rights reserved. ################################# Constants ################################# $ECHO = "/bin/echo"; @@ -12,7 +15,7 @@ $MKDIR = "/bin/mkdir"; $MKTEMP_PATH = "/usr/bin/mktemp"; $PBUDDY = "/usr/libexec/PlistBuddy"; $SQLITE = "/usr/bin/sqlite3"; -$TAR = "/usr/bin/gnutar"; +$TAR = "/usr/bin/tar"; $SBS_CONF = "/Applications/Server.app/Contents/ServerRoot/private/etc/server_backup"; $SBSProgressLogFile = "/private/var/log/server_backup/sbs_progress.log"; $tmpPath = "/private/var/jabberd/tmp"; @@ -137,9 +140,9 @@ sub Backup() } if ($VERBOSE) { - $cmd = "$TAR --ignore-failed-read -cvzf \"$configTarPath\""; + $cmd = "$TAR -cvzf \"$configTarPath\""; } else { - $cmd = "$TAR --ignore-failed-read -czf \"$configTarPath\""; + $cmd = "$TAR -czf \"$configTarPath\""; } foreach $confFile (@configurationFiles) { # Not quoting confFile- allow for wildcard expansion since there may be any number of sm.xml files @@ -208,10 +211,10 @@ sub Backup() chdir($origCWD); my $roomsDataTarPath = $SBS_PATH."/"."MessageServer_Rooms.data.tar.gz"; if ($VERBOSE) { - $cmd = "$TAR --ignore-failed-read -cpvzf \"$roomsDataTarPath\" \"$roomsDirPath\" \"$roomsLogDirPath\""; + $cmd = "$TAR -cpvzf \"$roomsDataTarPath\" \"$roomsDirPath\" \"$roomsLogDirPath\""; print "Executing command: $cmd\n"; } else { - $cmd = "$TAR --ignore-failed-read -cpzf \"$roomsDataTarPath\" \"$roomsDirPath\" \"$roomsLogDirPath\""; + $cmd = "$TAR -cpzf \"$roomsDataTarPath\" \"$roomsDirPath\" \"$roomsLogDirPath\""; } system($cmd); chdir($origCWD); @@ -319,10 +322,10 @@ sub Size() chomp($roomsLogDirPath); if ($VERBOSE) { - $cmd = "$TAR --ignore-failed-read -cvzf \"$dataTarPath\" \"$jabberDataTmpDir/$sqlFilePath\" \"$roomsDirPath\" \"$roomsLogDirPath\""; + $cmd = "$TAR -cvzf \"$dataTarPath\" \"$jabberDataTmpDir/$sqlFilePath\" \"$roomsDirPath\" \"$roomsLogDirPath\""; &_log($OUTPUT_PRINT, "Executing command: $cmd\n"); } else { - $cmd = "$TAR --ignore-failed-read -czf \"$dataTarPath\" \"$jabberDataTmpDir/$sqlFilePath\" \"$roomsDirPath\" \"$roomsLogDirPath\""; + $cmd = "$TAR -czf \"$dataTarPath\" \"$jabberDataTmpDir/$sqlFilePath\" \"$roomsDirPath\" \"$roomsLogDirPath\""; } system($cmd); my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat($dataTarPath); diff --git a/backup_restore/MessageServer_restore b/backup_restore/MessageServer_restore index 3c0af511..b9af9d40 100755 --- a/backup_restore/MessageServer_restore +++ b/backup_restore/MessageServer_restore @@ -1,16 +1,19 @@ #!/usr/bin/perl -# Copyright (c) 2012 Apple Inc. All Rights Reserved. +# Author:: Apple Inc. +# Documentation:: Apple Inc. +# Copyright (c) 2012-2013 Apple Inc. All Rights Reserved. # # IMPORTANT NOTE: This file is licensed only for use on Apple-branded # computers and is subject to the terms and conditions of the Apple Software # License Agreement accompanying the package this file is a part of. # You may not port this file to another platform without Apple's written consent. +# License:: All rights reserved. ################################# Constants ################################# $PBUDDY = "/usr/libexec/PlistBuddy"; $SQLITE = "/usr/bin/sqlite3"; $SERVER_ADMIN="/usr/sbin/serveradmin"; -$TAR = "/usr/bin/gnutar"; +$TAR = "/usr/bin/tar"; $SBS_CONF = "/Applications/Server.app/Contents/ServerRoot/private/etc/server_backup"; $MKTEMP_PATH = "/usr/bin/mktemp"; $ServiceConf = "75-MessageServer.plist"; @@ -179,9 +182,9 @@ sub Restore() } } if ($VERBOSE) { - $cmd = "$TAR --ignore-failed-read -cvzf /Library/Server/Messages/Config/jabberd/MessageServer_settings_before_restore.tar.gz"; + $cmd = "$TAR -cvzf /Library/Server/Messages/Config/jabberd/MessageServer_settings_before_restore.tar.gz"; } else { - $cmd = "$TAR --ignore-failed-read -czf /Library/Server/Messages/Config/jabberd/MessageServer_settings_before_restore.tar.gz"; + $cmd = "$TAR -czf /Library/Server/Messages/Config/jabberd/MessageServer_settings_before_restore.tar.gz"; } foreach my $configFile (@configurationFiles) { diff --git a/backup_restore/MessageServer_verify b/backup_restore/MessageServer_verify index c89531e0..bf9c645f 100755 --- a/backup_restore/MessageServer_verify +++ b/backup_restore/MessageServer_verify @@ -1,10 +1,13 @@ #!/usr/bin/perl -# Copyright (c) 2012 Apple Inc. All Rights Reserved. +# Author:: Apple Inc. +# Documentation:: Apple Inc. +# Copyright (c) 2012-2013 Apple Inc. All Rights Reserved. # # IMPORTANT NOTE: This file is licensed only for use on Apple-branded # computers and is subject to the terms and conditions of the Apple Software # License Agreement accompanying the package this file is a part of. # You may not port this file to another platform without Apple's written consent. +# License:: All rights reserved. ################################# Constants ################################# $DIFF = "/usr/bin/diff"; diff --git a/cfg-apple/s2s.xml b/cfg-apple/s2s.xml index 66abd854..f0dfed96 100644 --- a/cfg-apple/s2s.xml +++ b/cfg-apple/s2s.xml @@ -85,7 +85,7 @@ :: - 5269 + 0 :: - 5269 + 0 active + autobuddy roster roster-publish privacy diff --git a/cfg-apple/sm.xml.dist b/cfg-apple/sm.xml.dist index 6578d076..d3d0823d 100644 --- a/cfg-apple/sm.xml.dist +++ b/cfg-apple/sm.xml.dist @@ -479,6 +479,7 @@ before a session is created). --> active + autobuddy roster roster-publish privacy diff --git a/common_extras/70-message_server_common_extra.pl b/common_extras/70-message_server_common_extra.pl new file mode 100755 index 00000000..ee841618 --- /dev/null +++ b/common_extras/70-message_server_common_extra.pl @@ -0,0 +1,82 @@ +#!/usr/bin/perl +# Author:: Apple Inc. +# Documentation:: Apple Inc. +# Copyright (c) 2013 Apple Inc. All Rights Reserved. +# +# ChatServer +# 70-message_server_common_extra.pl +# +# IMPORTANT NOTE: This file is licensed only for use on Apple-branded +# computers and is subject to the terms and conditions of the Apple Software +# License Agreement accompanying the package this file is a part of. +# You may not port this file to another platform without Apple's written consent. + +# +# Copies the default jabberd and Rooms config files into /Library/Server during promotion +# + +use strict; +use warnings; + +my $PLISTBUDDY = '/usr/libexec/PlistBuddy'; +my $SQLITE3 = '/usr/bin/sqlite3'; +my $bundle_config_path = '/Library/Server/Messages/Config/com.apple.messageserver.plist'; +my $bundle_config_path_obsolete = '/Library/Preferences/com.apple.messageserver.plist'; +my $default_database_location = '/Library/Server/Messages/Data/sqlite/jabberd2.db'; + +# If this is a migration, the MigrationExtra will have done everything necessary. +if ( -d "/Library/Server/Previous/Library/Server/iChat" || -d "/Library/Server/Previous/private/var/jabberd" ) { + print "Appears to be a migration; nothing to do.\n"; + exit 0; +} + +# Install template config files +system '/Applications/Server.app/Contents/ServerRoot/usr/libexec/copy_message_server_config_files.sh'; + +# Update any existing database +my $database_location = $default_database_location; + +my $bundle_config; +if (-e $bundle_config_path) { + $bundle_config = $bundle_config_path; +} +elsif (-e $bundle_config_path_obsolete) { + # Updating from an older build + $bundle_config = $bundle_config_path_obsolete; +} + +if (defined $bundle_config) { + my $database_location = qx(${PLISTBUDDY} -c "Print :jabberdDatabasePath" "${bundle_config}"); + chomp $database_location; + if (! -e $database_location) { + print "Error: found bundle config file, but could not find database"; + $database_location = $default_database_location; + } +} + +if (! -e $database_location) { + # Most likely a fresh install + exit 0; +} + +# Create the autobuddy-guids table, new for +my $ret = qx { $SQLITE3 $database_location "SELECT name FROM sqlite_master WHERE type='table' AND name='autobuddy-guids';" }; +chomp $ret; +if ($ret ne 'autobuddy-guids') { + my $SQLITE; + $ret = open $SQLITE, "|$SQLITE3 \"$database_location\""; + unless ($ret) { + print "Error, could not open database file \"$database_location\" using $SQLITE3 : $!"; + exit 1; + } + + print $SQLITE <<"EOF"; +CREATE TABLE "autobuddy-guids" ( + "guid" TEXT NOT NULL, + "object-sequence" INTEGER PRIMARY KEY ); +EOF + close $SQLITE || print "Error, $SQLITE3 returned an error. Adding new tables to jabberd database possibly failed."; +} + +system '/Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin', 'settings', 'jabber'; +exit 0; \ No newline at end of file diff --git a/initialization/copy_message_server_config_files.sh b/initialization/copy_message_server_config_files.sh index c1207157..cfa9fd08 100755 --- a/initialization/copy_message_server_config_files.sh +++ b/initialization/copy_message_server_config_files.sh @@ -1,15 +1,15 @@ #!/bin/sh - -# initialize_message_server.sh +# Author:: Apple Inc. +# Documentation:: Apple Inc. +# Copyright (c) 2012-2013 Apple Inc. All Rights Reserved. +# # ChatServer - -# Copyright (c) 2012 Apple Inc. All Rights Reserved. +# initialize_message_server.sh # # IMPORTANT NOTE: This file is licensed only for use on Apple-branded # computers and is subject to the terms and conditions of the Apple Software # License Agreement accompanying the package this file is a part of. # You may not port this file to another platform without Apple's written consent. - # # Copies the default jabberd and Rooms config files into /Library/Server during promotion or migration # @@ -55,4 +55,5 @@ echo "Copying Message Server configuration files into $ConfigDir..." /usr/sbin/chown _jabber:_jabber "$ConfigDir/Rooms.plist" /bin/chmod 660 "$ConfigDir/Rooms.plist" /bin/rm -f /Library/Preferences/com.apple.Proxy65.plist +/bin/rm -f /Library/Server/Messages/Config/com.apple.Proxy65.plist echo "Finished." diff --git a/jabber_autobuddy/JABDatabase.h b/jabber_autobuddy/JABDatabase.h index 1f114f96..0496ad36 100644 --- a/jabber_autobuddy/JABDatabase.h +++ b/jabber_autobuddy/JABDatabase.h @@ -54,7 +54,10 @@ typedef struct sqlite3 sqlite3; - (BOOL) verifyActiveJid: (NSString *) aJid expectedResult: (BOOL) expected; - (void) insertActiveItemForOwner: (NSString *) ownerJid source: (const char *) source line: (int) line; - +- (void) insertAutobuddyGroupGuidForGuid: (NSString *) guid source: (const char *) source line: (int) line; +- (BOOL) verifyAutobuddyGuidForGuid: (NSString *) guid source: (const char *) source line: (int) line; +- (void) deleteAutobuddyGroupGuidForGuid: (NSString *) guid + source: (const char *) source line: (int) line; - (void) insertVcardItemForOwner: (NSString *) ownerJid source: (const char *) source line: (int) line; - (BOOL) verifyRosterItemForOwner: (NSString *) ownerJid andBuddy: (NSString *) ownerJid; diff --git a/jabber_autobuddy/JABDatabase.m b/jabber_autobuddy/JABDatabase.m index f3801721..4bce0e31 100644 --- a/jabber_autobuddy/JABDatabase.m +++ b/jabber_autobuddy/JABDatabase.m @@ -3,7 +3,7 @@ // ChatServer/jabber_autobuddy // // Created by Steve Peralta on 8/8/08. -// Copyright 2008 Apple. All rights reserved. +// Copyright 2008-2013 Apple. All rights reserved. // #import "JABDatabase.h" @@ -15,11 +15,14 @@ #define JABBER_DB_PATH_DEFAULT @"/Library/Server/Messages/Data/sqlite/jabberd2.db" #define JABBER_DB_FILENAME_DEFAULT @"jabberd2.db" -#define SRVRMGR_JABBER_PREFS_PATH @"/Library/Preferences/com.apple.messageserver.plist" +#define SRVRMGR_JABBER_PREFS_PATH @"/Library/Server/Messages/Config/com.apple.messageserver.plist" #define SMJ_SETTINGSKEY_JABBERD_DB_PATH @"jabberdDatabasePath" #define QRY_SEL_OWNER_FROM_ACTIVE @"select \"collection-owner\" from active where \"collection-owner\" = \"%@\"" #define QRY_INS_OWNER_INTO_ACTIVE @"insert into active (\"collection-owner\", \"time\") values (\"%@\", \"%d\")" +#define QRY_INS_GUID_INTO_AUTOBUDDY_GUIDS @"insert into \"autobuddy-guids\" (\"guid\") values (\"%@\")" +#define QRY_SEL_GUID_FROM_AUTOBUDDY_GUIDS_MATCHING_GUID @"select \"guid\" from \"autobuddy-guids\" where \"guid\" = \"%@\"" +#define QRY_DEL_GUID_FROM_AUTOBUDDY_GUIDS_MATCHING_GUID @"delete from \"autobuddy-guids\" where \"guid\" = \"%@\"" #define QRY_INS_OWNER_INTO_VCARD @"insert into vcard (\"collection-owner\", \"fn\", \"nickname\", \"url\", \"tel\", \"email\", \"jabberid\", \"mailer\", \"title\",\"role\", \"bday\", \"tz\", \"n-family\", \"n-given\", \"n-middle\", \"n-prefix\", \"n-suffix\", \"adr-street\", \"adr-extadd\", \"adr-pobox\", \"adr-locality\", \"adr-region\", \"adr-pcode\", \"adr-country\", \"geo-lat\", \"geo-lon\", \"org-orgname\", \"org-orgunit\", \"agent-extval\", \"sort-string\", \"desc\", \"note\", \"uid\", \"photo-type\", \"photo-binval\", \"photo-extval\", \"logo-type\", \"logo-binval\", \"logo-extval\", \"sound-phonetic\", \"sound-binval\", \"sound-extval\", \"key-type\", \"key-cred\", \"rev\") values (\"%@\", NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)" @@ -272,6 +275,86 @@ - (void) insertActiveItemForOwner: (NSString *) ownerJid source: (const char *) [_dbQuery finalizeStatement]; } +//------------------------------------------------------------------------------ +- (void) insertAutobuddyGroupGuidForGuid: (NSString *) guid + source: (const char *) source line: (int) line +{ + self.dbResult = SQLITE_OK; + + [_dbQuery setQueryText: [NSString stringWithFormat: + QRY_INS_GUID_INTO_AUTOBUDDY_GUIDS, + guid]]; + if (![_dbQuery startStatementForSource: source line: line]) + return; // query creation failed -- abort + + [_dbQuery stepStatement]; + [self checkQueryStatus: _dbQuery source: source line: line]; +#ifdef DEBUG + if (SQLITE_ERROR != _dbResult) + [_dbAction recordActivity: DBActivityActiveRowInsert]; +#endif + + [_dbQuery finalizeStatement]; +} + +//------------------------------------------------------------------------------ +- (void) deleteAutobuddyGroupGuidForGuid: (NSString *) guid + source: (const char *) source line: (int) line +{ + self.dbResult = SQLITE_OK; + + [_dbQuery setQueryText: [NSString stringWithFormat: + QRY_DEL_GUID_FROM_AUTOBUDDY_GUIDS_MATCHING_GUID, + guid]]; + if (![_dbQuery startStatementForSource: source line: line]) + return; // query creation failed -- abort + + [_dbQuery stepStatement]; + [self checkQueryStatus: _dbQuery source: source line: line]; +#ifdef DEBUG + if (SQLITE_ERROR != _dbResult) + [_dbAction recordActivity: DBActivityActiveRowDelete]; +#endif + + [_dbQuery finalizeStatement]; +} + +//------------------------------------------------------------------------------ +- (BOOL) verifyAutobuddyGuidForGuid: (NSString *) guid + source: (const char *) source line: (int) line +{ + self.dbResult = SQLITE_OK; + + BOOL bExists = NO; + + [_dbQuery setQueryText: [NSString stringWithFormat: + QRY_SEL_GUID_FROM_AUTOBUDDY_GUIDS_MATCHING_GUID, + guid]]; + if (![_dbQuery startStatementForSource: source line: line]) + return NO; // query creation failed -- abort + [_dbQuery stepStatement]; // execute query + self.dbResult = [_dbQuery queryResult]; + switch (_dbResult) { + case SQLITE_ROW: + bExists = YES; + break; + case SQLITE_DONE: + case SQLITE_OK: + break; + default: + [_dbAction logUnknownQueryStatusErrorForSource: source line: line]; + self.dbResult = SQLITE_ERROR; + } // switch + [_dbQuery finalizeStatement]; + +#ifdef DEBUG + if (SQLITE_ERROR != _dbResult) + [_dbAction recordActivity: DBActivityAutobuddyGuidRowVerify]; +#endif + + return bExists; +} + #pragma mark - //------------------------------------------------------------------------------ - (void) insertVcardItemForOwner: (NSString *) ownerJid source: (const char *) source line: (int) line diff --git a/jabber_autobuddy/JABDatabaseAction.h b/jabber_autobuddy/JABDatabaseAction.h index 260b08a9..926cf7a4 100644 --- a/jabber_autobuddy/JABDatabaseAction.h +++ b/jabber_autobuddy/JABDatabaseAction.h @@ -3,7 +3,7 @@ // ChatServer/jabber_autobuddy // // Created by Steve Peralta on 7/16/08. -// Copyright 2008 Apple. All rights reserved. +// Copyright 2008-2013 Apple. All rights reserved. // #import "JABAction.h" @@ -23,6 +23,9 @@ enum { DBActivityRosterGroupsRowInsert, DBActivityRosterGroupsRowDelete, DBActivityMatchedRowUpdate, + DBActivityAutobuddyGuidRowSelect, + DBActivityAutobuddyGuidRowDelete, + DBActivityAutobuddyGuidRowVerify, DBActivityNumTypes // must be last item in enum } DatabaseActivityType; diff --git a/jabber_autobuddy/JABDatabaseAction.m b/jabber_autobuddy/JABDatabaseAction.m index 666fd08d..13f86f85 100644 --- a/jabber_autobuddy/JABDatabaseAction.m +++ b/jabber_autobuddy/JABDatabaseAction.m @@ -3,7 +3,7 @@ // ChatServer/jabber_autobuddy // // Created by Steve Peralta on 7/16/08. -// Copyright 2008 Apple. All rights reserved. +// Copyright 2008-2013 Apple. All rights reserved. // #import "JABDatabaseAction.h" @@ -37,6 +37,9 @@ {DBActivityRosterGroupsRowInsert, "INSERT ROSTER-GROUPS"}, {DBActivityRosterGroupsRowDelete, "DELETE ROSTER-GROUPS"}, {DBActivityMatchedRowUpdate, "UPDATE MATCHED ROWS"}, + {DBActivityAutobuddyGuidRowSelect, "SELECT AUTOBUDDY-GUIDS"}, + {DBActivityAutobuddyGuidRowDelete, "DELETE AUTOBUDDY-GUIDS"}, + {DBActivityAutobuddyGuidRowVerify, "VERIFY AUTOBUDDY-GUIDS"}, {DBActivityUnknown, NULL} // END OF TABLE }; diff --git a/jabber_autobuddy/JABMakeGroupBuddiesByGuidAction.h b/jabber_autobuddy/JABMakeGroupBuddiesByGuidAction.h index 4e048d07..4dd78e02 100644 --- a/jabber_autobuddy/JABMakeGroupBuddiesByGuidAction.h +++ b/jabber_autobuddy/JABMakeGroupBuddiesByGuidAction.h @@ -2,26 +2,23 @@ // JABMakeGroupBuddiesByGuidAction.h // ChatServer/jabber_autobuddy // -// Copyright 2010 Apple. All rights reserved. +// Copyright 2010-2013 Apple. All rights reserved. // #import -#import "JABMakeAllBuddiesAction.h" -#import "JABDirectory.h" +#import "JABDatabaseAction.h" -@interface JABMakeGroupBuddiesByGuidAction : JABMakeAllBuddiesAction { +@interface JABMakeGroupBuddiesByGuidAction : JABDatabaseAction { NSString *_groupGuid; // GeneratedUID of OD group for JID membership - JABDirectory *_jabDir; } @property(retain,readwrite) NSString *groupGuid; -@property(retain,readwrite) JABDirectory *jabDir; - (id) initWithCommandOptions: (NSDictionary *) cmdOpts; - (void) dealloc; -- (void) addRosterItemForOwner: (NSString *) ownerJid andBuddy: (NSString *) buddyJid; -- (BOOL) verifyGroupMembershipForOwner: (NSString *) ownerJid andBuddy: (NSString *) buddyJid; -- (BOOL) isGroupMemberJid: (NSString *) aJid; +- (BOOL) requiresJid; +- (void) doDBAction; + @end diff --git a/jabber_autobuddy/JABMakeGroupBuddiesByGuidAction.m b/jabber_autobuddy/JABMakeGroupBuddiesByGuidAction.m index 026838a4..8d6e6f9d 100644 --- a/jabber_autobuddy/JABMakeGroupBuddiesByGuidAction.m +++ b/jabber_autobuddy/JABMakeGroupBuddiesByGuidAction.m @@ -1,28 +1,15 @@ // -// JABMakeGroupBuddiesByGuidAction.m +// // ChatServer/jabber_autobuddy // -// Copyright 2010 Apple. All rights reserved. +// Copyright 2010-2013 Apple. All rights reserved. // #import "JABMakeGroupBuddiesByGuidAction.h" -#import "JABAddRosterUserAction.h" - -#include -#include -#include - -enum { - RosterGroupAction_None = 0, - RosterGroupAction_Add, - RosterGroupAction_Delete -}; - @implementation JABMakeGroupBuddiesByGuidAction @synthesize groupGuid = _groupGuid; -@synthesize jabDir = _jabDir; //------------------------------------------------------------------------------ - (id) initWithCommandOptions: (NSDictionary *) cmdOpts @@ -30,144 +17,35 @@ - (id) initWithCommandOptions: (NSDictionary *) cmdOpts self = [super initWithCommandOptions: cmdOpts]; self.groupGuid = [cmdOpts objectForKey: CMDOPT_KEY_GROUPGUID]; - self.jabDir = [JABDirectory jabDirectoryWithScope: DIRECTORYSCOPE_SEARCH]; return self; } - (void) dealloc { self.groupGuid = nil; - self.jabDir = nil; [super dealloc]; } //------------------------------------------------------------------------------ -- (void) addRosterItemForOwner: (NSString *) ownerJid andBuddy: (NSString *) buddyJid +- (BOOL) requiresJid { - // Create a roster-group entry for the pair - - // set up an local autorelease pool to limit high-water memory usage - NSAutoreleasePool *aPool = [[NSAutoreleasePool alloc] init]; - - do { // not a loop - if (nil == _jabDir) - return; - - // check group membership for pair - BOOL bAreMembers = [self verifyGroupMembershipForOwner: ownerJid - andBuddy: buddyJid]; - - uuid_t group_uuid; - uuid_parse([_groupGuid UTF8String], group_uuid); - char *group_uuid_string = (char *)malloc(MAXLOGNAME); - if (0 != mbr_uuid_to_string(group_uuid, group_uuid_string)) { - [_logger logInfo: [NSString stringWithFormat: @"Failed to find group name for group UUID: %@", _groupGuid]]; - free(group_uuid_string); - return; - } - NSString *groupName = [_jabDir findGroupNameForGeneratedUID: - [NSString stringWithCString: group_uuid_string encoding: NSUTF8StringEncoding]]; - free(group_uuid_string); - - if (nil == groupName) { - [_logger logInfo: [NSString stringWithFormat: @"Failed to find group name for group UUID: %@", _groupGuid]]; - return; - } - - // check if the pairing exists in our special auto-add group - BOOL bExists = [_database verifyRosterGroup: groupName - forOwner: ownerJid - andBuddy: buddyJid]; - if (![self checkDatabaseStatus]) - break; // operation failed -- abort processing - - // Select the roster-groups/roster-items action to be taken - NSInteger iRGAction = RosterGroupAction_None; - if (bAreMembers && !bExists) // members that need to be added - iRGAction = RosterGroupAction_Add; - else if (!bAreMembers && bExists) // non-member that need to be removed - iRGAction = RosterGroupAction_Delete; - - // Execute the action - switch (iRGAction) { - case RosterGroupAction_Add: - // Use base-class to handle creation of roster-item pair - [super addRosterItemForOwner: ownerJid andBuddy: buddyJid]; - if (OPRESULT_OK != self.result) break; // query failed -- abort - // add the roster-group entry for the new roster-item - // NOTE: it is not necessary to perform the reverse pairing here - // as it will will be performed when the buddyJid becomes - // the ownerJid in a later iteration. - [_database insertRosterGroup: groupName - forOwner: ownerJid - andBuddy: buddyJid - source: __PRETTY_FUNCTION__ - line: __LINE__]; - [self checkDatabaseStatus]; - break; // done - case RosterGroupAction_Delete: - // Pairings outside the group are automatically removed ONLY IF - // they also exist in the roster-groups table. This extra check - // reduces the possibility of deleting user-added buddy pairings. - [_database deleteRosterGroup: groupName - forOwner: ownerJid - andBuddy: buddyJid - source: __PRETTY_FUNCTION__ - line: __LINE__]; - if (![self checkDatabaseStatus]) break; // operation failed -- abort processing - // ...and remove the roster-item - [_database deleteRosterItemForOwner: ownerJid - andBuddy: buddyJid - source: __PRETTY_FUNCTION__ - line: __LINE__]; - [self checkDatabaseStatus]; - break; // done - - default: ; // no action required - } // switch - - } while (0); // not a loop - - [aPool drain]; -} - -//------------------------------------------------------------------------------ -- (BOOL) verifyGroupMembershipForOwner: (NSString *) ownerJid andBuddy: (NSString *) buddyJid -{ - // verify group membership for both parties - if (![self isGroupMemberJid: ownerJid]) - return NO; - return [self isGroupMemberJid: buddyJid]; + return NO; } //------------------------------------------------------------------------------ -- (BOOL) isGroupMemberJid: (NSString *) aJid +- (void) doDBAction { - // Isolate the user name from the jid and verify that it's a directory user - NSString *userName = [[aJid componentsSeparatedByString: @"@"] objectAtIndex: 0]; - if (nil == userName) { - [self logMalformedJidError: aJid]; - self.result = OPRESULT_FAILED; - return NO; + // Add an entry to the 'autobuddy-guids' table for each user in the given group. + // The user's roster will be updated by jabberd the next time they log in. + if (! [_database verifyAutobuddyGuidForGuid: _groupGuid + source: __PRETTY_FUNCTION__ + line: __LINE__]) + { + [_database insertAutobuddyGroupGuidForGuid: _groupGuid + source: __PRETTY_FUNCTION__ + line: __LINE__]; } - - // Figure if user (short name) is member of asked group (GUID). - if ([userName UTF8String] == NULL || [_groupGuid UTF8String] == NULL) - return NO; - - uuid_t user_uuid; - if (0 != mbr_user_name_to_uuid([userName UTF8String], user_uuid)) - return NO; - - uuid_t group_uuid; - uuid_parse([_groupGuid UTF8String], group_uuid); - - int isMember; - if (0 != mbr_check_membership(user_uuid, group_uuid, &isMember)) - return NO; - - return (0 != isMember); } -@end +@end \ No newline at end of file diff --git a/jabber_autobuddy/JABRemoveGroupBuddiesByGuidAction.m b/jabber_autobuddy/JABRemoveGroupBuddiesByGuidAction.m index 08d2fb78..afaa3095 100644 --- a/jabber_autobuddy/JABRemoveGroupBuddiesByGuidAction.m +++ b/jabber_autobuddy/JABRemoveGroupBuddiesByGuidAction.m @@ -8,6 +8,7 @@ #import "JABRemoveGroupBuddiesByGuidAction.h" #import "JABDatabaseQuery.h" #include +#include @implementation JABRemoveGroupBuddiesByGuidAction @@ -116,6 +117,10 @@ - (void) doDBAction } // while ownerJid [_activeQuery1 finalizeStatement]; + + [_database deleteAutobuddyGroupGuidForGuid: _groupGuid + source: __PRETTY_FUNCTION__ + line: __LINE__]; } @end diff --git a/migration/58_jabbermigrator.pl b/migration/58_jabbermigrator.pl index 04c34ad8..a35b066b 100755 --- a/migration/58_jabbermigrator.pl +++ b/migration/58_jabbermigrator.pl @@ -1,11 +1,16 @@ -#!/usr/bin/perl -w -# Copyright (c) 2010-2012 Apple Inc. All Rights Reserved. +#!/usr/bin/perl +# +# 58_jabbermigrator.pl +# +# Author:: Apple Inc. +# Documentation:: Apple Inc. +# Copyright (c) 2010-2013 Apple Inc. All Rights Reserved. # # IMPORTANT NOTE: This file is licensed only for use on Apple-branded # computers and is subject to the terms and conditions of the Apple Software # License Agreement accompanying the package this file is a part of. # You may not port this file to another platform without Apple's written consent. - +# License:: All rights reserved. ## Migration Script for Message Server ################## Input Parameters ####################### @@ -13,10 +18,7 @@ # --sourceRoot The path to the root of the system to migrate # --sourceType Gives the type of the migration source, whether it's a runnable system or a # Time Machine backup. -# --sourceVersion The version number of the old system (like 10.6.x or 10.7). Since we support migration from 10.6, -# 10.7, and other 10.8 installs, it's useful to know this information, and it would be easier for me to figure -# it out once and pass it on to each script than to have each script have to figure it out itself. -# --targetRoot The path to the root of the new system. Pretty much always "/" +# --sourceVersion The version number of the old system (like 10.6.x or 10.7). # --language A language identifier, such as \"en.\" Long running scripts should return a description of what they're doing # (\"Migrating Open Directory users\"), and possibly provide status update messages along the way. These messages # need to be localized (which is not necessarily the server running the migration script). @@ -75,6 +77,7 @@ BEGIN my $g_sqlite_db_path = "/Library/Server/Messages/Data/sqlite/jabberd2.db"; my $g_bundle_config_path_pre_10_8 = "/Library/Preferences/com.apple.ichatserver.plist"; my $g_bundle_config_path = "/Library/Preferences/com.apple.messageserver.plist"; +my $g_bundle_config_path_new = "/Library/Server/Messages/Config/com.apple.messageserver.plist"; my $g_system_plist_path = "/System/Library/CoreServices/SystemVersion.plist"; my $g_server_plist_path = "/System/Library/CoreServices/ServerVersion.plist"; my $g_launchd_config_path_jabberd = "/Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/org.jabber.jabberd.plist"; @@ -88,7 +91,7 @@ BEGIN my $g_purge = "0"; # Default is don't purge my $g_source_root = "/Previous System"; my $g_source_type = ""; -my $g_source_version = ""; # This is the version number of the old system passed into us by Server Assistant. [10.5.x, 10.6.x, or 10.7.x] +my $g_source_version = ""; # This is the version number of the old system passed into us by Server Assistant. [10.6.x, 10.7.x, or 10.8.x] my $g_target_root = "/"; my $g_language = "en"; # Should be Tier-0 only in iso format [en, fr, de, ja], we default this to English, en. my $g_status = 0; # 0 = success, > 0 on failure @@ -100,16 +103,12 @@ BEGIN my $FUNC_LOG = 0; ############################## Version Consts ############################## -my $SYS_VERS = "0"; #10.6.x -my $SYS_MAJOR = "0"; #10 -my $SYS_MINOR = "0"; # 6 -my $SYS_UPDATE = "-"; #11 my $SRV_VERS = "0"; #10.6.x my $SRV_MAJOR = "0"; #10 my $SRV_MINOR = "0"; # 6 -my $SRV_UPDATE = "-"; #8 +my $SRV_UPDATE = "-"; # 8 my $MINVER = "10.6"; # => 10.6 -my $MAXVER = "10.8"; # < 10.8 +my $MAXVER = "10.9"; # <= 10.9 if ( (defined($ENV{DEBUG})) && ($ENV{DEBUG} eq 1) ) {$DEBUG = '1';} if ( (defined($ENV{FUNC_LOG})) && ($ENV{FUNC_LOG} eq 1) ) {$FUNC_LOG = '1';} @@ -224,7 +223,7 @@ () my $ret; - #10.6,10.7,10.8 -> 10.8 migration + #10.6,10.7,10.8,10.9 -> 10.9 migration # Configs if ($DEBUG) { if (${SRV_MINOR} eq "6" || ${SRV_MINOR} eq "7") { @@ -319,6 +318,19 @@ () EOF close(SQLITE) || &log_message("Error, $SQLITE3 returned an error. Adding new tables to jabberd database possibly failed."); } + + # For all upgrades, add the autobuddy group GUIDs table + $ret = open(SQLITE, "|$SQLITE3 \"${effective_target_root}${g_sqlite_db_path}\""); + unless ($ret) { + &log_message("Error, could not open database file \"${effective_target_root}${g_sqlite_db_path}\" using $SQLITE3 : $!"); + last; + } + print SQLITE <<"EOF"; +CREATE TABLE "autobuddy-guids" ( + "guid" TEXT NOT NULL, + "object-sequence" INTEGER PRIMARY KEY ); +EOF + close(SQLITE) || &log_message("Error, $SQLITE3 returned an error. Adding new table to jabberd database possibly failed."); }} while (0); # not a loop # Handle mu-conference -> Rooms migration (persistent room configuration files) @@ -363,7 +375,7 @@ () } } }} while (0); # not a loop - } elsif (${SRV_MINOR} eq "8") { + } elsif (${SRV_MINOR} eq "8" || ${SRV_MINOR} eq "9") { do {{ # not a loop # Rooms -> Rooms @@ -404,7 +416,7 @@ () } - my $target_archive_dir = qx(${PLISTBUDDY} -c "Print :savedChatsLocation" "${g_target_root}${g_bundle_config_path}"); + my $target_archive_dir = qx(${PLISTBUDDY} -c "Print :savedChatsLocation" "${g_target_root}${g_bundle_config_path_new}"); chomp($target_archive_dir); if (! -e $target_archive_dir) { &log_message("Could not locate target directory for message archive migration"); @@ -509,7 +521,7 @@ () &log_message("ensure_message_server_initialized := S"); if (-e $g_bundle_config_path) { - my $message_server_initialized = qx(${PLISTBUDDY} -c "Print :initialized" "${g_bundle_config_path}"); + my $message_server_initialized = qx(${PLISTBUDDY} -c "Print :initialized" "${g_bundle_config_path_new}"); chomp($message_server_initialized); if ($message_server_initialized eq "true") { &log_message("Already initialized"); @@ -527,7 +539,7 @@ () &log_message("getState returned: $ret"); if (-e $g_bundle_config_path) { - my $message_server_initialized = qx(${PLISTBUDDY} -c "Print :initialized" "${g_bundle_config_path}"); + my $message_server_initialized = qx(${PLISTBUDDY} -c "Print :initialized" "${g_bundle_config_path_new}"); chomp($message_server_initialized); if ($message_server_initialized ne "true") { &log_message("Error: Cannot initialize service"); @@ -602,7 +614,7 @@ () $valid = 1; &migrate_upgrade(); } else { - print("Did not supply a valid version for the --sourceVersion parameter, needs to be >= 10.6.0 and <= 10.8.x\n"); + print("Did not supply a valid version for the --sourceVersion parameter, needs to be >= 10.6.0 and <= 10.9.x\n"); &usage(); exit(1); } } else { @@ -627,9 +639,7 @@ () print("--sourceRoot The path to the root of the system to migrate" . "\n"); print("--sourceType Gives the type of the migration source, whether it's a runnable system or a " . "\n"); print(" Time Machine backup." . "\n"); - print("--sourceVersion The version number of the old system (like 10.6.x or 10.7). Since we support migration from 10.6, " . "\n"); - print(" 10.7, and other 10.8 installs, it's useful to know this information, and it would be easier for me to figure " . "\n"); - print(" it out once and pass it on to each script than to have each script have to figure it out itself." . "\n"); + print("--sourceVersion The version number of the old system" . "\n"); print("--targetRoot The path to the root of the new system. Pretty much always \"\/\"" . "\n"); print("--language A language identifier, such as \"en.\" Long running scripts should return a description of what they're doing" . "\n"); print(" (\"Migrating Open Directory users\"), and possibly provide status update messages along the way. These messages" . "\n"); diff --git a/migration/jabber_config_migrator.pl b/migration/jabber_config_migrator.pl index 8eed7f1e..f1f846e1 100755 --- a/migration/jabber_config_migrator.pl +++ b/migration/jabber_config_migrator.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# Copyright (c) 2009-2012 Apple Inc. All Rights Reserved. +# Copyright (c) 2009-2013 Apple Inc. All Rights Reserved. # # IMPORTANT NOTE: This file is licensed only for use on Apple-branded # computers and is subject to the terms and conditions of the Apple Software diff --git a/migration/jabber_data_migrate_2.0-2.2.pl b/migration/jabber_data_migrate_2.0-2.2.pl index b774008a..22c1d2df 100755 --- a/migration/jabber_data_migrate_2.0-2.2.pl +++ b/migration/jabber_data_migrate_2.0-2.2.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# Copyright (c) 2012 Apple Inc. All Rights Reserved. +# Copyright (c) 2012-2013 Apple Inc. All Rights Reserved. # # IMPORTANT NOTE: This file is licensed only for use on Apple-branded # computers and is subject to the terms and conditions of the Apple Software diff --git a/modules/filetransfer/proxy65.py b/modules/filetransfer/proxy65.py index c30c7f91..25b17843 100644 --- a/modules/filetransfer/proxy65.py +++ b/modules/filetransfer/proxy65.py @@ -27,7 +27,7 @@ ------------------------------------------------------------------------- -Portions Copyright 2008-2012 Apple, Inc. All rights reserved. +Portions Copyright 2008-2013 Apple, Inc. All rights reserved. """ import os import sys, socket @@ -44,7 +44,7 @@ raise ImportError("Import failed for twisted 10.2 workaround") import socks5 -configPath = '/Library/Preferences/com.apple.Proxy65.plist'; +configPath = '/Library/Server/Messages/Config/com.apple.Proxy65.plist'; config = {'jid':'', 'secret':'', 'rhost':'', diff --git a/promotion/70-message_server_promotion.sh b/promotion/70-message_server_promotion.sh deleted file mode 100755 index 69203102..00000000 --- a/promotion/70-message_server_promotion.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# 70-message_server_promotion.sh -# ChatServer - -# Copyright (c) 2012 Apple Inc. All Rights Reserved. -# -# IMPORTANT NOTE: This file is licensed only for use on Apple-branded -# computers and is subject to the terms and conditions of the Apple Software -# License Agreement accompanying the package this file is a part of. -# You may not port this file to another platform without Apple's written consent. - -# -# Copies the default jabberd and Rooms config files into /Library/Server during promotion -# - -/Applications/Server.app/Contents/ServerRoot/usr/libexec/copy_message_server_config_files.sh diff --git a/restore_extras/75_MessageServerRestoreExtra.pl b/restore_extras/75_MessageServerRestoreExtra.pl index a17779e5..37910f73 100755 --- a/restore_extras/75_MessageServerRestoreExtra.pl +++ b/restore_extras/75_MessageServerRestoreExtra.pl @@ -1,10 +1,13 @@ #!/usr/bin/perl -w -# Copyright (c) 2012 Apple Inc. All Rights Reserved. +# Author:: Apple Inc. +# Documentation:: Apple Inc. +# Copyright (c) 2012-2013 Apple Inc. All Rights Reserved. # # IMPORTANT NOTE: This file is licensed only for use on Apple-branded # computers and is subject to the terms and conditions of the Apple Software # License Agreement accompanying the package this file is a part of. # You may not port this file to another platform without Apple's written consent. +# License:: All rights reserved. # # 75_MessageServerRestoreExtra.pl # RestoreExtra script for Message Server @@ -17,7 +20,7 @@ use File::Path 'rmtree'; use XML::Simple; -my $TAR = "/usr/bin/gnutar"; +my $TAR = "/usr/bin/tar"; my $MKDIR = "/bin/mkdir"; my $MKTEMP_PATH = "/usr/bin/mktemp"; my $SQLITE = "/usr/bin/sqlite3";