Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for tarinsecurepath (0.24 sec)

  1. doc/godebug.md

    controlled by the [`tarinsecurepath` setting](/pkg/archive/tar/#Reader.Next)
    and the [`zipinsecurepath` setting](/pkg/archive/zip/#NewReader).
    These default to `tarinsecurepath=1` and `zipinsecurepath=1`,
    preserving the behavior of earlier versions of Go.
    A future version of Go may change the defaults to
    `tarinsecurepath=0` and `zipinsecurepath=0`.
    
    Go 1.20 introduced automatic seeding of the
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Tue Apr 16 17:29:58 GMT 2024
    - 13.5K bytes
    - Viewed (0)
  2. src/archive/tar/reader.go

    	}
    	hdr, err := tr.next()
    	tr.err = err
    	if err == nil && !filepath.IsLocal(hdr.Name) {
    		if tarinsecurepath.Value() == "0" {
    			tarinsecurepath.IncNonDefault()
    			err = ErrInsecurePath
    		}
    	}
    	return hdr, err
    }
    
    func (tr *Reader) next() (*Header, error) {
    	var paxHdrs map[string]string
    	var gnuLongName, gnuLongLink string
    
    	// Externally, Next iterates through the tar archive as if it is a series of
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Mar 08 01:59:14 GMT 2024
    - 26.8K bytes
    - Viewed (0)
  3. src/archive/tar/reader_test.go

    }
    
    func TestDisableInsecurePathCheck(t *testing.T) {
    	t.Setenv("GODEBUG", "tarinsecurepath=1")
    	var buf bytes.Buffer
    	tw := NewWriter(&buf)
    	const name = "/foo"
    	tw.WriteHeader(&Header{
    		Name: name,
    	})
    	tw.Close()
    	tr := NewReader(&buf)
    	h, err := tr.Next()
    	if err != nil {
    		t.Fatalf("tr.Next with tarinsecurepath=1: got err %v, want nil", err)
    	}
    	if h.Name != name {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Nov 21 21:14:38 GMT 2022
    - 47.1K bytes
    - Viewed (0)
  4. src/archive/tar/common.go

    // stored in Header will be the truncated version.
    
    var tarinsecurepath = godebug.New("tarinsecurepath")
    
    var (
    	ErrHeader          = errors.New("archive/tar: invalid tar header")
    	ErrWriteTooLong    = errors.New("archive/tar: write too long")
    	ErrFieldTooLong    = errors.New("archive/tar: header field too long")
    	ErrWriteAfterClose = errors.New("archive/tar: write after close")
    	ErrInsecurePath    = errors.New("archive/tar: insecure file path")
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Mar 15 16:01:50 GMT 2024
    - 24.7K bytes
    - Viewed (2)
  5. src/archive/zip/reader.go

    // and the GODEBUG environment variable contains `zipinsecurepath=0`,
    // OpenReader returns the reader with an ErrInsecurePath error.
    // A future version of Go may introduce this behavior by default.
    // Programs that want to accept non-local names can ignore
    // the ErrInsecurePath error and use the returned reader.
    func OpenReader(name string) (*ReadCloser, error) {
    	f, err := os.Open(name)
    	if err != nil {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Oct 13 18:36:46 GMT 2023
    - 27.7K bytes
    - Viewed (0)
  6. src/archive/zip/reader_test.go

    	if err != nil {
    		t.Fatalf("Unable to write out the bugos zip entry")
    	}
    	r, err := OpenReader(name)
    	if r != nil {
    		defer r.Close()
    	}
    
    	if err != ErrInsecurePath {
    		t.Fatalf("Error reading the archive, we expected ErrInsecurePath but got: %v", err)
    	}
    	_, err = r.Open("test.txt")
    	if err != nil {
    		t.Errorf("Error reading file: %v", err)
    	}
    	if len(r.File) != 1 {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Mar 27 18:23:49 GMT 2024
    - 55.3K bytes
    - Viewed (0)
  7. src/archive/tar/writer_test.go

    	}
    	if err := writer.Close(); err != nil {
    		t.Fatal(err)
    	}
    	// Test that we can get a long name back out of the archive.
    	reader := NewReader(&buf)
    	hdr, err = reader.Next()
    	if err != nil && err != ErrInsecurePath {
    		t.Fatal(err)
    	}
    	if hdr.Name != longName {
    		t.Fatal("Couldn't recover long name")
    	}
    }
    
    func TestValidTypeflagWithPAXHeader(t *testing.T) {
    	var buffer bytes.Buffer
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Tue Feb 27 16:39:23 GMT 2024
    - 38.7K bytes
    - Viewed (0)
  8. api/go1.20.txt

    pkg archive/tar, var ErrInsecurePath error #55356
    pkg archive/zip, var ErrInsecurePath error #55356
    pkg bytes, func Clone([]uint8) []uint8 #45038
    pkg bytes, func CutPrefix([]uint8, []uint8) ([]uint8, bool) #42537
    pkg bytes, func CutSuffix([]uint8, []uint8) ([]uint8, bool) #42537
    pkg context, func Cause(Context) error #51365
    pkg context, func WithCancelCause(Context) (Context, CancelCauseFunc) #51365
    pkg context, type CancelCauseFunc func(error) #51365
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Feb 17 21:23:32 GMT 2023
    - 602.6K bytes
    - Viewed (0)
Back to top