func (decoderData *decoderData) addSymlink(header *tar.Header, parent *filesystem.DirectoryInode, name string) error { var newInode filesystem.SymlinkInode newInode.Uid = uint32(header.Uid) newInode.Gid = uint32(header.Gid) newInode.Symlink = header.Linkname decoderData.addEntry(parent, header.Name, name, &newInode) return nil }
func (fileSystem *FileSystem) getSymlinkInode(stat *syscall.Stat_t) ( *filesystem.SymlinkInode, bool) { inode := fileSystem.SymlinkInodeTable[stat.Ino] new := false if inode == nil { var _inode filesystem.SymlinkInode inode = &_inode _inode.Uid = stat.Uid _inode.Gid = stat.Gid fileSystem.SymlinkInodeTable[stat.Ino] = inode new = true } return inode, new }
func (decoderData *decoderData) addSymlink(header *tar.Header, parent *filesystem.Directory, name string) error { var newInode filesystem.SymlinkInode newInode.Uid = uint32(header.Uid) newInode.Gid = uint32(header.Gid) newInode.Symlink = header.Linkname decoderData.symlinkInodeTable[header.Name] = decoderData.nextInodeNumber decoderData.fileSystem.SymlinkInodeTable[decoderData.nextInodeNumber] = &newInode var newEntry filesystem.Symlink newEntry.Name = name newEntry.InodeNumber = decoderData.nextInodeNumber parent.SymlinkList = append(parent.SymlinkList, &newEntry) decoderData.nextInodeNumber++ return nil }
func makeSymlinkInode(stat *syscall.Stat_t) *filesystem.SymlinkInode { var inode filesystem.SymlinkInode inode.Uid = stat.Uid inode.Gid = stat.Gid return &inode }