void freep(void *p);
void closep(int *fd);
void fclosep(FILE **f);
-void smack_freep(struct smack_accesses **smack);
void fts_closep(FTS **f);
#define AUTO_FREE __attribute__ ((cleanup(freep))) = NULL
#define AUTO_CLOSE __attribute__ ((cleanup(closep))) = -1
#define AUTO_FCLOSE __attribute__ ((cleanup(fclosep))) = NULL
-#define AUTO_SMACK_FREE __attribute__ ((cleanup(smack_freep))) = NULL
#define AUTO_FTS_CLOSE __attribute__ ((cleanup(fts_closep))) = NULL
#define SMACK_RULES_DIR "/opt/etc/smack-app/accesses.d/"
int smack_mark_file_name(const char *app_id, char **path);
bool file_exists(const char* path);
int smack_file_name(const char* app_id, char** path);
-inline int have_smack(void);
+int have_smack(void);
int base_name_from_perm(const char *perm, char **name);
#define API __attribute__((visibility("default")))
#endif // API
-#define DEPRECATED __attribute__((deprecated));
+#define DEPRECATED __attribute__((deprecated))
#define UNUSED __attribute__((unused))
/* error codes */
fclose(*f);
}
-void smack_freep(struct smack_accesses **smack)
-{
- smack_accesses_free(*smack);
-}
-
void fts_closep(FTS **f)
{
if(*f)
return PC_OPERATION_SUCCESS;
}
-inline int have_smack(void)
+int have_smack(void)
{
SECURE_C_LOGD("Entering function: %s.", __func__);
case APP_PATH_PUBLIC: {
C_LOGD("app_path_type is APP_PATH_PUBLIC.");
- char **app_ids AUTO_FREE;
const char *label;
int ret;
case APP_PATH_SETTINGS: {
C_LOGD("app_path_type is APP_PATH_SETTINGS.");
- char **app_ids AUTO_FREE;
const char *label;
int ret;
SECURE_C_LOGD("Entering function: %s. Params: pkg_id=%s",
__func__, pkg_id);
int ret;
- int fd AUTO_CLOSE;
- char* smack_path AUTO_FREE;
- struct smack_accesses *smack AUTO_SMACK_FREE;
if (!smack_label_is_valid(pkg_id)) {
C_LOGE("Invalid param pkg_id.");
API int perm_app_uninstall(const char* pkg_id)
{
SECURE_C_LOGD("Entering function: %s. Params: pkg_id=%s", __func__, pkg_id);
- char* smack_path AUTO_FREE;
int ret;
if (!smack_label_is_valid(pkg_id)) {
__func__, app_type, api_feature_name);
int ret = PC_OPERATION_SUCCESS;
- char* smack_file AUTO_FREE;
char* dac_file AUTO_FREE;
char * base_api_feature_name AUTO_FREE;
FILE* file = NULL;