GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - atom/fs-admin: Perform file system operations with admin privileges

This repository was archived by the owner on Dec 15, 2022. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

201 Commits
201 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docker
docker
 
 
script
script
 
 
src
src
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.node-version
.node-version
 
 
.npmignore
.npmignore
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
binding.gyp
binding.gyp
 
 
index.d.ts
index.d.ts
 
 
index.js
index.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

Atom and all repositories under Atom will be archived on December 15, 2022. Learn more in our official announcement

fs-admin

Build Status Build status

Perform file system operations with administrator privileges.

Installing

npm install fs-admin

Packaging (Linux only)

This library uses PolicyKit to escalate privileges when calling createWriteStream(path) on Linux. In particular, it will invoke pkexec dd of=path to stream the desired bytes into the specified location.

PolicyKit

Not all Linux distros may include PolicyKit as part of their standard installation. As such, it is recommended to make it an explicit dependency of your application package. The following is an example Debian control file that requires policykit-1 to be installed as part of my-application:

Package: my-application
Version: 1.0.0
Depends: policykit-1

Policies

When using this library as part of a Linux application, you may want to install a Policy as well. Although not mandatory, policy files allow customizing the behavior of pkexec by e.g., displaying a custom password prompt or retaining admin privileges for a short period of time:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
<policyconfig>
  <vendor>Your Application Name</vendor>
  <action id="my-application.pkexec.dd">
    <description gettext-domain="my-application">Admin privileges required</description>
    <message gettext-domain="my-application">Please enter your password to save this file</message>
    <annotate key="org.freedesktop.policykit.exec.path">/bin/dd</annotate>
    <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
    <defaults>
      <allow_any>auth_admin_keep</allow_any>
      <allow_inactive>auth_admin_keep</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
    </defaults>
  </action>
</policyconfig>

Policy files should be installed in /usr/share/polkit-1/actions as part of your application's installation script.

For more information, you can find a complete example of requiring PolicyKit and distributing policy files in the Atom repository.

About

Perform file system operations with admin privileges

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

27 stars

Watchers

0 watching

Forks

29 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.