diff options
author | Steve Block <steveblock@google.com> | 2012-01-06 19:20:56 +0000 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2012-01-19 14:45:03 -0800 |
commit | c6aacce37191e1cc79cfeba13b39899f59c68c3b (patch) | |
tree | df4401aaa38914e03d5eadc82507e7c6fdcc573e /cmds/installd | |
parent | a51f0e707f1f3142358aa919ea60ad2842803139 (diff) | |
download | frameworks_base-c6aacce37191e1cc79cfeba13b39899f59c68c3b.zip frameworks_base-c6aacce37191e1cc79cfeba13b39899f59c68c3b.tar.gz frameworks_base-c6aacce37191e1cc79cfeba13b39899f59c68c3b.tar.bz2 |
Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF)
Change-Id: I1de629b4632a4b3187ca1a28d6416daccd35f924
Diffstat (limited to 'cmds/installd')
-rw-r--r-- | cmds/installd/commands.c | 94 | ||||
-rw-r--r-- | cmds/installd/installd.c | 30 | ||||
-rw-r--r-- | cmds/installd/utils.c | 44 |
3 files changed, 84 insertions, 84 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 4d80296..dd92bbe 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -30,47 +30,47 @@ int install(const char *pkgname, uid_t uid, gid_t gid) char libdir[PKG_PATH_MAX]; if ((uid < AID_SYSTEM) || (gid < AID_SYSTEM)) { - LOGE("invalid uid/gid: %d %d\n", uid, gid); + ALOGE("invalid uid/gid: %d %d\n", uid, gid); return -1; } if (create_pkg_path(pkgdir, pkgname, PKG_DIR_POSTFIX, 0)) { - LOGE("cannot create package path\n"); + ALOGE("cannot create package path\n"); return -1; } if (create_pkg_path(libdir, pkgname, PKG_LIB_POSTFIX, 0)) { - LOGE("cannot create package lib path\n"); + ALOGE("cannot create package lib path\n"); return -1; } if (mkdir(pkgdir, 0751) < 0) { - LOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno)); + ALOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno)); return -errno; } if (chmod(pkgdir, 0751) < 0) { - LOGE("cannot chmod dir '%s': %s\n", pkgdir, strerror(errno)); + ALOGE("cannot chmod dir '%s': %s\n", pkgdir, strerror(errno)); unlink(pkgdir); return -errno; } if (chown(pkgdir, uid, gid) < 0) { - LOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno)); + ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno)); unlink(pkgdir); return -errno; } if (mkdir(libdir, 0755) < 0) { - LOGE("cannot create dir '%s': %s\n", libdir, strerror(errno)); + ALOGE("cannot create dir '%s': %s\n", libdir, strerror(errno)); unlink(pkgdir); return -errno; } if (chmod(libdir, 0755) < 0) { - LOGE("cannot chmod dir '%s': %s\n", libdir, strerror(errno)); + ALOGE("cannot chmod dir '%s': %s\n", libdir, strerror(errno)); unlink(libdir); unlink(pkgdir); return -errno; } if (chown(libdir, AID_SYSTEM, AID_SYSTEM) < 0) { - LOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno)); + ALOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno)); unlink(libdir); unlink(pkgdir); return -errno; @@ -100,7 +100,7 @@ int renamepkg(const char *oldpkgname, const char *newpkgname) return -1; if (rename(oldpkgdir, newpkgdir) < 0) { - LOGE("cannot rename dir '%s' to '%s': %s\n", oldpkgdir, newpkgdir, strerror(errno)); + ALOGE("cannot rename dir '%s' to '%s': %s\n", oldpkgdir, newpkgdir, strerror(errno)); return -errno; } return 0; @@ -127,11 +127,11 @@ int make_user_data(const char *pkgname, uid_t uid, uid_t persona) return -1; } if (mkdir(pkgdir, 0751) < 0) { - LOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno)); + ALOGE("cannot create dir '%s': %s\n", pkgdir, strerror(errno)); return -errno; } if (chown(pkgdir, uid, uid) < 0) { - LOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno)); + ALOGE("cannot chown dir '%s': %s\n", pkgdir, strerror(errno)); unlink(pkgdir); return -errno; } @@ -165,7 +165,7 @@ static int64_t disk_free() if (statfs(android_data_dir.path, &sfs) == 0) { return sfs.f_bavail * sfs.f_bsize; } else { - LOGE("Couldn't statfs %s: %s\n", android_data_dir.path, strerror(errno)); + ALOGE("Couldn't statfs %s: %s\n", android_data_dir.path, strerror(errno)); return -1; } } @@ -193,13 +193,13 @@ int free_cache(int64_t free_size) if (avail >= free_size) return 0; if (create_persona_path(datadir, 0)) { - LOGE("couldn't get directory for persona 0"); + ALOGE("couldn't get directory for persona 0"); return -1; } d = opendir(datadir); if (d == NULL) { - LOGE("cannot open %s: %s\n", datadir, strerror(errno)); + ALOGE("cannot open %s: %s\n", datadir, strerror(errno)); return -1; } dfd = dirfd(d); @@ -245,7 +245,7 @@ int move_dex(const char *src, const char *dst) ALOGV("move %s -> %s\n", src_dex, dst_dex); if (rename(src_dex, dst_dex) < 0) { - LOGE("Couldn't move %s: %s\n", src_dex, strerror(errno)); + ALOGE("Couldn't move %s: %s\n", src_dex, strerror(errno)); return -1; } else { return 0; @@ -261,7 +261,7 @@ int rm_dex(const char *path) ALOGV("unlink %s\n", dex_path); if (unlink(dex_path) < 0) { - LOGE("Couldn't unlink %s: %s\n", dex_path, strerror(errno)); + ALOGE("Couldn't unlink %s: %s\n", dex_path, strerror(errno)); return -1; } else { return 0; @@ -281,12 +281,12 @@ int protect(char *pkgname, gid_t gid) if (stat(pkgpath, &s) < 0) return -1; if (chown(pkgpath, s.st_uid, gid) < 0) { - LOGE("failed to chgrp '%s': %s\n", pkgpath, strerror(errno)); + ALOGE("failed to chgrp '%s': %s\n", pkgpath, strerror(errno)); return -1; } if (chmod(pkgpath, S_IRUSR|S_IWUSR|S_IRGRP) < 0) { - LOGE("failed to chmod '%s': %s\n", pkgpath, strerror(errno)); + ALOGE("failed to chmod '%s': %s\n", pkgpath, strerror(errno)); return -1; } @@ -443,7 +443,7 @@ static void run_dexopt(int zip_fd, int odex_fd, const char* input_file_name, execl(DEX_OPT_BIN, DEX_OPT_BIN, "--zip", zip_num, odex_num, input_file_name, dexopt_flags, (char*) NULL); - LOGE("execl(%s) failed: %s\n", DEX_OPT_BIN, strerror(errno)); + ALOGE("execl(%s) failed: %s\n", DEX_OPT_BIN, strerror(errno)); } static int wait_dexopt(pid_t pid, const char* apk_path) @@ -515,24 +515,24 @@ int dexopt(const char *apk_path, uid_t uid, int is_public) zip_fd = open(apk_path, O_RDONLY, 0); if (zip_fd < 0) { - LOGE("dexopt cannot open '%s' for input\n", apk_path); + ALOGE("dexopt cannot open '%s' for input\n", apk_path); return -1; } unlink(dex_path); odex_fd = open(dex_path, O_RDWR | O_CREAT | O_EXCL, 0644); if (odex_fd < 0) { - LOGE("dexopt cannot open '%s' for output\n", dex_path); + ALOGE("dexopt cannot open '%s' for output\n", dex_path); goto fail; } if (fchown(odex_fd, AID_SYSTEM, uid) < 0) { - LOGE("dexopt cannot chown '%s'\n", dex_path); + ALOGE("dexopt cannot chown '%s'\n", dex_path); goto fail; } if (fchmod(odex_fd, S_IRUSR|S_IWUSR|S_IRGRP | (is_public ? S_IROTH : 0)) < 0) { - LOGE("dexopt cannot chmod '%s'\n", dex_path); + ALOGE("dexopt cannot chmod '%s'\n", dex_path); goto fail; } @@ -543,15 +543,15 @@ int dexopt(const char *apk_path, uid_t uid, int is_public) if (pid == 0) { /* child -- drop privileges before continuing */ if (setgid(uid) != 0) { - LOGE("setgid(%d) failed during dexopt\n", uid); + ALOGE("setgid(%d) failed during dexopt\n", uid); exit(64); } if (setuid(uid) != 0) { - LOGE("setuid(%d) during dexopt\n", uid); + ALOGE("setuid(%d) during dexopt\n", uid); exit(65); } if (flock(odex_fd, LOCK_EX | LOCK_NB) != 0) { - LOGE("flock(%s) failed: %s\n", dex_path, strerror(errno)); + ALOGE("flock(%s) failed: %s\n", dex_path, strerror(errno)); exit(66); } @@ -560,7 +560,7 @@ int dexopt(const char *apk_path, uid_t uid, int is_public) } else { res = wait_dexopt(pid, apk_path); if (res != 0) { - LOGE("dexopt failed on '%s' res = %d\n", dex_path, res); + ALOGE("dexopt failed on '%s' res = %d\n", dex_path, res); goto fail; } } @@ -626,7 +626,7 @@ int movefileordir(char* srcpath, char* dstpath, int dstbasepos, ALOGV("Renaming %s to %s (uid %d)\n", srcpath, dstpath, dstuid); if (rename(srcpath, dstpath) >= 0) { if (chown(dstpath, dstuid, dstgid) < 0) { - LOGE("cannot chown %s: %s\n", dstpath, strerror(errno)); + ALOGE("cannot chown %s: %s\n", dstpath, strerror(errno)); unlink(dstpath); return 1; } @@ -852,30 +852,30 @@ int linklib(const char* dataDir, const char* asecLibDir) const size_t libdirLen = strlen(dataDir) + strlen(PKG_LIB_POSTFIX); if (libdirLen >= PKG_PATH_MAX) { - LOGE("library dir len too large"); + ALOGE("library dir len too large"); return -1; } if (snprintf(libdir, sizeof(libdir), "%s%s", dataDir, PKG_LIB_POSTFIX) != (ssize_t)libdirLen) { - LOGE("library dir not written successfully: %s\n", strerror(errno)); + ALOGE("library dir not written successfully: %s\n", strerror(errno)); return -1; } if (stat(dataDir, &s) < 0) return -1; if (chown(dataDir, 0, 0) < 0) { - LOGE("failed to chown '%s': %s\n", dataDir, strerror(errno)); + ALOGE("failed to chown '%s': %s\n", dataDir, strerror(errno)); return -1; } if (chmod(dataDir, 0700) < 0) { - LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); + ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); rc = -1; goto out; } if (lstat(libdir, &libStat) < 0) { - LOGE("couldn't stat lib dir: %s\n", strerror(errno)); + ALOGE("couldn't stat lib dir: %s\n", strerror(errno)); rc = -1; goto out; } @@ -893,13 +893,13 @@ int linklib(const char* dataDir, const char* asecLibDir) } if (symlink(asecLibDir, libdir) < 0) { - LOGE("couldn't symlink directory '%s' -> '%s': %s\n", libdir, asecLibDir, strerror(errno)); + ALOGE("couldn't symlink directory '%s' -> '%s': %s\n", libdir, asecLibDir, strerror(errno)); rc = -errno; goto out; } if (lchown(libdir, AID_SYSTEM, AID_SYSTEM) < 0) { - LOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno)); + ALOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno)); unlink(libdir); rc = -errno; goto out; @@ -907,12 +907,12 @@ int linklib(const char* dataDir, const char* asecLibDir) out: if (chmod(dataDir, s.st_mode) < 0) { - LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); + ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); return -errno; } if (chown(dataDir, s.st_uid, s.st_gid) < 0) { - LOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno)); + ALOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno)); return -errno; } @@ -931,28 +931,28 @@ int unlinklib(const char* dataDir) } if (snprintf(libdir, sizeof(libdir), "%s%s", dataDir, PKG_LIB_POSTFIX) != (ssize_t)libdirLen) { - LOGE("library dir not written successfully: %s\n", strerror(errno)); + ALOGE("library dir not written successfully: %s\n", strerror(errno)); return -1; } if (stat(dataDir, &s) < 0) { - LOGE("couldn't state data dir"); + ALOGE("couldn't state data dir"); return -1; } if (chown(dataDir, 0, 0) < 0) { - LOGE("failed to chown '%s': %s\n", dataDir, strerror(errno)); + ALOGE("failed to chown '%s': %s\n", dataDir, strerror(errno)); return -1; } if (chmod(dataDir, 0700) < 0) { - LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); + ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); rc = -1; goto out; } if (lstat(libdir, &libStat) < 0) { - LOGE("couldn't stat lib dir: %s\n", strerror(errno)); + ALOGE("couldn't stat lib dir: %s\n", strerror(errno)); rc = -1; goto out; } @@ -970,13 +970,13 @@ int unlinklib(const char* dataDir) } if (mkdir(libdir, 0755) < 0) { - LOGE("cannot create dir '%s': %s\n", libdir, strerror(errno)); + ALOGE("cannot create dir '%s': %s\n", libdir, strerror(errno)); rc = -errno; goto out; } if (chown(libdir, AID_SYSTEM, AID_SYSTEM) < 0) { - LOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno)); + ALOGE("cannot chown dir '%s': %s\n", libdir, strerror(errno)); unlink(libdir); rc = -errno; goto out; @@ -984,12 +984,12 @@ int unlinklib(const char* dataDir) out: if (chmod(dataDir, s.st_mode) < 0) { - LOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); + ALOGE("failed to chmod '%s': %s\n", dataDir, strerror(errno)); return -1; } if (chown(dataDir, s.st_uid, s.st_gid) < 0) { - LOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno)); + ALOGE("failed to chown '%s' : %s\n", dataDir, strerror(errno)); return -1; } diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c index 159bccb..569b491 100644 --- a/cmds/installd/installd.c +++ b/cmds/installd/installd.c @@ -157,11 +157,11 @@ static int readx(int s, void *_buf, int count) r = read(s, buf + n, count - n); if (r < 0) { if (errno == EINTR) continue; - LOGE("read error: %s\n", strerror(errno)); + ALOGE("read error: %s\n", strerror(errno)); return -1; } if (r == 0) { - LOGE("eof\n"); + ALOGE("eof\n"); return -1; /* EOF */ } n += r; @@ -178,7 +178,7 @@ static int writex(int s, const void *_buf, int count) r = write(s, buf + n, count - n); if (r < 0) { if (errno == EINTR) continue; - LOGE("write error: %s\n", strerror(errno)); + ALOGE("write error: %s\n", strerror(errno)); return -1; } n += r; @@ -213,7 +213,7 @@ static int execute(int s, char cmd[BUFFER_MAX]) n++; arg[n] = cmd; if (n == TOKEN_MAX) { - LOGE("too many arguments\n"); + ALOGE("too many arguments\n"); goto done; } } @@ -223,7 +223,7 @@ static int execute(int s, char cmd[BUFFER_MAX]) for (i = 0; i < sizeof(cmds) / sizeof(cmds[0]); i++) { if (!strcmp(cmds[i].name,arg[0])) { if (n != cmds[i].numargs) { - LOGE("%s requires %d arguments (%d given)\n", + ALOGE("%s requires %d arguments (%d given)\n", cmds[i].name, cmds[i].numargs, n); } else { ret = cmds[i].func(arg + 1, reply); @@ -231,7 +231,7 @@ static int execute(int s, char cmd[BUFFER_MAX]) goto done; } } - LOGE("unsupported command '%s'\n", arg[0]); + ALOGE("unsupported command '%s'\n", arg[0]); done: if (reply[0]) { @@ -290,7 +290,7 @@ int initialize_globals() { android_system_dirs.dirs = calloc(android_system_dirs.count, sizeof(dir_rec_t)); if (android_system_dirs.dirs == NULL) { - LOGE("Couldn't allocate array for dirs; aborting\n"); + ALOGE("Couldn't allocate array for dirs; aborting\n"); return -1; } @@ -351,22 +351,22 @@ int main(const int argc, const char *argv[]) { int lsocket, s, count; if (initialize_globals() < 0) { - LOGE("Could not initialize globals; exiting.\n"); + ALOGE("Could not initialize globals; exiting.\n"); exit(1); } if (initialize_directories() < 0) { - LOGE("Could not create directories; exiting.\n"); + ALOGE("Could not create directories; exiting.\n"); exit(1); } lsocket = android_get_control_socket(SOCKET_PATH); if (lsocket < 0) { - LOGE("Failed to get socket from environment: %s\n", strerror(errno)); + ALOGE("Failed to get socket from environment: %s\n", strerror(errno)); exit(1); } if (listen(lsocket, 5)) { - LOGE("Listen on socket failed: %s\n", strerror(errno)); + ALOGE("Listen on socket failed: %s\n", strerror(errno)); exit(1); } fcntl(lsocket, F_SETFD, FD_CLOEXEC); @@ -375,7 +375,7 @@ int main(const int argc, const char *argv[]) { alen = sizeof(addr); s = accept(lsocket, &addr, &alen); if (s < 0) { - LOGE("Accept failed: %s\n", strerror(errno)); + ALOGE("Accept failed: %s\n", strerror(errno)); continue; } fcntl(s, F_SETFD, FD_CLOEXEC); @@ -384,15 +384,15 @@ int main(const int argc, const char *argv[]) { for (;;) { unsigned short count; if (readx(s, &count, sizeof(count))) { - LOGE("failed to read size\n"); + ALOGE("failed to read size\n"); break; } if ((count < 1) || (count >= BUFFER_MAX)) { - LOGE("invalid size %d\n", count); + ALOGE("invalid size %d\n", count); break; } if (readx(s, buf, count)) { - LOGE("failed to read command\n"); + ALOGE("failed to read command\n"); break; } buf[count] = 0; diff --git a/cmds/installd/utils.c b/cmds/installd/utils.c index 940626e..52ec9e8 100644 --- a/cmds/installd/utils.c +++ b/cmds/installd/utils.c @@ -42,7 +42,7 @@ int create_pkg_path_in_dir(char path[PKG_PATH_MAX], if (append_and_increment(&dst, dir->path, &dst_size) < 0 || append_and_increment(&dst, pkgname, &dst_size) < 0 || append_and_increment(&dst, postfix, &dst_size) < 0) { - LOGE("Error building APK path"); + ALOGE("Error building APK path"); return -1; } @@ -76,7 +76,7 @@ int create_pkg_path(char path[PKG_PATH_MAX], if (append_and_increment(&dst, android_data_dir.path, &dst_size) < 0 || append_and_increment(&dst, persona_prefix, &dst_size) < 0) { - LOGE("Error building prefix for APK path"); + ALOGE("Error building prefix for APK path"); return -1; } @@ -117,18 +117,18 @@ int create_persona_path(char path[PKG_PATH_MAX], if (append_and_increment(&dst, android_data_dir.path, &dst_size) < 0 || append_and_increment(&dst, persona_prefix, &dst_size) < 0) { - LOGE("Error building prefix for user path"); + ALOGE("Error building prefix for user path"); return -1; } if (persona != 0) { if (dst_size < uid_len + 1) { - LOGE("Error building user path"); + ALOGE("Error building user path"); return -1; } int ret = snprintf(dst, dst_size, "%d/", persona); if (ret < 0 || (size_t) ret != uid_len) { - LOGE("Error appending persona id to path"); + ALOGE("Error appending persona id to path"); return -1; } } @@ -163,7 +163,7 @@ int is_valid_package_name(const char* pkgname) { } else if (*x == '.') { if ((x == pkgname) || (x[1] == '.') || (x[1] == 0)) { /* periods must not be first, last, or doubled */ - LOGE("invalid package name '%s'\n", pkgname); + ALOGE("invalid package name '%s'\n", pkgname); return -1; } } else if (*x == '-') { @@ -172,7 +172,7 @@ int is_valid_package_name(const char* pkgname) { alpha = 1; } else { /* anything not A-Z, a-z, 0-9, _, or . is invalid */ - LOGE("invalid package name '%s'\n", pkgname); + ALOGE("invalid package name '%s'\n", pkgname); return -1; } @@ -184,7 +184,7 @@ int is_valid_package_name(const char* pkgname) { x++; while (*x) { if (!isalnum(*x)) { - LOGE("invalid package name '%s' should include only numbers after -\n", pkgname); + ALOGE("invalid package name '%s' should include only numbers after -\n", pkgname); return -1; } x++; @@ -222,13 +222,13 @@ static int _delete_dir_contents(DIR *d, const char *ignore) subfd = openat(dfd, name, O_RDONLY | O_DIRECTORY); if (subfd < 0) { - LOGE("Couldn't openat %s: %s\n", name, strerror(errno)); + ALOGE("Couldn't openat %s: %s\n", name, strerror(errno)); result = -1; continue; } subdir = fdopendir(subfd); if (subdir == NULL) { - LOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno)); + ALOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno)); close(subfd); result = -1; continue; @@ -238,12 +238,12 @@ static int _delete_dir_contents(DIR *d, const char *ignore) } closedir(subdir); if (unlinkat(dfd, name, AT_REMOVEDIR) < 0) { - LOGE("Couldn't unlinkat %s: %s\n", name, strerror(errno)); + ALOGE("Couldn't unlinkat %s: %s\n", name, strerror(errno)); result = -1; } } else { if (unlinkat(dfd, name, 0) < 0) { - LOGE("Couldn't unlinkat %s: %s\n", name, strerror(errno)); + ALOGE("Couldn't unlinkat %s: %s\n", name, strerror(errno)); result = -1; } } @@ -261,14 +261,14 @@ int delete_dir_contents(const char *pathname, d = opendir(pathname); if (d == NULL) { - LOGE("Couldn't opendir %s: %s\n", pathname, strerror(errno)); + ALOGE("Couldn't opendir %s: %s\n", pathname, strerror(errno)); return -errno; } res = _delete_dir_contents(d, ignore); closedir(d); if (also_delete_dir) { if (rmdir(pathname)) { - LOGE("Couldn't rmdir %s: %s\n", pathname, strerror(errno)); + ALOGE("Couldn't rmdir %s: %s\n", pathname, strerror(errno)); res = -1; } } @@ -282,12 +282,12 @@ int delete_dir_contents_fd(int dfd, const char *name) fd = openat(dfd, name, O_RDONLY | O_DIRECTORY); if (fd < 0) { - LOGE("Couldn't openat %s: %s\n", name, strerror(errno)); + ALOGE("Couldn't openat %s: %s\n", name, strerror(errno)); return -1; } d = fdopendir(fd); if (d == NULL) { - LOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno)); + ALOGE("Couldn't fdopendir %s: %s\n", name, strerror(errno)); close(fd); return -1; } @@ -307,7 +307,7 @@ int validate_system_app_path(const char* path) { const size_t dir_len = android_system_dirs.dirs[i].len; if (!strncmp(path, android_system_dirs.dirs[i].path, dir_len)) { if (path[dir_len] == '.' || strchr(path + dir_len, '/') != NULL) { - LOGE("invalid system apk path '%s' (trickery)\n", path); + ALOGE("invalid system apk path '%s' (trickery)\n", path); return -1; } return 0; @@ -377,7 +377,7 @@ int get_path_from_string(dir_rec_t* rec, const char* path) { if (append_and_increment(&dst, path, &dst_size) < 0 || append_and_increment(&dst, "/", &dst_size)) { - LOGE("Error canonicalizing path"); + ALOGE("Error canonicalizing path"); return -1; } @@ -395,7 +395,7 @@ int copy_and_append(dir_rec_t* dst, const dir_rec_t* src, const char* suffix) { if (dst->path == NULL || snprintf(dst->path, dstSize, "%s%s", src->path, suffix) != (ssize_t) dst->len) { - LOGE("Could not allocate memory to hold appended path; aborting\n"); + ALOGE("Could not allocate memory to hold appended path; aborting\n"); return -1; } @@ -422,7 +422,7 @@ int validate_apk_path(const char *path) dir_len = android_asec_dir.len; allowsubdir = 1; } else { - LOGE("invalid apk path '%s' (bad prefix)\n", path); + ALOGE("invalid apk path '%s' (bad prefix)\n", path); return -1; } @@ -435,7 +435,7 @@ int validate_apk_path(const char *path) ++subdir; if (!allowsubdir || (path_len > (size_t) (subdir - path) && (strchr(subdir, '/') != NULL))) { - LOGE("invalid apk path '%s' (subdir?)\n", path); + ALOGE("invalid apk path '%s' (subdir?)\n", path); return -1; } } @@ -446,7 +446,7 @@ int validate_apk_path(const char *path) */ if (path[dir_len] == '.' || (subdir != NULL && ((*subdir == '.') || (strchr(subdir, '/') != NULL)))) { - LOGE("invalid apk path '%s' (trickery)\n", path); + ALOGE("invalid apk path '%s' (trickery)\n", path); return -1; } |