[svn-commits] kmoore: trunk r399036 - in /trunk: ./ apps/app_meetme.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Fri Sep 13 09:17:19 CDT 2013
Author: kmoore
Date: Fri Sep 13 09:17:15 2013
New Revision: 399036
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=399036
Log:
Fix several crashes in MeetMeAdmin
This change ensures that MeetMeAdmin commands requiring a user actually
get a user and fixes another issue where an extra dereference could
occur for a last-entered user being ejected if a user identifier was
also provided.
(closes issue ASTERISK-21907)
Reported by: Alex Epshteyn
Review: https://reviewboard.asterisk.org/r/2844/
........
Merged revisions 399033 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 399034 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 399035 from http://svn.asterisk.org/svn/asterisk/branches/12
Modified:
trunk/ (props changed)
trunk/apps/app_meetme.c
Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Fri Sep 13 09:17:15 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398558,398560-398577,398579-398927,398938,398991,399017,399019,399021,399031
+/branches/12:1-398558,398560-398577,398579-398927,398938,398991,399017,399019,399021,399031,399035
Modified: trunk/apps/app_meetme.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_meetme.c?view=diff&rev=399036&r1=399035&r2=399036
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Fri Sep 13 09:17:15 2013
@@ -5253,6 +5253,23 @@
res = -2;
goto usernotfound;
}
+ } else {
+ /* fail for commands that require a user */
+ switch (*args.command) {
+ case 'm': /* Unmute */
+ case 'M': /* Mute */
+ case 't': /* Lower user's talk volume */
+ case 'T': /* Raise user's talk volume */
+ case 'u': /* Lower user's listen volume */
+ case 'U': /* Raise user's listen volume */
+ case 'r': /* Reset user's volume level */
+ case 'k': /* Kick user */
+ res = -2;
+ ast_log(LOG_NOTICE, "No user specified!\n");
+ goto usernotfound;
+ default:
+ break;
+ }
}
switch (*args.command) {
@@ -5268,21 +5285,22 @@
case 101: /* e: Eject last user*/
{
int max_no = 0;
-
- /* If they passed in a user, disregard it */
- if (user) {
- ao2_ref(user, -1);
- }
+ RAII_VAR(struct ast_conf_user *, eject_user, NULL, ao2_cleanup);
ao2_callback(cnf->usercontainer, OBJ_NODATA, user_max_cmp, &max_no);
- user = ao2_find(cnf->usercontainer, &max_no, 0);
- if (!ast_test_flag64(&user->userflags, CONFFLAG_ADMIN))
- user->adminflags |= ADMINFLAG_KICKME;
- else {
+ eject_user = ao2_find(cnf->usercontainer, &max_no, 0);
+ if (!eject_user) {
+ res = -1;
+ ast_log(LOG_NOTICE, "No last user to kick!\n");
+ break;
+ }
+
+ if (!ast_test_flag64(&eject_user->userflags, CONFFLAG_ADMIN)) {
+ eject_user->adminflags |= ADMINFLAG_KICKME;
+ } else {
res = -1;
ast_log(LOG_NOTICE, "Not kicking last user, is an Admin!\n");
}
- ao2_ref(user, -1);
break;
}
case 77: /* M: Mute */
More information about the svn-commits
mailing list