Changeset 5146:716400712348 in roaraudio for roard
- Timestamp:
- 10/15/11 12:48:07 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/auth.c
r4745 r5146 127 127 for (i = 0; i < AUTH_KEYRING_LEN; i++) { 128 128 if ( (key = &(g_auth_keyring[i]))->type == authmes->type ) { 129 ret = -1; 129 ROAR_DBG("auth_client_ckeck(cs=%p, authmes=%p, next=%p{%i}): key=%p{.type=%i, ...}", cs, authmes, next, *next, key, key->type); 130 ret = -1; 130 131 switch (key->type) { 131 132 case ROAR_AUTH_T_NONE: -
roard/clients.c
r4947 r5146 1028 1028 return _g_acclevs[i].acclev; 1029 1029 1030 return -1;1030 return ACCLEV_ERROR; 1031 1031 } 1032 1032 -
roard/include/client.h
r4708 r5146 49 49 // access level: 50 50 enum roard_client_acclev { 51 ACCLEV_NONE = 0, // only very basic commands like NOOP and IDENTIFY 52 ACCLEV_IDENTED, // same as NONE but INDENTIFY worked. 53 ACCLEV_CONCTL, // only allowed to do basic connection things. 54 ACCLEV_GUEST, // guest connection (read only) 55 ACCLEV_USER, // normal user connect (read write) 56 ACCLEV_PWRUSER, // power user, may access other user's clients 57 ACCLEV_ALL // full (admin) access (read write ctl) 51 ACCLEV_ERROR = -1, // used as erorr return value. 52 ACCLEV_NONE = 0, // only very basic commands like NOOP and IDENTIFY 53 ACCLEV_IDENTED, // same as NONE but INDENTIFY worked. 54 ACCLEV_CONCTL, // only allowed to do basic connection things. 55 ACCLEV_GUEST, // guest connection (read only) 56 ACCLEV_USER, // normal user connect (read write) 57 ACCLEV_PWRUSER, // power user, may access other user's clients 58 ACCLEV_ALL // full (admin) access (read write ctl) 58 59 }; 59 60 -
roard/req.c
r5065 r5146 141 141 client, roar_autht2str(authmes.type), authmes.type, (long long unsigned int)authmes.len); 142 142 143 ROAR_DBG("req_on_auth(client=%i,...): CALL auth_client_ckeck(cs=%p, &authmes=%p, &next=%p)", client, cs, &authmes, &next); 143 144 ret = auth_client_ckeck(cs, &authmes, &next); 145 ROAR_DBG("req_on_auth(client=%i,...): RET %i // next=%s(%i)", client, ret, roar_autht2str(next), next); 144 146 145 147 if ( ret != 1 ) { 148 ROAR_DBG("req_on_auth(client=%i,...) = ?", client); 149 146 150 if ( next != -1 ) { 151 ROAR_DBG("req_on_auth(client=%i,...) = ?", client); 147 152 memset(&authmes, 0, sizeof(authmes)); 148 153 … … 152 157 return -1; 153 158 154 if ( roar_err_int(&error_frame) == -1 ) 155 return -1; 159 ROAR_DBG("req_on_auth(client=%i,...) = ?", client); 160 161 if ( roar_err_init(&error_frame) == -1 ) 162 return -1; 163 164 ROAR_DBG("req_on_auth(client=%i,...) = ?", client); 156 165 157 166 error_frame.ra_errno = ROAR_ERROR_PERM; … … 159 168 160 169 error_data = roar_err_buildmsg(mes, &error_frame); 170 ROAR_DBG("req_on_auth(client=%i,...): error_data=%p", client, error_data); 161 171 162 172 memcpy(error_data, error_mes.data, error_mes.datalen); … … 164 174 mes->cmd = ROAR_CMD_ERROR; 165 175 mes->pos = g_pos; 176 177 ROAR_DBG("req_on_auth(client=%i,...): mes=%p{.datalen=%i}", client, mes, (int)mes->datalen); 178 ROAR_DBG("req_on_auth(client=%i,...) = 0 // cmd=ERROR", client); 166 179 return 0; 167 180 } 168 181 182 ROAR_DBG("req_on_auth(client=%i,...) = 0", client); 169 183 return -1; 170 184 } … … 173 187 mes->pos = g_pos; 174 188 mes->datalen = 0; 189 190 ROAR_DBG("req_on_auth(client=%i,...) = 0", client); 175 191 return 0; 176 192 } -
roard/roard.c
r5103 r5146 217 217 printf("\nAuth Options:\n\n"); 218 218 printf( 219 " --guest-acclev ACCLEV - Sets the access level for guest access to ACCLEV\n" 219 " --guest-acclev ACCLEV - Sets the access level for guest access to ACCLEV,\n" 220 " Use \"none\" to disable guest access.\n" 220 221 " --trust-acclev ACCLEV - Sets the access level for trust-authed\n" 221 " connections to ACCLEV \n"222 " connections to ACCLEV. Use \"none\" to disable trust auth.\n" 222 223 " --trust-root - Trust root user\n" 223 224 " --no-trust-root - Don't trust root user\n" … … 1679 1680 _CKHAVEARGS(1); 1680 1681 none_acclev = clients_str2acclev(argv[++i]); 1682 if ( none_acclev == -1 ) { 1683 ROAR_ERR("Invalid access level: %s", argv[i]); 1684 return 1; 1685 } 1681 1686 } else if ( strcmp(k, "--trust-acclev") == 0 ) { 1682 1687 _CKHAVEARGS(1); 1683 1688 trust_acclev = clients_str2acclev(argv[++i]); 1689 if ( trust_acclev == -1 ) { 1690 ROAR_ERR("Invalid access level: %s", argv[i]); 1691 return 1; 1692 } 1684 1693 } else if ( strcmp(k, "--trust-root") == 0 ) { 1685 1694 trust_root = 1;
Note: See TracChangeset
for help on using the changeset viewer.