}
static int is_support_debug_option(void){
- int is_support = 0;
- char buf[512] = {};
-
- const char* SHELL_GET_PROFILE_VER_CMD ="shell:/usr/bin/profile_command getversion";
- int fd = sdb_connect(SHELL_GET_PROFILE_VER_CMD);
+ char full_cmd[16] = {0,};
+ char cap_buffer[CAPBUF_SIZE] = {0,};
+ uint16_t len = 0;
+ int ret = -1;
- if(fd < 0) {
- // default : not support -G option.
- return 0;
- }
- if (read_line(fd, buf, sizeof(buf)) > 0) {
- int major = 0;
- int minor = 0;
- if (sscanf(buf, "%d.%d", &major, &minor) == 2) {
- // major version number at least 4
- if (major >= 4) {
- is_support = 1;
- }
+ snprintf(full_cmd, sizeof(full_cmd), "capability:");
+ int fd = sdb_connect(full_cmd);
+ if (fd >= 0) {
+ readx(fd, &len, sizeof(uint16_t));
+ if (len > CAPBUF_SIZE-1) {
+ len = CAPBUF_SIZE-1;
}
- }
+ readx(fd, cap_buffer, len);
+ sdb_close(fd);
- sdb_close(fd);
- return is_support;
+ ret = match_capability_key_value(cap_buffer, "sdbd_rootperm", "disabled");
+ }
+ return ret;
}
static int is_support_whitespace_pkgname(void){
const char* SHELL_INSTALL_CMD = NULL;
char full_cmd[PATH_MAX];
- if (is_support_debug_option()) {
+ if (is_support_debug_option() == 1) {
SHELL_INSTALL_CMD ="shell:/usr/bin/pkgcmd -i -t %s -p \"%s\" -q -G";
} else {
SHELL_INSTALL_CMD ="shell:/usr/bin/pkgcmd -i -t %s -p \"%s\" -q";
int get_server_port();
int get_platform_version();
int __sdb_command(const char* cmd);
+int match_capability_key_value(char* cap, char* key, char* value);
#endif /* COMMANDLINE_H_ */