diff --git a/interfaces/innerkits/include/appspawn_msg.h b/interfaces/innerkits/include/appspawn_msg.h index e3b5391e84521911b3cf95e5ceddc4f54a169e6d..12d35dd249a1b5686200fe18f5344d58d2d72e17 100644 --- a/interfaces/innerkits/include/appspawn_msg.h +++ b/interfaces/innerkits/include/appspawn_msg.h @@ -58,7 +58,13 @@ typedef enum AppOperateType_ { #define APP_MAX_GIDS 64 #define APP_APL_MAX_LEN 32 #define APP_RENDER_CMD_MAX_LEN 1024 + +/* AppParameter.flags bit definition */ #define APP_COLD_BOOT 0x01 +#define APP_BACKUP_EXTENSION 0x02 +#define APP_DLP_MANAGER 0x04 +#define APP_DEBUGGABLE 0x08 // debuggable application + #define BITLEN32 32 #define FDLEN2 2 #define FD_INIT_VALUE 0 diff --git a/standard/appspawn_process.c b/standard/appspawn_process.c index cfd03fc655ad985388c23a43d862f128b31c78dd..d2e6ec217ce3be47b5ad829318b8c64481478f12 100644 --- a/standard/appspawn_process.c +++ b/standard/appspawn_process.c @@ -189,6 +189,12 @@ static int SetUidGid(struct AppSpawnContent_ *content, AppSpawnClient *client) APPSPAWN_CHECK(!isRet, return -errno, "setuid(%u) failed: %d", appProperty->property.uid, errno); } #endif + if ((appProperty->property.flags & APP_DEBUGGABLE) != 0) { + APPSPAWN_LOGV("Debuggable app"); + if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) { + APPSPAWN_LOGE("Failed to set app dumpable: %s", strerror(errno)); + } + } return 0; }