mirror of https://github.com/containers/podman.git
				
				
				
			Merge pull request #13975 from containers/dependabot/go_modules/github.com/fsnotify/fsnotify-1.5.3
Bump github.com/fsnotify/fsnotify from 1.5.2 to 1.5.3
This commit is contained in:
		
						commit
						9168faffbf
					
				
							
								
								
									
										2
									
								
								go.mod
								
								
								
								
							
							
						
						
									
										2
									
								
								go.mod
								
								
								
								
							|  | @ -29,7 +29,7 @@ require ( | |||
| 	github.com/docker/go-plugins-helpers v0.0.0-20211224144127-6eecb7beb651 | ||||
| 	github.com/docker/go-units v0.4.0 | ||||
| 	github.com/dtylman/scp v0.0.0-20181017070807-f3000a34aef4 | ||||
| 	github.com/fsnotify/fsnotify v1.5.2 | ||||
| 	github.com/fsnotify/fsnotify v1.5.3 | ||||
| 	github.com/ghodss/yaml v1.0.0 | ||||
| 	github.com/godbus/dbus/v5 v5.1.0 | ||||
| 	github.com/google/gofuzz v1.2.0 | ||||
|  |  | |||
							
								
								
									
										4
									
								
								go.sum
								
								
								
								
							
							
						
						
									
										4
									
								
								go.sum
								
								
								
								
							|  | @ -513,8 +513,8 @@ github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM | |||
| github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= | ||||
| github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= | ||||
| github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= | ||||
| github.com/fsnotify/fsnotify v1.5.2 h1:M+aHumjFDOySyAjWICQHrDfuizRTP7nzkRHxXfyRP68= | ||||
| github.com/fsnotify/fsnotify v1.5.2/go.mod h1:VKyWoa5earkjWzuYFJOy3s0DLrlWgSh5nf5hjFuJcAw= | ||||
| github.com/fsnotify/fsnotify v1.5.3 h1:vNFpj2z7YIbwh2bw7x35sqYpp2wfuq+pivKbWG09B8c= | ||||
| github.com/fsnotify/fsnotify v1.5.3/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= | ||||
| github.com/fsouza/go-dockerclient v1.7.7/go.mod h1:njNCXvoZj3sLPjf3yO0DPHf1mdLdCPDYPc14GskKA4Y= | ||||
| github.com/fsouza/go-dockerclient v1.7.10 h1:KIda66AP88BWQpyg+8ve9LQmn1ZZ/usCbmxeBoMth3U= | ||||
| github.com/fsouza/go-dockerclient v1.7.10/go.mod h1:rdD3Eq3rHwMA8p/xrn+gLb+3ov7uRJGVkV1HsUFY39A= | ||||
|  |  | |||
|  | @ -48,6 +48,18 @@ fsnotify uses build tags to compile different code on Linux, BSD, macOS, and Win | |||
| 
 | ||||
| Before doing a pull request, please do your best to test your changes on multiple platforms, and list which platforms you were able/unable to test on. | ||||
| 
 | ||||
| To aid in cross-platform testing there is a Vagrantfile for Linux and BSD. | ||||
| 
 | ||||
| * Install [Vagrant](http://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/) | ||||
| * Setup [Vagrant Gopher](https://github.com/nathany/vagrant-gopher) in your `src` folder. | ||||
| * Run `vagrant up` from the project folder. You can also setup just one box with `vagrant up linux` or `vagrant up bsd` (note: the BSD box doesn't support Windows hosts at this time, and NFS may prompt for your host OS password) | ||||
| * Once setup, you can run the test suite on a given OS with a single command `vagrant ssh linux -c 'cd fsnotify/fsnotify; go test'`. | ||||
| * When you're done, you will want to halt or destroy the Vagrant boxes. | ||||
| 
 | ||||
| Notice: fsnotify file system events won't trigger in shared folders. The tests get around this limitation by using the /tmp directory. | ||||
| 
 | ||||
| Right now there is no equivalent solution for Windows and macOS, but there are Windows VMs [freely available from Microsoft](http://www.modern.ie/en-us/virtualization-tools#downloads). | ||||
| 
 | ||||
| ### Maintainers | ||||
| 
 | ||||
| Help maintaining fsnotify is welcome. To be a maintainer: | ||||
|  | @ -55,6 +67,11 @@ Help maintaining fsnotify is welcome. To be a maintainer: | |||
| * Submit a pull request and sign the CLA as above. | ||||
| * You must be able to run the test suite on Mac, Windows, Linux and BSD. | ||||
| 
 | ||||
| To keep master clean, the fsnotify project uses the "apply mail" workflow outlined in Nathaniel Talbott's post ["Merge pull request" Considered Harmful][am]. This requires installing [hub][]. | ||||
| 
 | ||||
| All code changes should be internal pull requests. | ||||
| 
 | ||||
| Releases are tagged using [Semantic Versioning](http://semver.org/). | ||||
| 
 | ||||
| [hub]: https://github.com/github/hub | ||||
| [am]: http://blog.spreedly.com/2014/06/24/merge-pull-request-considered-harmful/#.VGa5yZPF_Zs | ||||
|  |  | |||
|  | @ -1,122 +1,40 @@ | |||
| # File system notifications for Go | ||||
| # WARNING | ||||
| 
 | ||||
| [](https://pkg.go.dev/github.com/fsnotify/fsnotify) [](https://goreportcard.com/report/github.com/fsnotify/fsnotify) [](https://github.com/fsnotify/fsnotify/issues/413) | ||||
| If you are reading this, you use `master` branch of this repository, | ||||
| which is wrong. | ||||
| 
 | ||||
| This branch | ||||
|  - should not be used; | ||||
|  - is not maintained; | ||||
|  - is not supported; | ||||
|  - will be removed soon. | ||||
| 
 | ||||
| You should switch to using the default branch instead. | ||||
| 
 | ||||
| fsnotify utilizes [golang.org/x/sys](https://godoc.org/golang.org/x/sys) rather than `syscall` from the standard library.  | ||||
| ## Using git | ||||
| 
 | ||||
| Cross platform: Windows, Linux, BSD and macOS. | ||||
| Here's how to switch your existing local copy of this repository from `master` | ||||
| to `main` (assuming the remote name is `origin`): | ||||
| 
 | ||||
| | Adapter               | OS                               | Status                                                                                                                          | | ||||
| | --------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | | ||||
| | inotify               | Linux 2.6.27 or later, Android\* | Supported | | ||||
| | kqueue                | BSD, macOS, iOS\*                | Supported | | ||||
| | ReadDirectoryChangesW | Windows                          | Supported | | ||||
| | FSEvents              | macOS                            | [Planned](https://github.com/fsnotify/fsnotify/issues/11)                                                                       | | ||||
| | FEN                   | Solaris 11                       | [In Progress](https://github.com/fsnotify/fsnotify/pull/371)                                                                   | | ||||
| | fanotify              | Linux 2.6.37+                    | [Maybe](https://github.com/fsnotify/fsnotify/issues/114)                                                                      | | ||||
| | USN Journals          | Windows                          | [Maybe](https://github.com/fsnotify/fsnotify/issues/53)                                                                         | | ||||
| | Polling               | *All*                            | [Maybe](https://github.com/fsnotify/fsnotify/issues/9)                                                                          | | ||||
| 
 | ||||
| \* Android and iOS are untested. | ||||
| 
 | ||||
| Please see [the documentation](https://pkg.go.dev/github.com/fsnotify/fsnotify) and consult the [FAQ](#faq) for usage information. | ||||
| 
 | ||||
| ## API stability | ||||
| 
 | ||||
| fsnotify is a fork of [howeyc/fsnotify](https://github.com/howeyc/fsnotify) with a new API as of v1.0. The API is based on [this design document](http://goo.gl/MrYxyA).  | ||||
| 
 | ||||
| All [releases](https://github.com/fsnotify/fsnotify/releases) are tagged based on [Semantic Versioning](http://semver.org/). | ||||
| 
 | ||||
| ## Usage | ||||
| 
 | ||||
| ```go | ||||
| package main | ||||
| 
 | ||||
| import ( | ||||
| 	"log" | ||||
| 
 | ||||
| 	"github.com/fsnotify/fsnotify" | ||||
| ) | ||||
| 
 | ||||
| func main() { | ||||
| 	watcher, err := fsnotify.NewWatcher() | ||||
| 	if err != nil { | ||||
| 		log.Fatal(err) | ||||
| 	} | ||||
| 	defer watcher.Close() | ||||
| 
 | ||||
| 	done := make(chan bool) | ||||
| 	go func() { | ||||
| 		for { | ||||
| 			select { | ||||
| 			case event, ok := <-watcher.Events: | ||||
| 				if !ok { | ||||
| 					return | ||||
| 				} | ||||
| 				log.Println("event:", event) | ||||
| 				if event.Op&fsnotify.Write == fsnotify.Write { | ||||
| 					log.Println("modified file:", event.Name) | ||||
| 				} | ||||
| 			case err, ok := <-watcher.Errors: | ||||
| 				if !ok { | ||||
| 					return | ||||
| 				} | ||||
| 				log.Println("error:", err) | ||||
| 			} | ||||
| 		} | ||||
| 	}() | ||||
| 
 | ||||
| 	err = watcher.Add("/tmp/foo") | ||||
| 	if err != nil { | ||||
| 		log.Fatal(err) | ||||
| 	} | ||||
| 	<-done | ||||
| } | ||||
| ``` | ||||
| git branch -m master main | ||||
| git fetch origin | ||||
| git branch -u origin/main main | ||||
| git remote set-head origin -a | ||||
| ``` | ||||
| 
 | ||||
| ## Contributing | ||||
| In addition to the above, if you want to remove the leftover `origin/master` | ||||
| remote branch (NOTE this also removes all other remote branches that no longer | ||||
| exist in `origin`): | ||||
| 
 | ||||
| Please refer to [CONTRIBUTING][] before opening an issue or pull request. | ||||
| ``` | ||||
| git remote prune origin | ||||
| ``` | ||||
| 
 | ||||
| ## FAQ | ||||
| ## Background | ||||
| 
 | ||||
| **When a file is moved to another directory is it still being watched?** | ||||
| 
 | ||||
| No (it shouldn't be, unless you are watching where it was moved to). | ||||
| 
 | ||||
| **When I watch a directory, are all subdirectories watched as well?** | ||||
| 
 | ||||
| No, you must add watches for any directory you want to watch (a recursive watcher is on the roadmap [#18][]). | ||||
| 
 | ||||
| **Do I have to watch the Error and Event channels in a separate goroutine?** | ||||
| 
 | ||||
| As of now, yes. Looking into making this single-thread friendly (see [howeyc #7][#7]) | ||||
| 
 | ||||
| **Why am I receiving multiple events for the same file on OS X?** | ||||
| 
 | ||||
| Spotlight indexing on OS X can result in multiple events (see [howeyc #62][#62]). A temporary workaround is to add your folder(s) to the *Spotlight Privacy settings* until we have a native FSEvents implementation (see [#11][]). | ||||
| 
 | ||||
| **How many files can be watched at once?** | ||||
| 
 | ||||
| There are OS-specific limits as to how many watches can be created: | ||||
| * Linux: /proc/sys/fs/inotify/max_user_watches contains the limit, reaching this limit results in a "no space left on device" error. | ||||
| * BSD / OSX: sysctl variables "kern.maxfiles" and "kern.maxfilesperproc", reaching these limits results in a "too many open files" error. | ||||
| 
 | ||||
| **Why don't notifications work with NFS filesystems or filesystem in userspace (FUSE)?** | ||||
| 
 | ||||
| fsnotify requires support from underlying OS to work. The current NFS protocol does not provide network level support for file notifications. | ||||
| 
 | ||||
| [#62]: https://github.com/howeyc/fsnotify/issues/62 | ||||
| [#18]: https://github.com/fsnotify/fsnotify/issues/18 | ||||
| [#11]: https://github.com/fsnotify/fsnotify/issues/11 | ||||
| [#7]: https://github.com/howeyc/fsnotify/issues/7 | ||||
| 
 | ||||
| [contributing]: https://github.com/fsnotify/fsnotify/blob/master/CONTRIBUTING.md | ||||
| 
 | ||||
| ## Related Projects | ||||
| 
 | ||||
| * [notify](https://github.com/rjeczalik/notify) | ||||
| * [fsevents](https://github.com/fsnotify/fsevents) | ||||
| The `master` branch was renamed to `main`, causing an issue with | ||||
| Yocto/OpenEmbedded's meta-virtualization layer, which explicitly refers | ||||
| to `master` branch of this repository (see #426). | ||||
| 
 | ||||
| This temporary branch is created to alleviate the Yocto/OE issue. | ||||
|  |  | |||
|  | @ -1,36 +0,0 @@ | |||
| // Copyright 2022 The Go Authors. All rights reserved.
 | ||||
| // Use of this source code is governed by a BSD-style
 | ||||
| // license that can be found in the LICENSE file.
 | ||||
| 
 | ||||
| //go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !solaris && !windows
 | ||||
| // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!solaris,!windows
 | ||||
| 
 | ||||
| package fsnotify | ||||
| 
 | ||||
| import ( | ||||
| 	"fmt" | ||||
| 	"runtime" | ||||
| ) | ||||
| 
 | ||||
| // Watcher watches a set of files, delivering events to a channel.
 | ||||
| type Watcher struct{} | ||||
| 
 | ||||
| // NewWatcher establishes a new watcher with the underlying OS and begins waiting for events.
 | ||||
| func NewWatcher() (*Watcher, error) { | ||||
| 	return nil, fmt.Errorf("fsnotify not supported on %s", runtime.GOOS) | ||||
| } | ||||
| 
 | ||||
| // Close removes all watches and closes the events channel.
 | ||||
| func (w *Watcher) Close() error { | ||||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| // Add starts watching the named file or directory (non-recursively).
 | ||||
| func (w *Watcher) Add(name string) error { | ||||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| // Remove stops watching the the named file or directory (non-recursively).
 | ||||
| func (w *Watcher) Remove(name string) error { | ||||
| 	return nil | ||||
| } | ||||
|  | @ -1,6 +1,6 @@ | |||
| module github.com/fsnotify/fsnotify | ||||
| 
 | ||||
| go 1.16 | ||||
| go 1.13 | ||||
| 
 | ||||
| require golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c | ||||
| 
 | ||||
|  |  | |||
|  | @ -163,19 +163,6 @@ func (w *Watcher) Remove(name string) error { | |||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| // WatchList returns the directories and files that are being monitered.
 | ||||
| func (w *Watcher) WatchList() []string { | ||||
| 	w.mu.Lock() | ||||
| 	defer w.mu.Unlock() | ||||
| 
 | ||||
| 	entries := make([]string, 0, len(w.watches)) | ||||
| 	for pathname := range w.watches { | ||||
| 		entries = append(entries, pathname) | ||||
| 	} | ||||
| 
 | ||||
| 	return entries | ||||
| } | ||||
| 
 | ||||
| type watch struct { | ||||
| 	wd    uint32 // Watch descriptor (as returned by the inotify_add_watch() syscall)
 | ||||
| 	flags uint32 // inotify flags of this watch (see inotify(7) for the list of valid flags)
 | ||||
|  |  | |||
|  | @ -38,6 +38,7 @@ func newFdPoller(fd int) (*fdPoller, error) { | |||
| 			poller.close() | ||||
| 		} | ||||
| 	}() | ||||
| 	poller.fd = fd | ||||
| 
 | ||||
| 	// Create epoll fd
 | ||||
| 	poller.epfd, errno = unix.EpollCreate1(unix.EPOLL_CLOEXEC) | ||||
|  |  | |||
|  | @ -148,19 +148,6 @@ func (w *Watcher) Remove(name string) error { | |||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| // WatchList returns the directories and files that are being monitered.
 | ||||
| func (w *Watcher) WatchList() []string { | ||||
| 	w.mu.Lock() | ||||
| 	defer w.mu.Unlock() | ||||
| 
 | ||||
| 	entries := make([]string, 0, len(w.watches)) | ||||
| 	for pathname := range w.watches { | ||||
| 		entries = append(entries, pathname) | ||||
| 	} | ||||
| 
 | ||||
| 	return entries | ||||
| } | ||||
| 
 | ||||
| // Watch all events (except NOTE_EXTEND, NOTE_LINK, NOTE_REVOKE)
 | ||||
| const noteAllEvents = unix.NOTE_DELETE | unix.NOTE_WRITE | unix.NOTE_ATTRIB | unix.NOTE_RENAME | ||||
| 
 | ||||
|  |  | |||
|  | @ -12,7 +12,6 @@ import ( | |||
| 	"fmt" | ||||
| 	"os" | ||||
| 	"path/filepath" | ||||
| 	"reflect" | ||||
| 	"runtime" | ||||
| 	"sync" | ||||
| 	"syscall" | ||||
|  | @ -97,21 +96,6 @@ func (w *Watcher) Remove(name string) error { | |||
| 	return <-in.reply | ||||
| } | ||||
| 
 | ||||
| // WatchList returns the directories and files that are being monitered.
 | ||||
| func (w *Watcher) WatchList() []string { | ||||
| 	w.mu.Lock() | ||||
| 	w.mu.Unlock() | ||||
| 
 | ||||
| 	entries := make([]string, 0, len(w.watches)) | ||||
| 	for _, entry := range w.watches { | ||||
| 		for _, watchEntry := range entry { | ||||
| 			entries = append(entries, watchEntry.path) | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	return entries | ||||
| } | ||||
| 
 | ||||
| const ( | ||||
| 	// Options for AddWatch
 | ||||
| 	sysFSONESHOT = 0x80000000 | ||||
|  | @ -468,16 +452,8 @@ func (w *Watcher) readEvents() { | |||
| 
 | ||||
| 			// Point "raw" to the event in the buffer
 | ||||
| 			raw := (*syscall.FileNotifyInformation)(unsafe.Pointer(&watch.buf[offset])) | ||||
| 			// TODO: Consider using unsafe.Slice that is available from go1.17
 | ||||
| 			// https://stackoverflow.com/questions/51187973/how-to-create-an-array-or-a-slice-from-an-array-unsafe-pointer-in-golang
 | ||||
| 			// instead of using a fixed syscall.MAX_PATH buf, we create a buf that is the size of the path name
 | ||||
| 			size := int(raw.FileNameLength / 2) | ||||
| 			var buf []uint16 | ||||
| 			sh := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) | ||||
| 			sh.Data = uintptr(unsafe.Pointer(&raw.FileName)) | ||||
| 			sh.Len = size | ||||
| 			sh.Cap = size | ||||
| 			name := syscall.UTF16ToString(buf) | ||||
| 			buf := (*[syscall.MAX_PATH]uint16)(unsafe.Pointer(&raw.FileName)) | ||||
| 			name := syscall.UTF16ToString(buf[:raw.FileNameLength/2]) | ||||
| 			fullname := filepath.Join(watch.path, name) | ||||
| 
 | ||||
| 			var mask uint64 | ||||
|  |  | |||
|  | @ -387,7 +387,7 @@ github.com/docker/libnetwork/types | |||
| github.com/dtylman/scp | ||||
| # github.com/felixge/httpsnoop v1.0.1 | ||||
| github.com/felixge/httpsnoop | ||||
| # github.com/fsnotify/fsnotify v1.5.2 | ||||
| # github.com/fsnotify/fsnotify v1.5.3 | ||||
| ## explicit | ||||
| github.com/fsnotify/fsnotify | ||||
| # github.com/fsouza/go-dockerclient v1.7.10 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue