Contains the absolute path to the remote helper binary. Will be useful
in the future when the remote helper gets additional subcommands.
}
func safcmEnviroment(groups []string) []string {
}
func safcmEnviroment(groups []string) []string {
+ exe, err := os.Executable()
+ if err != nil {
+ panic(err) // should not happen on supported systems
+ }
+
- // Provide additional environment variables so commands can check
- // group membership
+ // Provide additional environment variables
+ 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))
fmt.Sprintf("SAFCM_GROUPS=%s", strings.Join(groups, " ")))
for _, x := range groups {
env = append(env, fmt.Sprintf("SAFCM_GROUP_%s=%s", x, x))
)
func TestSyncCommands(t *testing.T) {
)
func TestSyncCommands(t *testing.T) {
+ exe, err := os.Executable()
+ if err != nil {
+ t.Fatal(err)
+ }
env := append(os.Environ(),
env := append(os.Environ(),
"SAFCM_GROUPS=all group1 group2 host.example.org",
"SAFCM_GROUP_all=all",
"SAFCM_GROUP_group1=group1",
"SAFCM_GROUPS=all group1 group2 host.example.org",
"SAFCM_GROUP_all=all",
"SAFCM_GROUP_group1=group1",