Skip to content

Commit 303695b

Browse files
Merge branch 'jumplists' into automatic_jumplist
2 parents 31f641f + e0252e4 commit 303695b

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

x-pack/osquerybeat/ext/osquery-extension/pkg/jumplists/custom.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,28 @@ func ParseCustomJumplistFile(filePath string, userProfile *UserProfile, log *log
2727

2828
// Carve out the Lnk objects from the file
2929
lnks := carveLnkFiles(fileBytes, log)
30-
entries := make([]*JumplistEntry, 0, len(lnks))
31-
for _, lnk := range lnks {
32-
entries = append(entries, &JumplistEntry{Lnk: lnk})
33-
}
3430

3531
// If the jumplist file is empty, return an error jlecmd does this as well
3632
if len(lnks) == 0 {
3733
return nil, fmt.Errorf("custom jumplist file %s is empty", filePath)
3834
}
3935

4036
// Look up the application id and create the metadata
41-
jumpListMeta := &JumplistMeta{
37+
jumplistMeta := &JumplistMeta{
4238
UserProfile: userProfile,
4339
ApplicationId: GetAppIdFromFileName(filePath, log),
4440
JumplistType: JumplistTypeCustom,
4541
Path: filePath,
4642
}
4743

44+
entries := make([]*JumplistEntry, 0, len(lnks))
45+
for _, lnk := range lnks {
46+
entries = append(entries, &JumplistEntry{Lnk: lnk})
47+
}
48+
4849
// Combine the metadata and the entries into a Jumplist object
4950
customJumplist := &Jumplist{
50-
JumplistMeta: jumpListMeta,
51+
JumplistMeta: jumplistMeta,
5152
entries: entries,
5253
}
5354
return customJumplist, nil

x-pack/osquerybeat/ext/osquery-extension/pkg/jumplists/jumplists.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const (
2626
JumplistTypeAutomatic JumplistType = 2
2727
)
2828

29+
// JumplistMeta is the metadata for a jump list.
2930
// JumplistMeta is the metadata for a jump list.
3031
// It contains the application ID, jump list type, path to the jump list file,
3132
// and any jumplist type specific metadata. The embedded fields
@@ -85,6 +86,8 @@ func GetColumns() []table.ColumnDefinition {
8586
return columns
8687
}
8788

89+
// GetGenerateFunc returns a function that can be used to generate a table of JumplistRow objects.
90+
// It returns a function that can be used to generate a table of JumplistRow objects.
8891
// matchesFilters is a helper function that checks if a row matches the given filters.
8992
func matchesFilters(row JumplistRow, filters []filters.Filter) bool {
9093
for _, filter := range filters {

0 commit comments

Comments
 (0)