Fix check for administrator group on Synology devices.
The id command prints a newline character after printing the group ids. This needs to be removed before checking for the administrator group (101). This fixes #2610.
This commit is contained in:
@@ -193,7 +193,11 @@ namespace Duplicati.Server.WebServer
|
||||
var groups = GetEnvArg("SYNO_GROUP_IDS");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(groups))
|
||||
{
|
||||
groups = ShellExec("id", "-G '" + username.Trim().Replace("'", "\\'") + "'", exitcode: 0).Result ?? string.Empty;
|
||||
groups = groups.Replace(Environment.NewLine, String.Empty);
|
||||
}
|
||||
|
||||
if (!groups.Split(new char[] { ' ' }).Contains("101"))
|
||||
{
|
||||
response.Status = System.Net.HttpStatusCode.Forbidden;
|
||||
|
||||
Reference in New Issue
Block a user