Update continuity dependency
This change ensures that Windows security info is copied. Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
		
							
								
								
									
										4
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								go.mod
									
									
									
									
									
								
							| @@ -4,14 +4,14 @@ go 1.16 | |||||||
|  |  | ||||||
| require ( | require ( | ||||||
| 	github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8 | 	github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8 | ||||||
| 	github.com/Microsoft/go-winio v0.5.0 | 	github.com/Microsoft/go-winio v0.5.1 | ||||||
| 	github.com/Microsoft/hcsshim v0.9.1 | 	github.com/Microsoft/hcsshim v0.9.1 | ||||||
| 	github.com/containerd/aufs v1.0.0 | 	github.com/containerd/aufs v1.0.0 | ||||||
| 	github.com/containerd/btrfs v1.0.0 | 	github.com/containerd/btrfs v1.0.0 | ||||||
| 	github.com/containerd/cgroups v1.0.2 | 	github.com/containerd/cgroups v1.0.2 | ||||||
| 	github.com/containerd/console v1.0.3 | 	github.com/containerd/console v1.0.3 | ||||||
| 	github.com/containerd/containerd/api v1.6.0-beta.3 | 	github.com/containerd/containerd/api v1.6.0-beta.3 | ||||||
| 	github.com/containerd/continuity v0.2.0 | 	github.com/containerd/continuity v0.2.2-0.20211201162329-8e53e7cac79d | ||||||
| 	github.com/containerd/fifo v1.0.0 | 	github.com/containerd/fifo v1.0.0 | ||||||
| 	github.com/containerd/go-cni v1.1.1-0.20211026134925-aa8bf14323a5 | 	github.com/containerd/go-cni v1.1.1-0.20211026134925-aa8bf14323a5 | ||||||
| 	github.com/containerd/go-runc v1.0.0 | 	github.com/containerd/go-runc v1.0.0 | ||||||
|   | |||||||
							
								
								
									
										8
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								go.sum
									
									
									
									
									
								
							| @@ -44,8 +44,8 @@ github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jB | |||||||
| github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | ||||||
| github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | ||||||
| github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | ||||||
| github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU= | github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= | ||||||
| github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | ||||||
| github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= | github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= | ||||||
| github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= | github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= | ||||||
| github.com/Microsoft/hcsshim v0.9.1 h1:VfDCj+QnY19ktX5TsH22JHcjaZ05RWQiwDbOyEg5ziM= | github.com/Microsoft/hcsshim v0.9.1 h1:VfDCj+QnY19ktX5TsH22JHcjaZ05RWQiwDbOyEg5ziM= | ||||||
| @@ -119,8 +119,8 @@ github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8a | |||||||
| github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= | github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= | ||||||
| github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= | github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= | ||||||
| github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= | github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= | ||||||
| github.com/containerd/continuity v0.2.0 h1:j/9Wnn+hrEWjLvHuIxUU1YI5JjEjVlT2AA68cse9rwY= | github.com/containerd/continuity v0.2.2-0.20211201162329-8e53e7cac79d h1:X5aD4AgIfNi00260miYN8nCzxPQCusmnNapaphze0FM= | ||||||
| github.com/containerd/continuity v0.2.0/go.mod h1:wCYX+dRqZdImhGucXOqTQn05AhX6EUDaGEMUzTFFpLg= | github.com/containerd/continuity v0.2.2-0.20211201162329-8e53e7cac79d/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= | ||||||
| github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU= | github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU= | ||||||
| github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= | github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= | ||||||
| github.com/containerd/go-cni v1.1.1-0.20211026134925-aa8bf14323a5 h1:khacN1kfW+7jnuj5rWytfCORVL1RmeDpD7Y1fdM4G1c= | github.com/containerd/go-cni v1.1.1-0.20211026134925-aa8bf14323a5 h1:khacN1kfW+7jnuj5rWytfCORVL1RmeDpD7Y1fdM4G1c= | ||||||
|   | |||||||
| @@ -43,8 +43,8 @@ github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jB | |||||||
| github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | ||||||
| github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | ||||||
| github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | ||||||
| github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU= | github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= | ||||||
| github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | ||||||
| github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= | github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= | ||||||
| github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= | github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= | ||||||
| github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= | github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= | ||||||
| @@ -117,8 +117,8 @@ github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8a | |||||||
| github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= | github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= | ||||||
| github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= | github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= | ||||||
| github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= | github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= | ||||||
| github.com/containerd/continuity v0.2.0 h1:j/9Wnn+hrEWjLvHuIxUU1YI5JjEjVlT2AA68cse9rwY= | github.com/containerd/continuity v0.2.2-0.20211201162329-8e53e7cac79d h1:X5aD4AgIfNi00260miYN8nCzxPQCusmnNapaphze0FM= | ||||||
| github.com/containerd/continuity v0.2.0/go.mod h1:wCYX+dRqZdImhGucXOqTQn05AhX6EUDaGEMUzTFFpLg= | github.com/containerd/continuity v0.2.2-0.20211201162329-8e53e7cac79d/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= | ||||||
| github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU= | github.com/containerd/fifo v1.0.0 h1:6PirWBr9/L7GDamKr+XM0IeUFXu5mf3M/BPpH9gaLBU= | ||||||
| github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= | github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= | ||||||
| github.com/containerd/go-cni v1.1.1-0.20211026134925-aa8bf14323a5/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= | github.com/containerd/go-cni v1.1.1-0.20211026134925-aa8bf14323a5/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= | ||||||
|   | |||||||
							
								
								
									
										27
									
								
								vendor/github.com/Microsoft/go-winio/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										27
									
								
								vendor/github.com/Microsoft/go-winio/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -11,12 +11,27 @@ package. | |||||||
|  |  | ||||||
| Please see the LICENSE file for licensing information. | Please see the LICENSE file for licensing information. | ||||||
|  |  | ||||||
| This project has adopted the [Microsoft Open Source Code of | ## Contributing | ||||||
| Conduct](https://opensource.microsoft.com/codeofconduct/). For more information |  | ||||||
| see the [Code of Conduct |  | ||||||
| FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact |  | ||||||
| [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional |  | ||||||
| questions or comments. |  | ||||||
|  |  | ||||||
|  | This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) | ||||||
|  | declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. | ||||||
|  |  | ||||||
|  | When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR | ||||||
|  | appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. | ||||||
|  |  | ||||||
|  | We also require that contributors sign their commits using git commit -s or git commit --signoff to certify they either authored the work themselves | ||||||
|  | or otherwise have permission to use it in this project. Please see https://developercertificate.org/ for more info, as well as to make sure that you can | ||||||
|  | attest to the rules listed. Our CI uses the DCO Github app to ensure that all commits in a given PR are signed-off. | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ## Code of Conduct | ||||||
|  |  | ||||||
|  | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||||||
|  | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or | ||||||
|  | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | ## Special Thanks | ||||||
| Thanks to natefinch for the inspiration for this library. See https://github.com/natefinch/npipe | Thanks to natefinch for the inspiration for this library. See https://github.com/natefinch/npipe | ||||||
| for another named pipe implementation. | for another named pipe implementation. | ||||||
|   | |||||||
							
								
								
									
										74
									
								
								vendor/github.com/Microsoft/go-winio/backuptar/tar.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										74
									
								
								vendor/github.com/Microsoft/go-winio/backuptar/tar.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -5,7 +5,6 @@ package backuptar | |||||||
| import ( | import ( | ||||||
| 	"archive/tar" | 	"archive/tar" | ||||||
| 	"encoding/base64" | 	"encoding/base64" | ||||||
| 	"errors" |  | ||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"io" | 	"io" | ||||||
| 	"io/ioutil" | 	"io/ioutil" | ||||||
| @@ -42,19 +41,14 @@ const ( | |||||||
| 	hdrCreationTime = "LIBARCHIVE.creationtime" | 	hdrCreationTime = "LIBARCHIVE.creationtime" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| func writeZeroes(w io.Writer, count int64) error { | // zeroReader is an io.Reader that always returns 0s. | ||||||
| 	buf := make([]byte, 8192) | type zeroReader struct{} | ||||||
| 	c := len(buf) |  | ||||||
| 	for i := int64(0); i < count; i += int64(c) { | func (zr zeroReader) Read(b []byte) (int, error) { | ||||||
| 		if int64(c) > count-i { | 	for i := range b { | ||||||
| 			c = int(count - i) | 		b[i] = 0 | ||||||
| 		} |  | ||||||
| 		_, err := w.Write(buf[:c]) |  | ||||||
| 		if err != nil { |  | ||||||
| 			return err |  | ||||||
| 		} |  | ||||||
| 	} | 	} | ||||||
| 	return nil | 	return len(b), nil | ||||||
| } | } | ||||||
|  |  | ||||||
| func copySparse(t *tar.Writer, br *winio.BackupStreamReader) error { | func copySparse(t *tar.Writer, br *winio.BackupStreamReader) error { | ||||||
| @@ -71,16 +65,26 @@ func copySparse(t *tar.Writer, br *winio.BackupStreamReader) error { | |||||||
| 			return fmt.Errorf("unexpected stream %d", bhdr.Id) | 			return fmt.Errorf("unexpected stream %d", bhdr.Id) | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | 		// We can't seek backwards, since we have already written that data to the tar.Writer. | ||||||
|  | 		if bhdr.Offset < curOffset { | ||||||
|  | 			return fmt.Errorf("cannot seek back from %d to %d", curOffset, bhdr.Offset) | ||||||
|  | 		} | ||||||
| 		// archive/tar does not support writing sparse files | 		// archive/tar does not support writing sparse files | ||||||
| 		// so just write zeroes to catch up to the current offset. | 		// so just write zeroes to catch up to the current offset. | ||||||
| 		err = writeZeroes(t, bhdr.Offset-curOffset) | 		if _, err := io.CopyN(t, zeroReader{}, bhdr.Offset-curOffset); err != nil { | ||||||
|  | 			return fmt.Errorf("seek to offset %d: %s", bhdr.Offset, err) | ||||||
|  | 		} | ||||||
| 		if bhdr.Size == 0 { | 		if bhdr.Size == 0 { | ||||||
|  | 			// A sparse block with size = 0 is used to mark the end of the sparse blocks. | ||||||
| 			break | 			break | ||||||
| 		} | 		} | ||||||
| 		n, err := io.Copy(t, br) | 		n, err := io.Copy(t, br) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			return err | 			return err | ||||||
| 		} | 		} | ||||||
|  | 		if n != bhdr.Size { | ||||||
|  | 			return fmt.Errorf("copied %d bytes instead of %d at offset %d", n, bhdr.Size, bhdr.Offset) | ||||||
|  | 		} | ||||||
| 		curOffset = bhdr.Offset + n | 		curOffset = bhdr.Offset + n | ||||||
| 	} | 	} | ||||||
| 	return nil | 	return nil | ||||||
| @@ -221,20 +225,44 @@ func WriteTarFileFromBackupStream(t *tar.Writer, r io.Reader, name string, size | |||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	// The logic for copying file contents is fairly complicated due to the need for handling sparse files, | ||||||
|  | 	// and the weird ways they are represented by BackupRead. A normal file will always either have a data stream | ||||||
|  | 	// with size and content, or no data stream at all (if empty). However, for a sparse file, the content can also | ||||||
|  | 	// be represented using a series of sparse block streams following the data stream. Additionally, the way sparse | ||||||
|  | 	// files are handled by BackupRead has changed in the OS recently. The specifics of the representation are described | ||||||
|  | 	// in the list at the bottom of this block comment. | ||||||
|  | 	// | ||||||
|  | 	// Sparse files can be represented in four different ways, based on the specifics of the file. | ||||||
|  | 	// - Size = 0: | ||||||
|  | 	//     Previously: BackupRead yields no data stream and no sparse block streams. | ||||||
|  | 	//     Recently: BackupRead yields a data stream with size = 0. There are no following sparse block streams. | ||||||
|  | 	// - Size > 0, no allocated ranges: | ||||||
|  | 	//     BackupRead yields a data stream with size = 0. Following is a single sparse block stream with | ||||||
|  | 	//     size = 0 and offset = <file size>. | ||||||
|  | 	// - Size > 0, one allocated range: | ||||||
|  | 	//     BackupRead yields a data stream with size = <file size> containing the file contents. There are no | ||||||
|  | 	//     sparse block streams. This is the case if you take a normal file with contents and simply set the | ||||||
|  | 	//     sparse flag on it. | ||||||
|  | 	// - Size > 0, multiple allocated ranges: | ||||||
|  | 	//     BackupRead yields a data stream with size = 0. Following are sparse block streams for each allocated | ||||||
|  | 	//     range of the file containing the range contents. Finally there is a sparse block stream with | ||||||
|  | 	//     size = 0 and offset = <file size>. | ||||||
|  |  | ||||||
| 	if dataHdr != nil { | 	if dataHdr != nil { | ||||||
| 		// A data stream was found. Copy the data. | 		// A data stream was found. Copy the data. | ||||||
| 		if (dataHdr.Attributes & winio.StreamSparseAttributes) == 0 { | 		// We assume that we will either have a data stream size > 0 XOR have sparse block streams. | ||||||
|  | 		if dataHdr.Size > 0 || (dataHdr.Attributes&winio.StreamSparseAttributes) == 0 { | ||||||
| 			if size != dataHdr.Size { | 			if size != dataHdr.Size { | ||||||
| 				return fmt.Errorf("%s: mismatch between file size %d and header size %d", name, size, dataHdr.Size) | 				return fmt.Errorf("%s: mismatch between file size %d and header size %d", name, size, dataHdr.Size) | ||||||
| 			} | 			} | ||||||
| 			_, err = io.Copy(t, br) | 			if _, err = io.Copy(t, br); err != nil { | ||||||
| 			if err != nil { | 				return fmt.Errorf("%s: copying contents from data stream: %s", name, err) | ||||||
| 				return err |  | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else if size > 0 { | ||||||
| 			err = copySparse(t, br) | 			// As of a recent OS change, BackupRead now returns a data stream for empty sparse files. | ||||||
| 			if err != nil { | 			// These files have no sparse block streams, so skip the copySparse call if file size = 0. | ||||||
| 				return err | 			if err = copySparse(t, br); err != nil { | ||||||
|  | 				return fmt.Errorf("%s: copying contents from sparse block stream: %s", name, err) | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| @@ -279,7 +307,7 @@ func WriteTarFileFromBackupStream(t *tar.Writer, r io.Reader, name string, size | |||||||
| 			} else { | 			} else { | ||||||
| 				// Unsupported for now, since the size of the alternate stream is not present | 				// Unsupported for now, since the size of the alternate stream is not present | ||||||
| 				// in the backup stream until after the data has been read. | 				// in the backup stream until after the data has been read. | ||||||
| 				return errors.New("tar of sparse alternate data streams is unsupported") | 				return fmt.Errorf("%s: tar of sparse alternate data streams is unsupported", name) | ||||||
| 			} | 			} | ||||||
| 		case winio.BackupEaData, winio.BackupLink, winio.BackupPropertyData, winio.BackupObjectId, winio.BackupTxfsData: | 		case winio.BackupEaData, winio.BackupLink, winio.BackupPropertyData, winio.BackupObjectId, winio.BackupTxfsData: | ||||||
| 			// ignore these streams | 			// ignore these streams | ||||||
|   | |||||||
							
								
								
									
										9
									
								
								vendor/github.com/Microsoft/go-winio/pkg/etw/provider.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								vendor/github.com/Microsoft/go-winio/pkg/etw/provider.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -83,15 +83,6 @@ func providerCallback(sourceID guid.GUID, state ProviderState, level Level, matc | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
| // providerCallbackAdapter acts as the first-level callback from the C/ETW side |  | ||||||
| // for provider notifications. Because Go has trouble with callback arguments of |  | ||||||
| // different size, it has only pointer-sized arguments, which are then cast to |  | ||||||
| // the appropriate types when calling providerCallback. |  | ||||||
| func providerCallbackAdapter(sourceID *guid.GUID, state uintptr, level uintptr, matchAnyKeyword uintptr, matchAllKeyword uintptr, filterData uintptr, i uintptr) uintptr { |  | ||||||
| 	providerCallback(*sourceID, ProviderState(state), Level(level), uint64(matchAnyKeyword), uint64(matchAllKeyword), filterData, i) |  | ||||||
| 	return 0 |  | ||||||
| } |  | ||||||
|  |  | ||||||
| // providerIDFromName generates a provider ID based on the provider name. It | // providerIDFromName generates a provider ID based on the provider name. It | ||||||
| // uses the same algorithm as used by .NET's EventSource class, which is based | // uses the same algorithm as used by .NET's EventSource class, which is based | ||||||
| // on RFC 4122. More information on the algorithm can be found here: | // on RFC 4122. More information on the algorithm can be found here: | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								vendor/github.com/Microsoft/go-winio/pkg/etw/wrapper_32.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								vendor/github.com/Microsoft/go-winio/pkg/etw/wrapper_32.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -4,6 +4,7 @@ | |||||||
| package etw | package etw | ||||||
|  |  | ||||||
| import ( | import ( | ||||||
|  | 	"github.com/Microsoft/go-winio/pkg/guid" | ||||||
| 	"golang.org/x/sys/windows" | 	"golang.org/x/sys/windows" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| @@ -50,3 +51,17 @@ func eventSetInformation( | |||||||
| 		information, | 		information, | ||||||
| 		length) | 		length) | ||||||
| } | } | ||||||
|  |  | ||||||
|  | // providerCallbackAdapter acts as the first-level callback from the C/ETW side | ||||||
|  | // for provider notifications. Because Go has trouble with callback arguments of | ||||||
|  | // different size, it has only pointer-sized arguments, which are then cast to | ||||||
|  | // the appropriate types when calling providerCallback. | ||||||
|  | // For x86, the matchAny and matchAll keywords need to be assembled from two | ||||||
|  | // 32-bit integers, because the max size of an argument is uintptr, but those | ||||||
|  | // two arguments are actually 64-bit integers. | ||||||
|  | func providerCallbackAdapter(sourceID *guid.GUID, state uint32, level uint32, matchAnyKeyword_low uint32, matchAnyKeyword_high uint32, matchAllKeyword_low uint32, matchAllKeyword_high uint32, filterData uintptr, i uintptr) uintptr { | ||||||
|  | 	matchAnyKeyword := uint64(matchAnyKeyword_high)<<32 | uint64(matchAnyKeyword_low) | ||||||
|  | 	matchAllKeyword := uint64(matchAllKeyword_high)<<32 | uint64(matchAllKeyword_low) | ||||||
|  | 	providerCallback(*sourceID, ProviderState(state), Level(level), uint64(matchAnyKeyword), uint64(matchAllKeyword), filterData, i) | ||||||
|  | 	return 0 | ||||||
|  | } | ||||||
|   | |||||||
							
								
								
									
										10
									
								
								vendor/github.com/Microsoft/go-winio/pkg/etw/wrapper_64.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								vendor/github.com/Microsoft/go-winio/pkg/etw/wrapper_64.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -4,6 +4,7 @@ | |||||||
| package etw | package etw | ||||||
|  |  | ||||||
| import ( | import ( | ||||||
|  | 	"github.com/Microsoft/go-winio/pkg/guid" | ||||||
| 	"golang.org/x/sys/windows" | 	"golang.org/x/sys/windows" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| @@ -40,3 +41,12 @@ func eventSetInformation( | |||||||
| 		information, | 		information, | ||||||
| 		length) | 		length) | ||||||
| } | } | ||||||
|  |  | ||||||
|  | // providerCallbackAdapter acts as the first-level callback from the C/ETW side | ||||||
|  | // for provider notifications. Because Go has trouble with callback arguments of | ||||||
|  | // different size, it has only pointer-sized arguments, which are then cast to | ||||||
|  | // the appropriate types when calling providerCallback. | ||||||
|  | func providerCallbackAdapter(sourceID *guid.GUID, state uintptr, level uintptr, matchAnyKeyword uintptr, matchAllKeyword uintptr, filterData uintptr, i uintptr) uintptr { | ||||||
|  | 	providerCallback(*sourceID, ProviderState(state), Level(level), uint64(matchAnyKeyword), uint64(matchAllKeyword), filterData, i) | ||||||
|  | 	return 0 | ||||||
|  | } | ||||||
|   | |||||||
							
								
								
									
										6
									
								
								vendor/github.com/Microsoft/go-winio/pkg/security/syscall_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								vendor/github.com/Microsoft/go-winio/pkg/security/syscall_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -2,6 +2,6 @@ package security | |||||||
|  |  | ||||||
| //go:generate go run mksyscall_windows.go -output zsyscall_windows.go syscall_windows.go | //go:generate go run mksyscall_windows.go -output zsyscall_windows.go syscall_windows.go | ||||||
|  |  | ||||||
| //sys getSecurityInfo(handle syscall.Handle, objectType uint32, si uint32, ppsidOwner **uintptr, ppsidGroup **uintptr, ppDacl *uintptr, ppSacl *uintptr, ppSecurityDescriptor *uintptr) (err error) [failretval!=0] = advapi32.GetSecurityInfo | //sys getSecurityInfo(handle syscall.Handle, objectType uint32, si uint32, ppsidOwner **uintptr, ppsidGroup **uintptr, ppDacl *uintptr, ppSacl *uintptr, ppSecurityDescriptor *uintptr) (win32err error) = advapi32.GetSecurityInfo | ||||||
| //sys setSecurityInfo(handle syscall.Handle, objectType uint32, si uint32, psidOwner uintptr, psidGroup uintptr, pDacl uintptr, pSacl uintptr) (err error) [failretval!=0] = advapi32.SetSecurityInfo | //sys setSecurityInfo(handle syscall.Handle, objectType uint32, si uint32, psidOwner uintptr, psidGroup uintptr, pDacl uintptr, pSacl uintptr) (win32err error) = advapi32.SetSecurityInfo | ||||||
| //sys setEntriesInAcl(count uintptr, pListOfEEs uintptr, oldAcl uintptr, newAcl *uintptr) (err error) [failretval!=0] = advapi32.SetEntriesInAclW | //sys setEntriesInAcl(count uintptr, pListOfEEs uintptr, oldAcl uintptr, newAcl *uintptr) (win32err error) = advapi32.SetEntriesInAclW | ||||||
|   | |||||||
							
								
								
									
										24
									
								
								vendor/github.com/Microsoft/go-winio/pkg/security/zsyscall_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								vendor/github.com/Microsoft/go-winio/pkg/security/zsyscall_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -45,26 +45,26 @@ var ( | |||||||
| 	procSetSecurityInfo  = modadvapi32.NewProc("SetSecurityInfo") | 	procSetSecurityInfo  = modadvapi32.NewProc("SetSecurityInfo") | ||||||
| ) | ) | ||||||
|  |  | ||||||
| func getSecurityInfo(handle syscall.Handle, objectType uint32, si uint32, ppsidOwner **uintptr, ppsidGroup **uintptr, ppDacl *uintptr, ppSacl *uintptr, ppSecurityDescriptor *uintptr) (err error) { | func getSecurityInfo(handle syscall.Handle, objectType uint32, si uint32, ppsidOwner **uintptr, ppsidGroup **uintptr, ppDacl *uintptr, ppSacl *uintptr, ppSecurityDescriptor *uintptr) (win32err error) { | ||||||
| 	r1, _, e1 := syscall.Syscall9(procGetSecurityInfo.Addr(), 8, uintptr(handle), uintptr(objectType), uintptr(si), uintptr(unsafe.Pointer(ppsidOwner)), uintptr(unsafe.Pointer(ppsidGroup)), uintptr(unsafe.Pointer(ppDacl)), uintptr(unsafe.Pointer(ppSacl)), uintptr(unsafe.Pointer(ppSecurityDescriptor)), 0) | 	r0, _, _ := syscall.Syscall9(procGetSecurityInfo.Addr(), 8, uintptr(handle), uintptr(objectType), uintptr(si), uintptr(unsafe.Pointer(ppsidOwner)), uintptr(unsafe.Pointer(ppsidGroup)), uintptr(unsafe.Pointer(ppDacl)), uintptr(unsafe.Pointer(ppSacl)), uintptr(unsafe.Pointer(ppSecurityDescriptor)), 0) | ||||||
| 	if r1 != 0 { | 	if r0 != 0 { | ||||||
| 		err = errnoErr(e1) | 		win32err = syscall.Errno(r0) | ||||||
| 	} | 	} | ||||||
| 	return | 	return | ||||||
| } | } | ||||||
|  |  | ||||||
| func setEntriesInAcl(count uintptr, pListOfEEs uintptr, oldAcl uintptr, newAcl *uintptr) (err error) { | func setEntriesInAcl(count uintptr, pListOfEEs uintptr, oldAcl uintptr, newAcl *uintptr) (win32err error) { | ||||||
| 	r1, _, e1 := syscall.Syscall6(procSetEntriesInAclW.Addr(), 4, uintptr(count), uintptr(pListOfEEs), uintptr(oldAcl), uintptr(unsafe.Pointer(newAcl)), 0, 0) | 	r0, _, _ := syscall.Syscall6(procSetEntriesInAclW.Addr(), 4, uintptr(count), uintptr(pListOfEEs), uintptr(oldAcl), uintptr(unsafe.Pointer(newAcl)), 0, 0) | ||||||
| 	if r1 != 0 { | 	if r0 != 0 { | ||||||
| 		err = errnoErr(e1) | 		win32err = syscall.Errno(r0) | ||||||
| 	} | 	} | ||||||
| 	return | 	return | ||||||
| } | } | ||||||
|  |  | ||||||
| func setSecurityInfo(handle syscall.Handle, objectType uint32, si uint32, psidOwner uintptr, psidGroup uintptr, pDacl uintptr, pSacl uintptr) (err error) { | func setSecurityInfo(handle syscall.Handle, objectType uint32, si uint32, psidOwner uintptr, psidGroup uintptr, pDacl uintptr, pSacl uintptr) (win32err error) { | ||||||
| 	r1, _, e1 := syscall.Syscall9(procSetSecurityInfo.Addr(), 7, uintptr(handle), uintptr(objectType), uintptr(si), uintptr(psidOwner), uintptr(psidGroup), uintptr(pDacl), uintptr(pSacl), 0, 0) | 	r0, _, _ := syscall.Syscall9(procSetSecurityInfo.Addr(), 7, uintptr(handle), uintptr(objectType), uintptr(si), uintptr(psidOwner), uintptr(psidGroup), uintptr(pDacl), uintptr(pSacl), 0, 0) | ||||||
| 	if r1 != 0 { | 	if r0 != 0 { | ||||||
| 		err = errnoErr(e1) | 		win32err = syscall.Errno(r0) | ||||||
| 	} | 	} | ||||||
| 	return | 	return | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										10
									
								
								vendor/github.com/Microsoft/go-winio/vhd/vhd.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								vendor/github.com/Microsoft/go-winio/vhd/vhd.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -13,11 +13,11 @@ import ( | |||||||
|  |  | ||||||
| //go:generate go run mksyscall_windows.go -output zvhd_windows.go vhd.go | //go:generate go run mksyscall_windows.go -output zvhd_windows.go vhd.go | ||||||
|  |  | ||||||
| //sys createVirtualDisk(virtualStorageType *VirtualStorageType, path string, virtualDiskAccessMask uint32, securityDescriptor *uintptr, createVirtualDiskFlags uint32, providerSpecificFlags uint32, parameters *CreateVirtualDiskParameters, overlapped *syscall.Overlapped, handle *syscall.Handle) (err error) [failretval != 0] = virtdisk.CreateVirtualDisk | //sys createVirtualDisk(virtualStorageType *VirtualStorageType, path string, virtualDiskAccessMask uint32, securityDescriptor *uintptr, createVirtualDiskFlags uint32, providerSpecificFlags uint32, parameters *CreateVirtualDiskParameters, overlapped *syscall.Overlapped, handle *syscall.Handle) (win32err error) = virtdisk.CreateVirtualDisk | ||||||
| //sys openVirtualDisk(virtualStorageType *VirtualStorageType, path string, virtualDiskAccessMask uint32, openVirtualDiskFlags uint32, parameters *OpenVirtualDiskParameters, handle *syscall.Handle) (err error) [failretval != 0] = virtdisk.OpenVirtualDisk | //sys openVirtualDisk(virtualStorageType *VirtualStorageType, path string, virtualDiskAccessMask uint32, openVirtualDiskFlags uint32, parameters *OpenVirtualDiskParameters, handle *syscall.Handle) (win32err error) = virtdisk.OpenVirtualDisk | ||||||
| //sys attachVirtualDisk(handle syscall.Handle, securityDescriptor *uintptr, attachVirtualDiskFlag uint32, providerSpecificFlags uint32, parameters *AttachVirtualDiskParameters, overlapped *syscall.Overlapped) (err error) [failretval != 0] = virtdisk.AttachVirtualDisk | //sys attachVirtualDisk(handle syscall.Handle, securityDescriptor *uintptr, attachVirtualDiskFlag uint32, providerSpecificFlags uint32, parameters *AttachVirtualDiskParameters, overlapped *syscall.Overlapped) (win32err error) = virtdisk.AttachVirtualDisk | ||||||
| //sys detachVirtualDisk(handle syscall.Handle, detachVirtualDiskFlags uint32, providerSpecificFlags uint32) (err error) [failretval != 0] = virtdisk.DetachVirtualDisk | //sys detachVirtualDisk(handle syscall.Handle, detachVirtualDiskFlags uint32, providerSpecificFlags uint32) (win32err error) = virtdisk.DetachVirtualDisk | ||||||
| //sys getVirtualDiskPhysicalPath(handle syscall.Handle, diskPathSizeInBytes *uint32, buffer *uint16) (err error) [failretval != 0] = virtdisk.GetVirtualDiskPhysicalPath | //sys getVirtualDiskPhysicalPath(handle syscall.Handle, diskPathSizeInBytes *uint32, buffer *uint16) (win32err error) = virtdisk.GetVirtualDiskPhysicalPath | ||||||
|  |  | ||||||
| type ( | type ( | ||||||
| 	CreateVirtualDiskFlag uint32 | 	CreateVirtualDiskFlag uint32 | ||||||
|   | |||||||
							
								
								
									
										52
									
								
								vendor/github.com/Microsoft/go-winio/vhd/zvhd_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										52
									
								
								vendor/github.com/Microsoft/go-winio/vhd/zvhd_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -47,60 +47,60 @@ var ( | |||||||
| 	procOpenVirtualDisk            = modvirtdisk.NewProc("OpenVirtualDisk") | 	procOpenVirtualDisk            = modvirtdisk.NewProc("OpenVirtualDisk") | ||||||
| ) | ) | ||||||
|  |  | ||||||
| func attachVirtualDisk(handle syscall.Handle, securityDescriptor *uintptr, attachVirtualDiskFlag uint32, providerSpecificFlags uint32, parameters *AttachVirtualDiskParameters, overlapped *syscall.Overlapped) (err error) { | func attachVirtualDisk(handle syscall.Handle, securityDescriptor *uintptr, attachVirtualDiskFlag uint32, providerSpecificFlags uint32, parameters *AttachVirtualDiskParameters, overlapped *syscall.Overlapped) (win32err error) { | ||||||
| 	r1, _, e1 := syscall.Syscall6(procAttachVirtualDisk.Addr(), 6, uintptr(handle), uintptr(unsafe.Pointer(securityDescriptor)), uintptr(attachVirtualDiskFlag), uintptr(providerSpecificFlags), uintptr(unsafe.Pointer(parameters)), uintptr(unsafe.Pointer(overlapped))) | 	r0, _, _ := syscall.Syscall6(procAttachVirtualDisk.Addr(), 6, uintptr(handle), uintptr(unsafe.Pointer(securityDescriptor)), uintptr(attachVirtualDiskFlag), uintptr(providerSpecificFlags), uintptr(unsafe.Pointer(parameters)), uintptr(unsafe.Pointer(overlapped))) | ||||||
| 	if r1 != 0 { | 	if r0 != 0 { | ||||||
| 		err = errnoErr(e1) | 		win32err = syscall.Errno(r0) | ||||||
| 	} | 	} | ||||||
| 	return | 	return | ||||||
| } | } | ||||||
|  |  | ||||||
| func createVirtualDisk(virtualStorageType *VirtualStorageType, path string, virtualDiskAccessMask uint32, securityDescriptor *uintptr, createVirtualDiskFlags uint32, providerSpecificFlags uint32, parameters *CreateVirtualDiskParameters, overlapped *syscall.Overlapped, handle *syscall.Handle) (err error) { | func createVirtualDisk(virtualStorageType *VirtualStorageType, path string, virtualDiskAccessMask uint32, securityDescriptor *uintptr, createVirtualDiskFlags uint32, providerSpecificFlags uint32, parameters *CreateVirtualDiskParameters, overlapped *syscall.Overlapped, handle *syscall.Handle) (win32err error) { | ||||||
| 	var _p0 *uint16 | 	var _p0 *uint16 | ||||||
| 	_p0, err = syscall.UTF16PtrFromString(path) | 	_p0, win32err = syscall.UTF16PtrFromString(path) | ||||||
| 	if err != nil { | 	if win32err != nil { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| 	return _createVirtualDisk(virtualStorageType, _p0, virtualDiskAccessMask, securityDescriptor, createVirtualDiskFlags, providerSpecificFlags, parameters, overlapped, handle) | 	return _createVirtualDisk(virtualStorageType, _p0, virtualDiskAccessMask, securityDescriptor, createVirtualDiskFlags, providerSpecificFlags, parameters, overlapped, handle) | ||||||
| } | } | ||||||
|  |  | ||||||
| func _createVirtualDisk(virtualStorageType *VirtualStorageType, path *uint16, virtualDiskAccessMask uint32, securityDescriptor *uintptr, createVirtualDiskFlags uint32, providerSpecificFlags uint32, parameters *CreateVirtualDiskParameters, overlapped *syscall.Overlapped, handle *syscall.Handle) (err error) { | func _createVirtualDisk(virtualStorageType *VirtualStorageType, path *uint16, virtualDiskAccessMask uint32, securityDescriptor *uintptr, createVirtualDiskFlags uint32, providerSpecificFlags uint32, parameters *CreateVirtualDiskParameters, overlapped *syscall.Overlapped, handle *syscall.Handle) (win32err error) { | ||||||
| 	r1, _, e1 := syscall.Syscall9(procCreateVirtualDisk.Addr(), 9, uintptr(unsafe.Pointer(virtualStorageType)), uintptr(unsafe.Pointer(path)), uintptr(virtualDiskAccessMask), uintptr(unsafe.Pointer(securityDescriptor)), uintptr(createVirtualDiskFlags), uintptr(providerSpecificFlags), uintptr(unsafe.Pointer(parameters)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(handle))) | 	r0, _, _ := syscall.Syscall9(procCreateVirtualDisk.Addr(), 9, uintptr(unsafe.Pointer(virtualStorageType)), uintptr(unsafe.Pointer(path)), uintptr(virtualDiskAccessMask), uintptr(unsafe.Pointer(securityDescriptor)), uintptr(createVirtualDiskFlags), uintptr(providerSpecificFlags), uintptr(unsafe.Pointer(parameters)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(handle))) | ||||||
| 	if r1 != 0 { | 	if r0 != 0 { | ||||||
| 		err = errnoErr(e1) | 		win32err = syscall.Errno(r0) | ||||||
| 	} | 	} | ||||||
| 	return | 	return | ||||||
| } | } | ||||||
|  |  | ||||||
| func detachVirtualDisk(handle syscall.Handle, detachVirtualDiskFlags uint32, providerSpecificFlags uint32) (err error) { | func detachVirtualDisk(handle syscall.Handle, detachVirtualDiskFlags uint32, providerSpecificFlags uint32) (win32err error) { | ||||||
| 	r1, _, e1 := syscall.Syscall(procDetachVirtualDisk.Addr(), 3, uintptr(handle), uintptr(detachVirtualDiskFlags), uintptr(providerSpecificFlags)) | 	r0, _, _ := syscall.Syscall(procDetachVirtualDisk.Addr(), 3, uintptr(handle), uintptr(detachVirtualDiskFlags), uintptr(providerSpecificFlags)) | ||||||
| 	if r1 != 0 { | 	if r0 != 0 { | ||||||
| 		err = errnoErr(e1) | 		win32err = syscall.Errno(r0) | ||||||
| 	} | 	} | ||||||
| 	return | 	return | ||||||
| } | } | ||||||
|  |  | ||||||
| func getVirtualDiskPhysicalPath(handle syscall.Handle, diskPathSizeInBytes *uint32, buffer *uint16) (err error) { | func getVirtualDiskPhysicalPath(handle syscall.Handle, diskPathSizeInBytes *uint32, buffer *uint16) (win32err error) { | ||||||
| 	r1, _, e1 := syscall.Syscall(procGetVirtualDiskPhysicalPath.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(diskPathSizeInBytes)), uintptr(unsafe.Pointer(buffer))) | 	r0, _, _ := syscall.Syscall(procGetVirtualDiskPhysicalPath.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(diskPathSizeInBytes)), uintptr(unsafe.Pointer(buffer))) | ||||||
| 	if r1 != 0 { | 	if r0 != 0 { | ||||||
| 		err = errnoErr(e1) | 		win32err = syscall.Errno(r0) | ||||||
| 	} | 	} | ||||||
| 	return | 	return | ||||||
| } | } | ||||||
|  |  | ||||||
| func openVirtualDisk(virtualStorageType *VirtualStorageType, path string, virtualDiskAccessMask uint32, openVirtualDiskFlags uint32, parameters *OpenVirtualDiskParameters, handle *syscall.Handle) (err error) { | func openVirtualDisk(virtualStorageType *VirtualStorageType, path string, virtualDiskAccessMask uint32, openVirtualDiskFlags uint32, parameters *OpenVirtualDiskParameters, handle *syscall.Handle) (win32err error) { | ||||||
| 	var _p0 *uint16 | 	var _p0 *uint16 | ||||||
| 	_p0, err = syscall.UTF16PtrFromString(path) | 	_p0, win32err = syscall.UTF16PtrFromString(path) | ||||||
| 	if err != nil { | 	if win32err != nil { | ||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| 	return _openVirtualDisk(virtualStorageType, _p0, virtualDiskAccessMask, openVirtualDiskFlags, parameters, handle) | 	return _openVirtualDisk(virtualStorageType, _p0, virtualDiskAccessMask, openVirtualDiskFlags, parameters, handle) | ||||||
| } | } | ||||||
|  |  | ||||||
| func _openVirtualDisk(virtualStorageType *VirtualStorageType, path *uint16, virtualDiskAccessMask uint32, openVirtualDiskFlags uint32, parameters *OpenVirtualDiskParameters, handle *syscall.Handle) (err error) { | func _openVirtualDisk(virtualStorageType *VirtualStorageType, path *uint16, virtualDiskAccessMask uint32, openVirtualDiskFlags uint32, parameters *OpenVirtualDiskParameters, handle *syscall.Handle) (win32err error) { | ||||||
| 	r1, _, e1 := syscall.Syscall6(procOpenVirtualDisk.Addr(), 6, uintptr(unsafe.Pointer(virtualStorageType)), uintptr(unsafe.Pointer(path)), uintptr(virtualDiskAccessMask), uintptr(openVirtualDiskFlags), uintptr(unsafe.Pointer(parameters)), uintptr(unsafe.Pointer(handle))) | 	r0, _, _ := syscall.Syscall6(procOpenVirtualDisk.Addr(), 6, uintptr(unsafe.Pointer(virtualStorageType)), uintptr(unsafe.Pointer(path)), uintptr(virtualDiskAccessMask), uintptr(openVirtualDiskFlags), uintptr(unsafe.Pointer(parameters)), uintptr(unsafe.Pointer(handle))) | ||||||
| 	if r1 != 0 { | 	if r0 != 0 { | ||||||
| 		err = errnoErr(e1) | 		win32err = syscall.Errno(r0) | ||||||
| 	} | 	} | ||||||
| 	return | 	return | ||||||
| } | } | ||||||
|   | |||||||
							
								
								
									
										5
									
								
								vendor/github.com/containerd/continuity/fs/copy.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								vendor/github.com/containerd/continuity/fs/copy.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -114,7 +114,7 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er | |||||||
| 		return fmt.Errorf("failed to read %s: %w", src, err) | 		return fmt.Errorf("failed to read %s: %w", src, err) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if err := copyFileInfo(stat, dst); err != nil { | 	if err := copyFileInfo(stat, src, dst); err != nil { | ||||||
| 		return fmt.Errorf("failed to copy file info for %s: %w", dst, err) | 		return fmt.Errorf("failed to copy file info for %s: %w", dst, err) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| @@ -160,7 +160,8 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er | |||||||
| 			// TODO: Support pipes and sockets | 			// TODO: Support pipes and sockets | ||||||
| 			return fmt.Errorf("unsupported mode %s: %w", fi.Mode(), err) | 			return fmt.Errorf("unsupported mode %s: %w", fi.Mode(), err) | ||||||
| 		} | 		} | ||||||
| 		if err := copyFileInfo(fi, target); err != nil { |  | ||||||
|  | 		if err := copyFileInfo(fi, source, target); err != nil { | ||||||
| 			return fmt.Errorf("failed to copy file info: %w", err) | 			return fmt.Errorf("failed to copy file info: %w", err) | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										7
									
								
								vendor/github.com/containerd/continuity/fs/copy_linux.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								vendor/github.com/containerd/continuity/fs/copy_linux.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -27,7 +27,7 @@ import ( | |||||||
| 	"golang.org/x/sys/unix" | 	"golang.org/x/sys/unix" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| func copyFileInfo(fi os.FileInfo, name string) error { | func copyFileInfo(fi os.FileInfo, src, name string) error { | ||||||
| 	st := fi.Sys().(*syscall.Stat_t) | 	st := fi.Sys().(*syscall.Stat_t) | ||||||
| 	if err := os.Lchown(name, int(st.Uid), int(st.Gid)); err != nil { | 	if err := os.Lchown(name, int(st.Uid), int(st.Gid)); err != nil { | ||||||
| 		if os.IsPermission(err) { | 		if os.IsPermission(err) { | ||||||
| @@ -95,7 +95,10 @@ func copyFileContent(dst, src *os.File) error { | |||||||
| 			buf := bufferPool.Get().(*[]byte) | 			buf := bufferPool.Get().(*[]byte) | ||||||
| 			_, err = io.CopyBuffer(dst, src, *buf) | 			_, err = io.CopyBuffer(dst, src, *buf) | ||||||
| 			bufferPool.Put(buf) | 			bufferPool.Put(buf) | ||||||
| 			return fmt.Errorf("userspace copy failed: %w", err) | 			if err != nil { | ||||||
|  | 				return fmt.Errorf("userspace copy failed: %w", err) | ||||||
|  | 			} | ||||||
|  | 			return nil | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		first = false | 		first = false | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								vendor/github.com/containerd/continuity/fs/copy_unix.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/containerd/continuity/fs/copy_unix.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -28,7 +28,7 @@ import ( | |||||||
| 	"github.com/containerd/continuity/sysx" | 	"github.com/containerd/continuity/sysx" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| func copyFileInfo(fi os.FileInfo, name string) error { | func copyFileInfo(fi os.FileInfo, src, name string) error { | ||||||
| 	st := fi.Sys().(*syscall.Stat_t) | 	st := fi.Sys().(*syscall.Stat_t) | ||||||
| 	if err := os.Lchown(name, int(st.Uid), int(st.Gid)); err != nil { | 	if err := os.Lchown(name, int(st.Uid), int(st.Gid)); err != nil { | ||||||
| 		if os.IsPermission(err) { | 		if os.IsPermission(err) { | ||||||
|   | |||||||
							
								
								
									
										45
									
								
								vendor/github.com/containerd/continuity/fs/copy_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										45
									
								
								vendor/github.com/containerd/continuity/fs/copy_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -21,15 +21,56 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"io" | 	"io" | ||||||
| 	"os" | 	"os" | ||||||
|  |  | ||||||
|  | 	winio "github.com/Microsoft/go-winio" | ||||||
|  | 	"golang.org/x/sys/windows" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| func copyFileInfo(fi os.FileInfo, name string) error { | const ( | ||||||
|  | 	seTakeOwnershipPrivilege = "SeTakeOwnershipPrivilege" | ||||||
|  | ) | ||||||
|  |  | ||||||
|  | func copyFileInfo(fi os.FileInfo, src, name string) error { | ||||||
| 	if err := os.Chmod(name, fi.Mode()); err != nil { | 	if err := os.Chmod(name, fi.Mode()); err != nil { | ||||||
| 		return fmt.Errorf("failed to chmod %s: %w", name, err) | 		return fmt.Errorf("failed to chmod %s: %w", name, err) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	// TODO: copy windows specific metadata | 	// Copy file ownership and ACL | ||||||
|  | 	// We need SeRestorePrivilege and SeTakeOwnershipPrivilege in order | ||||||
|  | 	// to restore security info on a file, especially if we're trying to | ||||||
|  | 	// apply security info which includes SIDs not necessarily present on | ||||||
|  | 	// the host. | ||||||
|  | 	privileges := []string{winio.SeRestorePrivilege, seTakeOwnershipPrivilege} | ||||||
|  | 	if err := winio.EnableProcessPrivileges(privileges); err != nil { | ||||||
|  | 		return err | ||||||
|  | 	} | ||||||
|  | 	defer winio.DisableProcessPrivileges(privileges) | ||||||
|  |  | ||||||
|  | 	secInfo, err := windows.GetNamedSecurityInfo( | ||||||
|  | 		src, windows.SE_FILE_OBJECT, | ||||||
|  | 		windows.OWNER_SECURITY_INFORMATION|windows.DACL_SECURITY_INFORMATION) | ||||||
|  |  | ||||||
|  | 	if err != nil { | ||||||
|  | 		return err | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	dacl, _, err := secInfo.DACL() | ||||||
|  | 	if err != nil { | ||||||
|  | 		return err | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	sid, _, err := secInfo.Owner() | ||||||
|  | 	if err != nil { | ||||||
|  | 		return err | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	if err := windows.SetNamedSecurityInfo( | ||||||
|  | 		name, windows.SE_FILE_OBJECT, | ||||||
|  | 		windows.OWNER_SECURITY_INFORMATION|windows.DACL_SECURITY_INFORMATION, | ||||||
|  | 		sid, nil, dacl, nil); err != nil { | ||||||
|  |  | ||||||
|  | 		return err | ||||||
|  | 	} | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								vendor/github.com/containerd/continuity/go.mod
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								vendor/github.com/containerd/continuity/go.mod
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -6,6 +6,7 @@ require ( | |||||||
| 	// 5883e5a4b512fe2e32f915b1c66a1ddfef81cb3f is the last version to support macOS | 	// 5883e5a4b512fe2e32f915b1c66a1ddfef81cb3f is the last version to support macOS | ||||||
| 	// see https://github.com/bazil/fuse/commit/60eaf8f021ce00e5c52529cdcba1067e13c1c2c2 | 	// see https://github.com/bazil/fuse/commit/60eaf8f021ce00e5c52529cdcba1067e13c1c2c2 | ||||||
| 	bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512 | 	bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512 | ||||||
|  | 	github.com/Microsoft/go-winio v0.5.1 | ||||||
| 	github.com/dustin/go-humanize v1.0.0 | 	github.com/dustin/go-humanize v1.0.0 | ||||||
| 	github.com/golang/protobuf v1.3.5 | 	github.com/golang/protobuf v1.3.5 | ||||||
| 	github.com/opencontainers/go-digest v1.0.0 | 	github.com/opencontainers/go-digest v1.0.0 | ||||||
|   | |||||||
							
								
								
									
										3
									
								
								vendor/github.com/containerd/continuity/go.sum
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								vendor/github.com/containerd/continuity/go.sum
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -2,6 +2,8 @@ bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512 h1:SRsZGA7aFnCZETmov57jwPrWuTm | |||||||
| bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM= | bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM= | ||||||
| cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= | ||||||
| github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= | ||||||
|  | github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY= | ||||||
|  | github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= | ||||||
| github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= | github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= | ||||||
| github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= | ||||||
| github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= | ||||||
| @@ -65,6 +67,7 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 | |||||||
| github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= | github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= | ||||||
| github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= | github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= | ||||||
| github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= | ||||||
|  | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= | ||||||
| github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||||||
| github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||||||
| github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= | github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							| @@ -1,7 +1,7 @@ | |||||||
| # github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8 | # github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8 | ||||||
| ## explicit | ## explicit | ||||||
| github.com/AdaLogics/go-fuzz-headers | github.com/AdaLogics/go-fuzz-headers | ||||||
| # github.com/Microsoft/go-winio v0.5.0 | # github.com/Microsoft/go-winio v0.5.1 | ||||||
| ## explicit | ## explicit | ||||||
| github.com/Microsoft/go-winio | github.com/Microsoft/go-winio | ||||||
| github.com/Microsoft/go-winio/backuptar | github.com/Microsoft/go-winio/backuptar | ||||||
| @@ -95,7 +95,7 @@ github.com/containerd/containerd/api/services/ttrpc/events/v1 | |||||||
| github.com/containerd/containerd/api/services/version/v1 | github.com/containerd/containerd/api/services/version/v1 | ||||||
| github.com/containerd/containerd/api/types | github.com/containerd/containerd/api/types | ||||||
| github.com/containerd/containerd/api/types/task | github.com/containerd/containerd/api/types/task | ||||||
| # github.com/containerd/continuity v0.2.0 | # github.com/containerd/continuity v0.2.2-0.20211201162329-8e53e7cac79d | ||||||
| ## explicit | ## explicit | ||||||
| github.com/containerd/continuity | github.com/containerd/continuity | ||||||
| github.com/containerd/continuity/devices | github.com/containerd/continuity/devices | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Gabriel Adrian Samfira
					Gabriel Adrian Samfira