]> ruderich.org/simon Gitweb - safcm/safcm.git/blobdiff - cmd/safcm-remote/sync/commands.go
sync: add SAFCM_HELPER environment variable to commands
[safcm/safcm.git] / cmd / safcm-remote / sync / commands.go
index abc23bcc42a8af74264df5a8e095416a1433791f..e3c48dd10e4df6d78ff0242439b462d16364ba14 100644 (file)
@@ -79,10 +79,15 @@ func (s *Sync) syncCommand(command string, trigger string) error {
 }
 
 func safcmEnviroment(groups []string) []string {
+       exe, err := os.Executable()
+       if err != nil {
+               panic(err) // should not happen on supported systems
+       }
+
        env := os.Environ()
-       // Provide additional environment variables so commands can check
-       // group membership
+       // Provide additional environment variables
        env = append(env,
+               fmt.Sprintf("SAFCM_HELPER=%s", exe),
                fmt.Sprintf("SAFCM_GROUPS=%s", strings.Join(groups, " ")))
        for _, x := range groups {
                env = append(env, fmt.Sprintf("SAFCM_GROUP_%s=%s", x, x))