Escape unix socket group in unit tests (#1554)

In some cases unix groups could have whitespace and/or `\` in them.
One example is my workstation. It's a MacOS in an Active Directory
domain. So my user has group `LD\Domain Users`.
Running `make test` on `unstable` and `8.0` branches fails with:

I'm not sure if we need to fix this in 8.0. But it seems that it should
be fixed in unstable.

Signed-off-by: secwall <secwall@yandex-team.ru>
This commit is contained in:
secwall 2025-01-14 05:05:04 +01:00 committed by GitHub
parent d13aad45f4
commit fdc89c56b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -568,7 +568,8 @@ if {$::verbose} {
set tempFileId [open $tempFileName w]
set group [dict get [file attributes $tempFileName] -group]
if {$group != ""} {
start_server [list tags {"repl external:skip"} overrides [list unixsocketgroup $group unixsocketperm 744]] {
set escaped_group "\"[string map {"\\" "\\\\"} $group]\""
start_server [list tags {"repl external:skip"} overrides [list unixsocketgroup $escaped_group unixsocketperm 744]] {
test {test unixsocket options are set correctly} {
set socketpath [lindex [r config get unixsocket] 1]
set attributes [file attributes $socketpath]