Skip to content

Commit

Permalink
Better naming for functions
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Barve <ambarve@microsoft.com>
  • Loading branch information
ambarve committed Nov 16, 2021
1 parent 381a482 commit 7e9b083
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions backuptar/tar.go
Expand Up @@ -109,9 +109,9 @@ func BasicInfoHeader(name string, size int64, fileInfo *winio.FileBasicInfo) *ta
return hdr
}

// EncodeSDDLFromTarHeader reads the SDDL associated with the header of the current file
// from the tar header and encodes it into a byte slice.
func EncodeSDDLFromTarHeader(hdr *tar.Header) ([]byte, error) {
// SecurityDescriptorFromTarHeader reads the SDDL associated with the header of the current file
// from the tar header and returns the security descriptor into a byte slice.
func SecurityDescriptorFromTarHeader(hdr *tar.Header) ([]byte, error) {
// Maintaining old SDDL-based behavior for backward
// compatibility. All new tar headers written by this library
// will have raw binary for the security descriptor.
Expand All @@ -132,9 +132,9 @@ func EncodeSDDLFromTarHeader(hdr *tar.Header) ([]byte, error) {
return sd, nil
}

// EncodeExtendedAttributesFromTarHeader reads the EAs associated with the header of the
// current file from the tar header and encodes it into a byte slice.
func EncodeExtendedAttributesFromTarHeader(hdr *tar.Header) ([]byte, error) {
// ExtendedAttributesFromTarHeader reads the EAs associated with the header of the
// current file from the tar header and returns it as a byte slice.
func ExtendedAttributesFromTarHeader(hdr *tar.Header) ([]byte, error) {
var eas []winio.ExtendedAttribute
var eadata []byte
var err error
Expand Down Expand Up @@ -394,7 +394,7 @@ func FileInfoFromHeader(hdr *tar.Header) (name string, size int64, fileInfo *win
func WriteBackupStreamFromTarFile(w io.Writer, t *tar.Reader, hdr *tar.Header) (*tar.Header, error) {
bw := winio.NewBackupStreamWriter(w)

sd, err := EncodeSDDLFromTarHeader(hdr)
sd, err := SecurityDescriptorFromTarHeader(hdr)
if err != nil {
return nil, err
}
Expand All @@ -413,7 +413,7 @@ func WriteBackupStreamFromTarFile(w io.Writer, t *tar.Reader, hdr *tar.Header) (
}
}

eadata, err := EncodeExtendedAttributesFromTarHeader(hdr)
eadata, err := ExtendedAttributesFromTarHeader(hdr)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 7e9b083

Please sign in to comment.