diff --git a/profile/identifier_linux_test.go b/profile/identifier_linux_test.go index fef1157a..65c2c1e0 100644 --- a/profile/identifier_linux_test.go +++ b/profile/identifier_linux_test.go @@ -15,7 +15,6 @@ func TestGetPathIdentifier(t *testing.T) { testPathID(t, "/home/user/project/main", "project/main") testPathID(t, "/root/project/main", "project/main") testPathID(t, "/tmp/a/b/c/d/install.sh", "c/d/install.sh") - testPathID(t, "/sbin/init", "sbin/init") testPathID(t, "/lib/systemd/systemd-udevd", "lib/systemd/systemd-udevd") testPathID(t, "/bundle/ruby/2.4.0/bin/passenger", "bin/passenger") testPathID(t, "/usr/sbin/cron", "sbin/cron") diff --git a/profile/profile.go b/profile/profile.go index b38c3ed9..f1bda3c9 100644 --- a/profile/profile.go +++ b/profile/profile.go @@ -65,11 +65,7 @@ func MakeProfileKey(namespace, ID string) string { // Save saves the profile to the database func (profile *Profile) Save(namespace string) error { if profile.ID == "" { - u, err := uuid.NewV4() - if err != nil { - return err - } - profile.ID = u.String() + profile.ID = uuid.NewV4().String() } if !profile.KeyIsSet() { diff --git a/profile/set_test.go b/profile/set_test.go index 21bf3b2f..4b9cd8e9 100644 --- a/profile/set_test.go +++ b/profile/set_test.go @@ -1,6 +1,7 @@ package profile import ( + "context" "net" "testing" "time" @@ -140,7 +141,7 @@ func testEndpointIP(t *testing.T, set *Set, domain string, ip net.IP, protocol u func TestProfileSet(t *testing.T) { - set := NewSet("[pid]-/path/to/bin", testUserProfile, testStampProfile) + set := NewSet(context.Background(), "[pid]-/path/to/bin", testUserProfile, testStampProfile) set.Update(status.SecurityLevelDynamic) testFlag(t, set, Whitelist, false)