more sanitize

This commit is contained in:
André Roth
2024-10-11 13:37:33 +02:00
parent 7742980426
commit cefc09a41b
5 changed files with 22 additions and 15 deletions
+5
View File
@@ -8,6 +8,7 @@ import (
"strings"
"github.com/aptly-dev/aptly/pgp"
"github.com/aptly-dev/aptly/utils"
"github.com/gin-gonic/gin"
)
@@ -23,6 +24,10 @@ func apiGPGAddKey(c *gin.Context) {
if c.Bind(&b) != nil {
return
}
b.Keyserver = utils.SanitizePath(b.Keyserver)
b.GpgKeyID = utils.SanitizePath(b.GpgKeyID)
b.GpgKeyArmor = utils.SanitizePath(b.GpgKeyArmor)
// b.Keyring can be an absolute path
var err error
args := []string{"--no-default-keyring", "--allow-non-selfsigned-uid"}