From: Jeff Peeler Date: Fri, 5 Mar 2010 01:02:58 +0000 (+0000) Subject: Fix not being able to specify a URL in MOH class directory. X-Git-Tag: 1.4.31-rc1~2^2~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=093e1d34f341cfe03643b15b43ea4617d494320c;p=thirdparty%2Fasterisk.git Fix not being able to specify a URL in MOH class directory. Don't attempt to chdir on a URL! (closes issue #16875) Reported by: raarts Patches: moh-http.patch uploaded by raarts (license 937) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@250786 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 630a6db58c..012b8a6dfd 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -457,7 +457,7 @@ static int spawn_mp3(struct mohclass *class) #ifdef HAVE_CAP cap_t cap; #endif - if (strcasecmp(class->dir, "nodir") && chdir(class->dir) < 0) { + if (strncasecmp(class->dir, "http://", 7) && strcasecmp(class->dir, "nodir") && chdir(class->dir) < 0) { ast_log(LOG_WARNING, "chdir() failed: %s\n", strerror(errno)); _exit(1); }