moby--moby/pkg
Kir Kolyshkin 669056f93d pkg/system.getxattr: handle changed size case
lgetxattr(2) man page says:

> If size is specified as zero, these calls return the  current  size  of
> the  named extended attribute (and leave value unchanged).  This can be
> used to determine the size of the buffer that should be supplied  in  a
> subsequent  call.   (But, bear in mind that there is a possibility that
> the attribute value may change between the two calls,  so  that  it  is
> still necessary to check the return status from the second call.)

The current code does not handle the case when the size changes between
the two calls, and the new size is larger.

Fix the above problem, and slightly simplify the code.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-02-26 07:56:12 -08:00
..
aaparser Add canonical import comment 2018-02-05 16:51:57 -05:00
archive bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
authorization fix goimports 2020-02-11 22:16:54 +09:00
broadcaster Various code-cleanup 2018-05-23 17:50:54 +02:00
capabilities Add more import comments 2019-04-10 16:59:33 +02:00
chrootarchive bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
containerfs pkg/containerfs: normalize comment formatting 2019-11-27 15:39:57 +01:00
devicemapper pkg/devicemapper ignore SA4000 false positive (staticcheck) 2019-09-18 12:57:52 +02:00
directory TestMoveToSubdir: use sort.Strings() (gosimple) 2019-09-18 12:55:45 +02:00
discovery bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
dmesg Use Klogctl from x/sys/unix to read Linux kernel log 2019-08-22 08:25:13 +02:00
filenotify TestPollerEvent: fix filemode (staticcheck) 2019-09-18 12:57:56 +02:00
fileutils bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
fsutils Add canonical import comment 2018-02-05 16:51:57 -05:00
homedir pkg/homedir: clarify Get() docs wrt static linking 2019-10-24 16:39:24 -07:00
idtools bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
ioutils bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
jsonmessage bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
locker Add canonical import comment 2018-02-05 16:51:57 -05:00
longpath Add canonical import comment 2018-02-05 16:51:57 -05:00
loopback Use correct `LOOP_CTL_GET_FREE` API in `pkg/loopback` 2019-08-27 06:22:10 -07:00
mount bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
namesgenerator Add George Washington Carver to name generator 2020-01-20 14:59:36 -08:00
parsers bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
pidfile Allow system.MkDirAll() to be used as drop-in for os.MkDirAll() 2019-08-08 15:05:49 +02:00
platform Use unix.Uname instead of shelling out to uname on darwin/freebsd 2019-09-03 22:43:16 +02:00
plugingetter Move plugin client to separate interface 2018-05-30 15:22:10 -04:00
plugins bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
pools bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
progress pkg/progress: normalize comment formatting 2019-11-27 15:41:23 +01:00
pubsub Make sure timers are stopped after use. 2019-01-16 14:32:53 -08:00
reexec bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
signal bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
stdcopy Merge pull request #37088 from ohbarye/fix-typos-duplicated-the 2018-05-19 20:57:47 +02:00
streamformatter bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
stringid Entropy cannot be saved 2019-06-07 11:54:45 +01:00
symlink Update LICENSE 2018-09-12 14:27:53 +01:00
sysinfo bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
system pkg/system.getxattr: handle changed size case 2020-02-26 07:56:12 -08:00
tailfile bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
tarsum bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
term bump gotest.tools v3.0.1 for compatibility with Go 1.14 2020-02-11 00:06:42 +01:00
truncindex Entropy cannot be saved 2019-06-07 11:54:45 +01:00
urlutil Be explicit about github.com prefix being a legacy feature 2018-05-30 11:09:14 +02:00
useragent Add canonical import comment 2018-02-05 16:51:57 -05:00
README.md Rename a few docker to moby 2017-10-25 13:56:12 +02:00

README.md

pkg/ is a collection of utility packages used by the Moby project without being specific to its internals.

Utility packages are kept separate from the moby core codebase to keep it as small and concise as possible. If some utilities grow larger and their APIs stabilize, they may be moved to their own repository under the Moby organization, to facilitate re-use by other projects. However that is not the priority.

The directory pkg is named after the same directory in the camlistore project. Since Brad is a core Go maintainer, we thought it made sense to copy his methods for organizing Go code :) Thanks Brad!

Because utility packages are small and neatly separated from the rest of the codebase, they are a good place to start for aspiring maintainers and contributors. Get in touch if you want to help maintain them!