[asterisk-commits] pabelanger: branch pabelanger/non-root r278907 - in /team/pabelanger/non-root...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 23 09:44:10 CDT 2010


Author: pabelanger
Date: Fri Jul 23 09:44:06 2010
New Revision: 278907

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=278907
Log:
Resolve and reset merge.

Merged revisions 278873,278875 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r278873 | pabelanger | 2010-07-23 09:26:41 -0400 (Fri, 23 Jul 2010) | 17 lines
  
  Portability updates for Makefiles.
  
  When possible, use $(INSTALL).  This allows us to use the functionality within
  install for setting directory / file permissions, a requirement for unprivileged
  installation.
  
  Also move any directory we plan to create within the installdirs macro. Plus
  various other formatting issues.
  
  (issue #17436)
  Reported by: pabelanger
  Patches:
        non-root.patch.v8 uploaded by pabelanger (license 224)
  Tested by: pabelanger
  
  Review: https://reviewboard.asterisk.org/r/654/
........
  r278875 | oej | 2010-07-23 09:37:17 -0400 (Fri, 23 Jul 2010) | 6 lines
  
  Minor corrections to the LDAP realtime driver
  
  Review: https://reviewboard.asterisk.org/r/798/
  
  Thanks Mark for a quick review!
........

Modified:
    team/pabelanger/non-root/   (props changed)
    team/pabelanger/non-root/Makefile
    team/pabelanger/non-root/res/res_config_ldap.c
    team/pabelanger/non-root/sounds/Makefile

Propchange: team/pabelanger/non-root/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/pabelanger/non-root/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jul 23 09:44:06 2010
@@ -1,1 +1,1 @@
-/trunk:1-278863
+/trunk:1-278863,278873-278875

Modified: team/pabelanger/non-root/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/non-root/Makefile?view=diff&rev=278907&r1=278906&r2=278907
==============================================================================
--- team/pabelanger/non-root/Makefile (original)
+++ team/pabelanger/non-root/Makefile Fri Jul 23 09:44:06 2010
@@ -571,33 +571,35 @@
 OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
 
 installdirs:
-	$(INSTALL) -d -m 750 $(DESTDIR)$(MODULES_DIR)
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTETCDIR)
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTVARRUNDIR)
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTSPOOLDIR)
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTSPOOLDIR)/voicemail
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTSPOOLDIR)/dictate
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTSPOOLDIR)/system
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTSPOOLDIR)/tmp
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTSPOOLDIR)/meetme
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTSPOOLDIR)/monitor
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTHEADERDIR)
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTHEADERDIR)/doxygen
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTLOGDIR)
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTLOGDIR)/cdr-csv
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTLOGDIR)/cdr-custom
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTLOGDIR)/cel-csv
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTLOGDIR)/cel-custom
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTDATADIR)
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTDATADIR)/documentation
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTDATADIR)/documentation/thirdparty
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTDATADIR)/firmware
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTDATADIR)/firmware/iax
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTDATADIR)/images
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTDATADIR)/keys
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTDATADIR)/phoneprov
-	$(INSTALL) -d -m 750 $(DESTDIR)$(ASTDATADIR)/static-http
-	$(INSTALL) -d -m 750 $(DESTDIR)$(AGI_DIR)
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(MODULES_DIR)"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTSBINDIR)"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTETCDIR)"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTVARRUNDIR)"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTSPOOLDIR)"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTSPOOLDIR)/dictate"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTSPOOLDIR)/meetme"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTSPOOLDIR)/monitor"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTSPOOLDIR)/system"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTSPOOLDIR)/tmp"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTSPOOLDIR)/voicemail"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTHEADERDIR)"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTHEADERDIR)/doxygen"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTLOGDIR)"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTLOGDIR)/cdr-csv"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTLOGDIR)/cdr-custom"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTLOGDIR)/cel-csv"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTLOGDIR)/cel-custom"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTDATADIR)"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTDATADIR)/documentation"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTDATADIR)/documentation/thirdparty"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTDATADIR)/firmware"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTDATADIR)/firmware/iax"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTDATADIR)/images"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTDATADIR)/keys"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTDATADIR)/phoneprov"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTDATADIR)/static-http"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(ASTMANDIR)/man8"
+	$(INSTALL) -d -m 750 "$(DESTDIR)$(AGI_DIR)"
 
 bininstall: _all installdirs $(SUBDIRS_INSTALL)
 	$(INSTALL) -m 750 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
@@ -615,7 +617,6 @@
 	if [ -n "$(OLDHEADERS)" ]; then \
 		rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
 	fi
-
 	$(INSTALL) -m 640 doc/core-*.xml $(DESTDIR)$(ASTDATADIR)/documentation
 	$(INSTALL) -m 640 doc/appdocsxml.dtd $(DESTDIR)$(ASTDATADIR)/documentation
 	$(INSTALL) -m 640 keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys

Modified: team/pabelanger/non-root/res/res_config_ldap.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/non-root/res/res_config_ldap.c?view=diff&rev=278907&r1=278906&r2=278907
==============================================================================
--- team/pabelanger/non-root/res/res_config_ldap.c (original)
+++ team/pabelanger/non-root/res/res_config_ldap.c Fri Jul 23 09:44:06 2010
@@ -67,7 +67,7 @@
 static char user[512];
 static char pass[50];
 static char base_distinguished_name[512];
-static int version = 3;
+static int version;
 static time_t connect_time;
 
 static int parse_config(void);
@@ -571,7 +571,7 @@
 			result = ldap_search_ext_s(ldapConn, dn, LDAP_SCOPE_BASE,
 					   "(objectclass=*)", NULL, 0, NULL, NULL, NULL, LDAP_NO_LIMIT, &ldap_result_msg);
 			if (result != LDAP_SUCCESS && is_ldap_connect_error(result)) {
-				ast_log(LOG_WARNING, "Failed to query database. Try %d/3\n", tries + 1);
+				ast_log(LOG_WARNING, "Failed to query directory. Try %d/3\n", tries + 1);
 				tries++;
 				if (tries < 3) {
 					usleep(500000L * tries);
@@ -587,7 +587,7 @@
 		} while (result != LDAP_SUCCESS && tries < 3 && is_ldap_connect_error(result));
 
 		if (result != LDAP_SUCCESS) {
-			ast_log(LOG_WARNING, "Failed to query database. Error: %s.\n", ldap_err2string(result));
+			ast_log(LOG_WARNING, "Failed to query directory. Error: %s.\n", ldap_err2string(result));
 			ast_debug(2, "dn=%s\n", dn);
 			ast_mutex_unlock(&ldap_lock);
 			return NULL;
@@ -807,7 +807,7 @@
 				  LDAP_SCOPE_SUBTREE, ast_str_buffer(filter), NULL, 0, NULL, NULL, NULL, LDAP_NO_LIMIT,
 				  &ldap_result_msg);
 		if (result != LDAP_SUCCESS && is_ldap_connect_error(result)) {
-			ast_log(LOG_DEBUG, "Failed to query database. Try %d/10\n", tries + 1);
+			ast_log(LOG_DEBUG, "Failed to query directory. Try %d/10\n", tries + 1);
 			if (++tries < 10) {
 				usleep(1);
 				if (ldapConn) {
@@ -822,7 +822,7 @@
 	} while (result != LDAP_SUCCESS && tries < 10 && is_ldap_connect_error(result));
 
 	if (result != LDAP_SUCCESS) {
-		ast_log(LOG_WARNING, "Failed to query database. Error: %s.\n", ldap_err2string(result));
+		ast_log(LOG_WARNING, "Failed to query directory. Error: %s.\n", ldap_err2string(result));
 		ast_log(LOG_WARNING, "Query: %s\n", ast_str_buffer(filter));
 	} else {
 		/* this is where we create the variables from the search result 
@@ -1049,7 +1049,7 @@
 	vars = realtime_ldap_base(&vars_count, basedn, table_name, "filename", file, "commented", "FALSE", NULL);
 
 	if (!vars) {
-		ast_log(LOG_WARNING, "Could not find config '%s' in database.\n", file);
+		ast_log(LOG_WARNING, "Could not find config '%s' in directory.\n", file);
 		return NULL;
 	}
 
@@ -1267,7 +1267,7 @@
 				  LDAP_SCOPE_SUBTREE, ast_str_buffer(filter), NULL, 0, NULL, NULL, NULL, LDAP_NO_LIMIT,
 				  &ldap_result_msg);
 		if (result != LDAP_SUCCESS && is_ldap_connect_error(result)) {
-			ast_log(LOG_WARNING, "Failed to query database. Try %d/3\n", tries + 1);
+			ast_log(LOG_WARNING, "Failed to query directory. Try %d/3\n", tries + 1);
 			tries++;
 			if (tries < 3) {
 				usleep(500000L * tries);
@@ -1452,7 +1452,7 @@
 				  LDAP_SCOPE_SUBTREE, ast_str_buffer(filter), NULL, 0, NULL, NULL, NULL, LDAP_NO_LIMIT,
 				  &ldap_result_msg);
 		if (result != LDAP_SUCCESS && is_ldap_connect_error(result)) {
-			ast_log(LOG_WARNING, "Failed to query database. Try %d/3\n", tries + 1);
+			ast_log(LOG_WARNING, "Failed to query directory. Try %d/3\n", tries + 1);
 			tries++;
 			if (tries < 3) {
 				usleep(500000L * tries);
@@ -1597,6 +1597,13 @@
 	int port;
 	char *category_name = NULL;
 
+	/* Make sure that global variables are reset */
+	url[0] = '\0';
+	user[0] = '\0';
+	pass[0] = '\0';
+	base_distinguished_name[0] = '\0';
+	version = 3;
+
 	config = ast_config_load(RES_CONFIG_LDAP_CONF, config_flags);
 	if (config == CONFIG_STATUS_FILEMISSING || config == CONFIG_STATUS_FILEINVALID) {
 		ast_log(LOG_ERROR, "Cannot load configuration file: %s\n", RES_CONFIG_LDAP_CONF);
@@ -1643,7 +1650,6 @@
 
 	if (!(s = ast_variable_retrieve(config, "_general", "version")) && !(s = ast_variable_retrieve(config, "_general", "protocol"))) {
 		ast_log(LOG_NOTICE, "No explicit LDAP version found, using 3 as default.\n");
-		version = 3;
 	} else if (sscanf(s, "%30d", &version) != 1 || version < 1 || version > 6) {
 		ast_log(LOG_WARNING, "Invalid LDAP version '%s', using 3 as default.\n", s);
 		version = 3;
@@ -1694,7 +1700,7 @@
 	}
 
 	if (ast_strlen_zero(url)) {
-		ast_log(LOG_ERROR, "Not enough parameters to connect to ldap database\n");
+		ast_log(LOG_ERROR, "Not enough parameters to connect to ldap directory\n");
 		return 0;
 	}
 
@@ -1719,7 +1725,7 @@
 		bind_result = ldap_sasl_bind_s(ldapConn, NULL, LDAP_SASL_SIMPLE, &cred, NULL, NULL, NULL);
 	}
 	if (bind_result == LDAP_SUCCESS) {
-		ast_debug(2, "Successfully connected to database.\n");
+		ast_debug(2, "Successfully connected to directory.\n");
 		connect_time = time(NULL);
 		return 1;
 	} else {

Modified: team/pabelanger/non-root/sounds/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/non-root/sounds/Makefile?view=diff&rev=278907&r1=278906&r2=278907
==============================================================================
--- team/pabelanger/non-root/sounds/Makefile (original)
+++ team/pabelanger/non-root/sounds/Makefile Fri Jul 23 09:44:06 2010
@@ -177,7 +177,7 @@
 	rm -f *.tar.gz
 
 $(SOUNDS_DIR)/en $(MOH_DIR) $(SOUNDS_DIR)/es $(SOUNDS_DIR)/fr $(SOUNDS_CACHE_DIR):
-	$(INSTALL) -d -p $@
+	$(INSTALL) -d $@
 
 permissions:
 	@if [ "$(AST_USER)" != "" ] ; then \




More information about the asterisk-commits mailing list