summaryrefslogtreecommitdiffstats
path: root/cmds/keystore/keymgmt.c
diff options
context:
space:
mode:
authorHung-ying Tyan <tyanh@google.com>2009-09-11 18:34:28 +0800
committerHung-ying Tyan <tyanh@google.com>2009-09-11 19:30:13 +0800
commitb2de5bd4dafa0c8a494a654210298d2be8bb04f8 (patch)
treebee0f90ddf3b16babca025dd93676509b93aeff6 /cmds/keystore/keymgmt.c
parent63a85fc420537d6bf2b8717d35c578806056b9e7 (diff)
downloadframeworks_native-b2de5bd4dafa0c8a494a654210298d2be8bb04f8.zip
frameworks_native-b2de5bd4dafa0c8a494a654210298d2be8bb04f8.tar.gz
frameworks_native-b2de5bd4dafa0c8a494a654210298d2be8bb04f8.tar.bz2
Add tests and misc fixes on keystore.
* Refactor netkeystore.c to make client and server code testable. * Add a client test for setting new passwd and changing passwd. * Exclude "." and ".." from reset_keystore(). * Change ServerCommand.executeCommand() to accept variable length of arguments and add convert() to marshalling the args to bytes. * Keystore.java is revised accordingly.
Diffstat (limited to 'cmds/keystore/keymgmt.c')
-rw-r--r--cmds/keystore/keymgmt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmds/keystore/keymgmt.c b/cmds/keystore/keymgmt.c
index 69e0380..b5ace86 100644
--- a/cmds/keystore/keymgmt.c
+++ b/cmds/keystore/keymgmt.c
@@ -385,7 +385,10 @@ int reset_keystore()
return -1;
}
while ((de = readdir(d))) {
- if (unlink(de->d_name) != 0) ret = -1;
+ char *dirname = de->d_name;
+ if (strcmp(".", dirname) == 0) continue;
+ if (strcmp("..", dirname) == 0) continue;
+ if (unlink(dirname) != 0) ret = -1;
}
closedir(d);
state = UNINITIALIZED;