1
0
mirror of https://github.com/docker/docker-credential-helpers.git synced 2026-06-14 00:11:28 +05:30

28 Commits

Author SHA1 Message Date
Alakesh Haloi 48bfed47cc Fix return values in List() in secretservice_linux.go
In case of error, return nil for expected map along with error

Signed-off-by: Alakesh Haloi <alakeshh@amazon.com>
2021-09-07 17:14:20 -07:00
Qi Wang 8086f00d7d List wraps the error from secretservice_linux.c.
List wraps the error from secretservice_linux.c so the List can give the caller more useful error message for diagnosing.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2021-08-28 20:44:52 -04:00
Sebastiaan van Stijn 7a2694fc98 fix some linting issues
/go/src/github.com/docker/docker-credential-helper/pass/pass.go:1:1: package comment should be of the form "Package pass ..."
    /go/src/github.com/docker/docker-credential-helper/pass/pass.go:22:7: don't use ALL_CAPS in Go names; use CamelCase
    /go/src/github.com/docker/docker-credential-helper/pass/pass.go:22:7: exported const PASS_FOLDER should have comment or be unexported
    /go/src/github.com/docker/docker-credential-helper/pass/pass.go:82:1: receiver name h should be consistent with previous receiver name p for Pass
    /go/src/github.com/docker/docker-credential-helper/pass/pass.go:94:1: receiver name h should be consistent with previous receiver name p for Pass
    /go/src/github.com/docker/docker-credential-helper/pass/pass.go:131:1: receiver name h should be consistent with previous receiver name p for Pass
    /go/src/github.com/docker/docker-credential-helper/pass/pass.go:161:1: receiver name h should be consistent with previous receiver name p for Pass
    /go/src/github.com/docker/docker-credential-helper/registryurl/url_go18.go:9:1: exported function GetHostname should have comment or be unexported
    /go/src/github.com/docker/docker-credential-helper/registryurl/url_go18.go:13:1: exported function GetPort should have comment or be unexported
    /go/src/github.com/docker/docker-credential-helper/secretservice/secretservice_linux_test.go:22:2: don't use underscores in Go names; var old_auths should be oldAuths
    /go/src/github.com/docker/docker-credential-helper/secretservice/secretservice_linux_test.go:64:2: don't use underscores in Go names; var new_auths should be newAuths

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-01 10:22:11 +02:00
Justin Cormack 87c80bfba5 Fix a double free in the List functions
The code was set up so that it would free the individual items and the data
in `freeListData`, but there was already a Go `defer` to free the data item,
resulting in a double free.

Remove the `free` in `freeListData` and leave the original one.

In addition, move the `defer` for freeing the list data before the error
check, so that the data is also free in the error case. This just removes
a minor leak.

This vulnerability was discovered by:
Jasiel Spelman of Trend Micro Zero Day Initiative and Trend Micro Team Nebula

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2019-07-01 14:41:30 +01:00
Vincent Demeester 73e5f5dbfe Merge pull request #29 from dekkagaijin/freefix
C.free(unsafe.Pointer(err)) -> C.g_error_free(err)
2018-07-19 09:47:51 +02:00
Daniel Joos cdde659563 Workaround for Linux 32-bit build
This adds a workaround for the `secretservice` sub-package to build under 32bit Linux.
It limits the total number of list entries to (2^29)-1.
A short explanation of how this number was calculated has been added in a comment.

Signed-off-by: Daniel Joos <daniel@joosweb.de>
2017-05-10 00:38:33 +02:00
Nassim Eddequiouaq 7f0538cd5e Merge pull request #50 from n4ss/fix-secserv-tests
Fix secretservice tests and expected behaviors
2017-03-13 11:56:46 -07:00
Nassim 'Nass' Eddequiouaq 2f2e85cfb9 Remove unnecessary creds list's size check
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-03-10 16:59:57 +01:00
Nassim 'Nass' Eddequiouaq 47566329ff Fix secretservice tests and expected behaviors
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-03-10 07:29:25 -08:00
Nassim 'Nass' Eddequiouaq b9d19b479a Return empty server-url to usernames map if no search results
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-03-10 15:23:43 +01:00
Nassim 'Nass' Eddequiouaq e522e56699 Fix memory leaks and non-null terminated strings usage
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-03-10 15:23:17 +01:00
Nassim 'Nass' Eddequiouaq 8cb3338668 Filter docker credentials with label directly through libsecret
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-03-10 15:18:14 +01:00
Nassim 'Nass' Eddequiouaq cd76e4253f Use the proper docker secret schema for items to search for
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-03-10 15:15:05 +01:00
Nassim 'Nass' Eddequiouaq 021d7d6a19 Add label filter on the list of secrets
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-03-10 15:14:34 +01:00
Nassim 'Nass' Eddequiouaq 2a8670e0da Cleanup original modifications to the exposed APIs
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-03-10 15:14:04 +01:00
Nassim 'Nass' Eddequiouaq c6cf8aa13b Add Label to Credentials in test files
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-03-10 15:12:32 +01:00
Nassim 'Nass' Eddequiouaq cfe7556d6d [SYNTAX] Run gofmt on changed files
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-03-10 15:12:12 +01:00
Nassim 'Nass' Eddequiouaq f7f2744e6d Add a Docker Credentials label support for linux
Signed-off-by: Nassim 'Nass' Eddequiouaq <eddequiouaq.nassim@gmail.com>
2017-03-10 15:11:25 +01:00
Jake Sanders 79f93e5e69 C.free(unsafe.Pointer(err)) -> defer C.g_error_free(err)
Signed-off-by: Jake Sanders <jsand@google.com>
2016-09-15 09:14:53 -07:00
Jake Sanders c45d9e9e28 Implement client.List, change list API
[]string, []string -> map[string]string because the other APIs assume a
1:1 correspondence

Signed-off-by: Jake Sanders <jsand@google.com>
2016-09-02 15:15:12 -07:00
Avi Vaid d2e6ed779a moved loop variable declaration to comply with c mode in travis
Signed-off-by: Avi Vaid <avaid1996@gmail.com>
2016-07-12 12:51:30 -04:00
Avi Vaid 59b3d54595 added better test for list in linux
Signed-off-by: Avi Vaid <avaid1996@gmail.com>
2016-07-12 02:52:44 -04:00
Avi Vaid 7566a1e399 implemented freeing memory in secretservice and made minor edits to osxkeychain
Signed-off-by: Avi Vaid <avaid1996@gmail.com>
2016-07-11 19:45:37 -04:00
Avi Vaid 72661b3103 Implemented list functionality for secretservice- linux
Signed-off-by: Avi Vaid <avaid1996@gmail.com>
2016-07-11 19:33:35 -04:00
David Calavera c4fc9c07dd Add client functions to allow integrations within other CLIs.
This is a simplification of how the docker engine implements
this feature, but it will be ported there once this is merged.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-05-30 12:32:26 -07:00
David Calavera df8c7a02f1 Publish helper structs and methods.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-03-24 15:08:17 -07:00
David Calavera 2275377a31 Move away from password as a name. We store secrets.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-03-09 16:16:01 -05:00
Antonio Murdaca a96948acb3 secretservice: add D-Bus secret service
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-07 15:03:35 +01:00