forked from Plemya-x/ALR
wip
This commit is contained in:
@ -46,15 +46,15 @@ msgstr ""
|
||||
msgid "Nothing to build"
|
||||
msgstr ""
|
||||
|
||||
#: build.go:201
|
||||
#: build.go:218
|
||||
msgid "Error building package"
|
||||
msgstr ""
|
||||
|
||||
#: build.go:208
|
||||
#: build.go:225
|
||||
msgid "Error moving the package"
|
||||
msgstr ""
|
||||
|
||||
#: build.go:212
|
||||
#: build.go:229
|
||||
msgid "Done"
|
||||
msgstr ""
|
||||
|
||||
@ -154,31 +154,27 @@ msgstr ""
|
||||
msgid "Install a new package"
|
||||
msgstr ""
|
||||
|
||||
#: install.go:62
|
||||
#: install.go:56
|
||||
msgid "Command install expected at least 1 argument, got %d"
|
||||
msgstr ""
|
||||
|
||||
#: install.go:101
|
||||
#: install.go:118
|
||||
msgid "Error parsing os release"
|
||||
msgstr ""
|
||||
|
||||
#: install.go:146
|
||||
#: install.go:163
|
||||
msgid "Remove an installed package"
|
||||
msgstr ""
|
||||
|
||||
#: install.go:164 install.go:214
|
||||
msgid "Unable to detect a supported package manager on the system"
|
||||
msgstr ""
|
||||
|
||||
#: install.go:168
|
||||
#: install.go:182
|
||||
msgid "Error listing installed packages"
|
||||
msgstr ""
|
||||
|
||||
#: install.go:209
|
||||
#: install.go:223
|
||||
msgid "Command remove expected at least 1 argument, got %d"
|
||||
msgstr ""
|
||||
|
||||
#: install.go:222
|
||||
#: install.go:239
|
||||
msgid "Error removing packages"
|
||||
msgstr ""
|
||||
|
||||
@ -194,6 +190,10 @@ msgstr ""
|
||||
msgid "Error pulling repositories"
|
||||
msgstr ""
|
||||
|
||||
#: internal/cliutils/app_builder/builder.go:165
|
||||
msgid "Unable to detect a supported package manager on the system"
|
||||
msgstr ""
|
||||
|
||||
#: internal/cliutils/prompt.go:60
|
||||
msgid "Would you like to view the build script for %s"
|
||||
msgstr ""
|
||||
@ -311,15 +311,15 @@ msgstr ""
|
||||
msgid "ERROR"
|
||||
msgstr ""
|
||||
|
||||
#: internal/utils/cmd.go:83
|
||||
#: internal/utils/cmd.go:95
|
||||
msgid "Error dropping capabilities"
|
||||
msgstr ""
|
||||
|
||||
#: internal/utils/cmd.go:103
|
||||
#: internal/utils/cmd.go:123
|
||||
msgid "You need to be root to perform this action"
|
||||
msgstr ""
|
||||
|
||||
#: internal/utils/cmd.go:145
|
||||
#: internal/utils/cmd.go:165
|
||||
msgid "You need to be a %s member to perform this action"
|
||||
msgstr ""
|
||||
|
||||
@ -507,14 +507,14 @@ msgstr ""
|
||||
msgid "Error executing template"
|
||||
msgstr ""
|
||||
|
||||
#: upgrade.go:50
|
||||
#: upgrade.go:47
|
||||
msgid "Upgrade all installed packages"
|
||||
msgstr ""
|
||||
|
||||
#: upgrade.go:99 upgrade.go:116
|
||||
#: upgrade.go:109 upgrade.go:126
|
||||
msgid "Error checking for updates"
|
||||
msgstr ""
|
||||
|
||||
#: upgrade.go:119
|
||||
#: upgrade.go:129
|
||||
msgid "There is nothing to do."
|
||||
msgstr ""
|
||||
|
@ -54,15 +54,15 @@ msgstr "Пакет не найден"
|
||||
msgid "Nothing to build"
|
||||
msgstr "Исполнение build()"
|
||||
|
||||
#: build.go:201
|
||||
#: build.go:218
|
||||
msgid "Error building package"
|
||||
msgstr "Ошибка при сборке пакета"
|
||||
|
||||
#: build.go:208
|
||||
#: build.go:225
|
||||
msgid "Error moving the package"
|
||||
msgstr "Ошибка при перемещении пакета"
|
||||
|
||||
#: build.go:212
|
||||
#: build.go:229
|
||||
msgid "Done"
|
||||
msgstr "Сделано"
|
||||
|
||||
@ -167,31 +167,27 @@ msgstr "Ошибка кодирования переменных скрита"
|
||||
msgid "Install a new package"
|
||||
msgstr "Установить новый пакет"
|
||||
|
||||
#: install.go:62
|
||||
#: install.go:56
|
||||
msgid "Command install expected at least 1 argument, got %d"
|
||||
msgstr "Для команды install ожидался хотя бы 1 аргумент, получено %d"
|
||||
|
||||
#: install.go:101
|
||||
#: install.go:118
|
||||
msgid "Error parsing os release"
|
||||
msgstr "Ошибка при разборе файла выпуска операционной системы"
|
||||
|
||||
#: install.go:146
|
||||
#: install.go:163
|
||||
msgid "Remove an installed package"
|
||||
msgstr "Удалить установленный пакет"
|
||||
|
||||
#: install.go:164 install.go:214
|
||||
msgid "Unable to detect a supported package manager on the system"
|
||||
msgstr "Не удалось обнаружить поддерживаемый менеджер пакетов в системе"
|
||||
|
||||
#: install.go:168
|
||||
#: install.go:182
|
||||
msgid "Error listing installed packages"
|
||||
msgstr "Ошибка при составлении списка установленных пакетов"
|
||||
|
||||
#: install.go:209
|
||||
#: install.go:223
|
||||
msgid "Command remove expected at least 1 argument, got %d"
|
||||
msgstr "Для команды remove ожидался хотя бы 1 аргумент, получено %d"
|
||||
|
||||
#: install.go:222
|
||||
#: install.go:239
|
||||
msgid "Error removing packages"
|
||||
msgstr "Ошибка при удалении пакетов"
|
||||
|
||||
@ -208,6 +204,10 @@ msgstr "Ошибка инициализации базы данных"
|
||||
msgid "Error pulling repositories"
|
||||
msgstr "Ошибка при извлечении репозиториев"
|
||||
|
||||
#: internal/cliutils/app_builder/builder.go:165
|
||||
msgid "Unable to detect a supported package manager on the system"
|
||||
msgstr "Не удалось обнаружить поддерживаемый менеджер пакетов в системе"
|
||||
|
||||
#: internal/cliutils/prompt.go:60
|
||||
msgid "Would you like to view the build script for %s"
|
||||
msgstr "Показать скрипт для пакета %s"
|
||||
@ -326,16 +326,16 @@ msgstr "%s %s загружается — %s/с\n"
|
||||
msgid "ERROR"
|
||||
msgstr "ОШИБКА"
|
||||
|
||||
#: internal/utils/cmd.go:83
|
||||
#: internal/utils/cmd.go:95
|
||||
#, fuzzy
|
||||
msgid "Error dropping capabilities"
|
||||
msgstr "Ошибка при открытии базы данных"
|
||||
|
||||
#: internal/utils/cmd.go:103
|
||||
#: internal/utils/cmd.go:123
|
||||
msgid "You need to be root to perform this action"
|
||||
msgstr ""
|
||||
|
||||
#: internal/utils/cmd.go:145
|
||||
#: internal/utils/cmd.go:165
|
||||
msgid "You need to be a %s member to perform this action"
|
||||
msgstr ""
|
||||
|
||||
@ -533,15 +533,15 @@ msgstr "Ошибка при разборе шаблона"
|
||||
msgid "Error executing template"
|
||||
msgstr "Ошибка при выполнении шаблона"
|
||||
|
||||
#: upgrade.go:50
|
||||
#: upgrade.go:47
|
||||
msgid "Upgrade all installed packages"
|
||||
msgstr "Обновить все установленные пакеты"
|
||||
|
||||
#: upgrade.go:99 upgrade.go:116
|
||||
#: upgrade.go:109 upgrade.go:126
|
||||
msgid "Error checking for updates"
|
||||
msgstr "Ошибка при проверке обновлений"
|
||||
|
||||
#: upgrade.go:119
|
||||
#: upgrade.go:129
|
||||
msgid "There is nothing to do."
|
||||
msgstr "Здесь нечего делать."
|
||||
|
||||
|
@ -73,6 +73,18 @@ func DropCapsToAlrUser() error {
|
||||
return EnsureIsAlrUser()
|
||||
}
|
||||
|
||||
func ExitIfCantDropGidToAlr() cli.ExitCoder {
|
||||
_, gid, err := GetUidGidAlrUser()
|
||||
if err != nil {
|
||||
return cliutils.FormatCliExit("cannot get gid alr", err)
|
||||
}
|
||||
err = syscall.Setgid(gid)
|
||||
if err != nil {
|
||||
return cliutils.FormatCliExit("cannot get setgid alr", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ExitIfCantDropCapsToAlrUser attempts to drop capabilities to the already
|
||||
// running user. Returns a cli.ExitCoder with an error if the operation fails.
|
||||
// See also [ExitIfCantDropCapsToAlrUserNoPrivs] for a version that also applies
|
||||
@ -85,14 +97,22 @@ func ExitIfCantDropCapsToAlrUser() cli.ExitCoder {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ExitIfCantDropCapsToAlrUserNoPrivs combines [ExitIfCantDropCapsToAlrUser] with [NoNewPrivs]
|
||||
func ExitIfCantSetNoNewPrivs() cli.ExitCoder {
|
||||
if err := NoNewPrivs(); err != nil {
|
||||
return cliutils.FormatCliExit("error no new privs", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ExitIfCantDropCapsToAlrUserNoPrivs combines [ExitIfCantDropCapsToAlrUser] with [ExitIfCantSetNoNewPrivs]
|
||||
func ExitIfCantDropCapsToAlrUserNoPrivs() cli.ExitCoder {
|
||||
if err := ExitIfCantDropCapsToAlrUser(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := NoNewPrivs(); err != nil {
|
||||
return cliutils.FormatCliExit("error no new privs", err)
|
||||
if err := ExitIfCantSetNoNewPrivs(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user