Run As Root

A java library to run pieces of code as root.

Лицензия

Лицензия

Группа

Группа

com.github.dyorgio.runtime
Идентификатор

Идентификатор

run-as-root
Последняя версия

Последняя версия

1.2.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

Run As Root
A java library to run pieces of code as root.
Ссылка на сайт

Ссылка на сайт

https://github.com/dyorgio/run-as-root
Система контроля версий

Система контроля версий

https://github.com/dyorgio/run-as-root.git

Скачать run-as-root

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.dyorgio.runtime/run-as-root/ -->
<dependency>
    <groupId>com.github.dyorgio.runtime</groupId>
    <artifactId>run-as-root</artifactId>
    <version>1.2.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.dyorgio.runtime/run-as-root/
implementation 'com.github.dyorgio.runtime:run-as-root:1.2.3'
// https://jarcasting.com/artifacts/com.github.dyorgio.runtime/run-as-root/
implementation ("com.github.dyorgio.runtime:run-as-root:1.2.3")
'com.github.dyorgio.runtime:run-as-root:jar:1.2.3'
<dependency org="com.github.dyorgio.runtime" name="run-as-root" rev="1.2.3">
  <artifact name="run-as-root" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.dyorgio.runtime', module='run-as-root', version='1.2.3')
)
libraryDependencies += "com.github.dyorgio.runtime" % "run-as-root" % "1.2.3"
[com.github.dyorgio.runtime/run-as-root "1.2.3"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
com.github.dyorgio.runtime : out-process jar 1.2.7

Модули Проекта

Данный проект не имеет модулей.

Run As Root

Build Status Maven Central

A java library to run pieces of code as root using native root password input dialog.

A new JVM is created in every execution and destroyed after completion.

This library uses Out Process to create new JVMs.

Why use it?

  • Ask user for credentials in Windows, Linux and macOS.
  • Do privileged actions.
  • Limit scope of root code execution.
  • Upgrade permissions during runtime temporarily.

Usage

// Specify JVM options (optional)
RootExecutor rootExecutor = new RootExecutor("-Xmx64m");

// Execute privileged action without return
rootExecutor.run(() -> {
    // Call your admin code here.
}));

// Execute privileged action with return
Object value = rootExecutor.call(() -> {
    // Call your admin code with return here.
    return null;
}));
System.out.println(value);

Tips

  • Init simple, after include this lib in your project just try to write a file in a protected folder to validate if it is working.
  • Avoid big classpaths, it can be a problem in Windows. #8

Maven

<dependency>
    <groupId>com.github.dyorgio.runtime</groupId>
    <artifactId>run-as-root</artifactId>
    <version>1.2.3</version>
</dependency>

Версии библиотеки

Версия
1.2.3
1.2.2
1.2.1
1.2.0
1.1.0
1.0.1
1.0.0