summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
authorSuchi Amalapurapu <asuchitra@google.com>2010-01-25 12:19:12 -0800
committerSuchi Amalapurapu <asuchitra@google.com>2010-01-27 10:26:43 -0800
commitc028be4f3b8c7476b46859f66c3f33d528adf181 (patch)
tree8a740e6207e958572706a636fcb92425dbf13a6e /cmds
parentaeb4126736c1b93abe5252e1723c568a13da7c81 (diff)
downloadframeworks_base-c028be4f3b8c7476b46859f66c3f33d528adf181.zip
frameworks_base-c028be4f3b8c7476b46859f66c3f33d528adf181.tar.gz
frameworks_base-c028be4f3b8c7476b46859f66c3f33d528adf181.tar.bz2
AppsOnSd feature - Add default container
Add new remote interface to do temporary copies. The new remote stub handling is done on mHandler thread and doesn't need locking for now. Add new InstallArgs class and subclasses to isolate cases for installation. Move resource deletion for failed installs/upgrades to later on in installation cycle. Fix code path for forward locked apps when using scanPackageLI TODO's Fix installation paths to completely use InstallArgs based design later on. Get rid of using flags in various install/uninstall code paths. Ideally InstallArgs should be created using these flags and used in the rest of the code. Function renames. Revisit mount api's.
Diffstat (limited to 'cmds')
-rw-r--r--cmds/installd/utils.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/cmds/installd/utils.c b/cmds/installd/utils.c
index 5db5545..555c19e 100644
--- a/cmds/installd/utils.c
+++ b/cmds/installd/utils.c
@@ -33,6 +33,7 @@ int create_pkg_path(char path[PKG_PATH_MAX],
}
x = pkgname;
+ int alpha = -1;
while (*x) {
if (isalnum(*x) || (*x == '_')) {
/* alphanumeric or underscore are fine */
@@ -42,13 +43,28 @@ int create_pkg_path(char path[PKG_PATH_MAX],
LOGE("invalid package name '%s'\n", pkgname);
return -1;
}
- } else {
+ } else if (*x == '-') {
+ /* Suffix -X is fine to let versioning of packages.
+ But whatever follows should be alphanumeric.*/
+ alpha = 1;
+ }else {
/* anything not A-Z, a-z, 0-9, _, or . is invalid */
LOGE("invalid package name '%s'\n", pkgname);
return -1;
}
x++;
}
+ if (alpha == 1) {
+ // Skip current character
+ x++;
+ while (*x) {
+ if (!isalnum(*x)) {
+ LOGE("invalid package name '%s' should include only numbers after -\n", pkgname);
+ return -1;
+ }
+ x++;
+ }
+ }
sprintf(path, "%s%s%s", prefix, pkgname, postfix);
return 0;