version 1.50, 2010/04/16 01:47:26 |
version 1.51, 2010/05/07 11:30:29 |
|
|
/* "tunnel=" option. */ |
/* "tunnel=" option. */ |
int forced_tun_device = -1; |
int forced_tun_device = -1; |
|
|
|
/* "principals=" option. */ |
|
char *authorized_principals = NULL; |
|
|
extern ServerOptions options; |
extern ServerOptions options; |
|
|
void |
void |
|
|
xfree(forced_command); |
xfree(forced_command); |
forced_command = NULL; |
forced_command = NULL; |
} |
} |
|
if (authorized_principals) { |
|
xfree(authorized_principals); |
|
authorized_principals = NULL; |
|
} |
forced_tun_device = -1; |
forced_tun_device = -1; |
channel_clear_permitted_opens(); |
channel_clear_permitted_opens(); |
} |
} |
|
|
cp = "command=\""; |
cp = "command=\""; |
if (strncasecmp(opts, cp, strlen(cp)) == 0) { |
if (strncasecmp(opts, cp, strlen(cp)) == 0) { |
opts += strlen(cp); |
opts += strlen(cp); |
|
if (forced_command != NULL) |
|
xfree(forced_command); |
forced_command = xmalloc(strlen(opts) + 1); |
forced_command = xmalloc(strlen(opts) + 1); |
i = 0; |
i = 0; |
while (*opts) { |
while (*opts) { |
|
|
} |
} |
forced_command[i] = '\0'; |
forced_command[i] = '\0'; |
auth_debug_add("Forced command: %.900s", forced_command); |
auth_debug_add("Forced command: %.900s", forced_command); |
|
opts++; |
|
goto next_option; |
|
} |
|
cp = "principals=\""; |
|
if (strncasecmp(opts, cp, strlen(cp)) == 0) { |
|
opts += strlen(cp); |
|
if (authorized_principals != NULL) |
|
xfree(authorized_principals); |
|
authorized_principals = xmalloc(strlen(opts) + 1); |
|
i = 0; |
|
while (*opts) { |
|
if (*opts == '"') |
|
break; |
|
if (*opts == '\\' && opts[1] == '"') { |
|
opts += 2; |
|
authorized_principals[i++] = '"'; |
|
continue; |
|
} |
|
authorized_principals[i++] = *opts++; |
|
} |
|
if (!*opts) { |
|
debug("%.100s, line %lu: missing end quote", |
|
file, linenum); |
|
auth_debug_add("%.100s, line %lu: missing end quote", |
|
file, linenum); |
|
xfree(authorized_principals); |
|
authorized_principals = NULL; |
|
goto bad_option; |
|
} |
|
authorized_principals[i] = '\0'; |
|
auth_debug_add("principals: %.900s", |
|
authorized_principals); |
opts++; |
opts++; |
goto next_option; |
goto next_option; |
} |
} |