Signed-off-by: Jeff Layton <[email protected]>
---
cifscreds.c | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/cifscreds.c b/cifscreds.c
index c86c1f9..c1edf71 100644
--- a/cifscreds.c
+++ b/cifscreds.c
@@ -97,9 +97,9 @@ create_description(const char *addr, const char *user, char
*desc)
/* search a specific key in keyring */
static key_serial_t
-key_search(const char *addr, const char *user, const char *domain)
+key_search(const char *addr, const char *user)
{
- char desc[INET6_ADDRSTRLEN + MAX_USERNAME_SIZE + MAX_DOMAIN_SIZE + \
+ char desc[INET6_ADDRSTRLEN + MAX_USERNAME_SIZE + \
+ sizeof(THIS_PROGRAM_NAME) + 3];
key_serial_t key, *pk;
void *keylist;
@@ -262,9 +262,7 @@ static int cifscreds_add(int argc, char *argv[])
*nextaddress++ = '\0';
while (currentaddress) {
- if (key_search(currentaddress, argv[3],
- argc == 5 ? argv[4] : NULL) > 0
- ) {
+ if (key_search(currentaddress, argv[3]) > 0) {
printf("You already have stashed credentials "
"for %s (%s)\n", currentaddress, argv[2]);
printf("If you want to update them use:\n");
@@ -372,8 +370,7 @@ static int cifscreds_clear(int argc, char *argv[])
*nextaddress++ = '\0';
while (currentaddress) {
- key_serial_t key = key_search(currentaddress, argv[3],
- argc == 5 ? argv[4] : NULL);
+ key_serial_t key = key_search(currentaddress, argv[3]);
if (key > 0) {
if (keyctl(KEYCTL_UNLINK, key, DEST_KEYRING) < 0) {
fprintf(stderr, "error: Removing key from "
@@ -487,9 +484,7 @@ static int cifscreds_update(int argc, char *argv[])
*nextaddress++ = '\0';
while (currentaddress) {
- if (key_search(currentaddress, argv[3],
- argc == 5 ? argv[4] : NULL) > 0
- ) {
+ if (key_search(currentaddress, argv[3]) > 0) {
addrs[count] = currentaddress;
count++;
}
--
1.7.7.3
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html