mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
it is impossible to set permissions for manager accounts created by users.conf (reported internally, patched by me)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@90098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -46,6 +46,11 @@ hasiax = yes
|
||||
;
|
||||
hasmanager = no
|
||||
;
|
||||
; Set permissions for manager entry (see manager.conf.sample for documentation)
|
||||
; (defaults to *all* permissions)
|
||||
;managerread = system,call,log,verbose,command,agent,user,config
|
||||
;managerwrite = system,call,log,verbose,command,agent,user,config
|
||||
;
|
||||
; Remaining options are not specific to users.conf entries but are general.
|
||||
;
|
||||
callwaiting = yes
|
||||
|
@@ -1054,6 +1054,9 @@ static int authenticate(struct mansession *s, const struct message *m)
|
||||
struct ast_variable *v;
|
||||
const char *password = NULL;
|
||||
int hasmanager = 0;
|
||||
const char *readperms = NULL;
|
||||
const char *writeperms = NULL;
|
||||
|
||||
if (strcasecmp(cat, user) || !strcasecmp(cat, "general")) {
|
||||
cat = ast_category_browse(cfg, cat);
|
||||
continue;
|
||||
@@ -1063,6 +1066,10 @@ static int authenticate(struct mansession *s, const struct message *m)
|
||||
password = v->value;
|
||||
else if (!strcasecmp(v->name, "hasmanager"))
|
||||
hasmanager = ast_true(v->value);
|
||||
else if (!strcasecmp(v->name, "managerread"))
|
||||
readperms = v->value;
|
||||
else if (!strcasecmp(v->name, "managerwrite"))
|
||||
writeperms = v->value;
|
||||
}
|
||||
if (!hasmanager)
|
||||
break;
|
||||
@@ -1072,8 +1079,8 @@ static int authenticate(struct mansession *s, const struct message *m)
|
||||
return -1;
|
||||
}
|
||||
ast_copy_string(s->username, cat, sizeof(s->username));
|
||||
s->readperm = -1;
|
||||
s->writeperm = -1;
|
||||
s->readperm = readperms ? get_perm(readperms) : -1;
|
||||
s->writeperm = writeperms ? get_perm(writeperms) : -1;
|
||||
ast_config_destroy(cfg);
|
||||
if (events)
|
||||
set_eventmask(s, events);
|
||||
|
Reference in New Issue
Block a user