elevate

package module
v0.0.0-...-479ab99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2022 License: Apache-2.0 Imports: 1 Imported by: 4

README

Godoc

elevate currently only works for OS X and Windows. The Windows support currently uses a Visual Basic script that ends up displaying a confusing prompt and is generally hoaky - it will be replaced by a C++ program that does the same thing but with a better prompt.

On OS X, it uses cocoasudo from here - https://github.com/getlantern/cocoasudo, forked from https://github.com/kalikaneko/cocoasudo to explicitly support OSX 10.6.

On Windows, it uses elevate from here - http://code.kliu.org/misc/elevate/. The source code lives in elevate-1.3.0/src and can be built from a Visual Studio command line by running nmake elevat.mak. The elevate makefile has been modified from the original to 1. build as a windows GUI app instead of a console app, 2. always build as 32 bit and 3. statically link the runtime. elevate.c was modified to include a WinMain function.

Documentation

Overview

package elevate provides support for executing commands with elevated privileges.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(name string, args ...string) *exec.Cmd

Command is like exec.Command, except that it runs the given command with elevated privileges.

Types

type CommandBuilder

type CommandBuilder struct {
	// contains filtered or unexported fields
}

func WithIcon

func WithIcon(icon string) *CommandBuilder

func WithPrompt

func WithPrompt(prompt string) *CommandBuilder

func (*CommandBuilder) Command

func (b *CommandBuilder) Command(name string, args ...string) *exec.Cmd

func (*CommandBuilder) WithIcon

func (b *CommandBuilder) WithIcon(icon string) *CommandBuilder

func (*CommandBuilder) WithPrompt

func (b *CommandBuilder) WithPrompt(prompt string) *CommandBuilder

Directories

Path Synopsis
this is a simple demo program that runs whatever command you give it with elevated privileges, like
this is a simple demo program that runs whatever command you give it with elevated privileges, like

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL