Coder Social home page Coder Social logo

gosetuidgid's Introduction

gosetuidgid

This is a simple tool that based on gosetuidgid, which supports setting uid(setuid), gid(setgid), and supplementary gid (i.e. sgid, setgroup)

This tool does not handle user to uid map, and you must specify uid/gid in number.

The first GID specified will be the new gid of process

$ gosetuidgid
Usage: ./gosetuidgid user-spec command [args]
   eg: ./gosetuidgid tianon bash
       ./gosetuidgid nobody:root bash -c 'whoami && id'
       ./gosetuidgid 1000:1 id

./gosetuidgid version: 1.1 (go1.3.1 on linux/amd64; gc)

Once the user/group is processed, we switch to that user, then we exec the specified process and gosetuidgid itself is no longer resident or involved in the process lifecycle at all. This avoids all the issues of signal passing and TTY, and punts them to the process invoking gosetuidgid and the process being invoked by gosetuidgid, where they belong.

Why

The main point here is to provide a better setuidgid implementation on Android.

  • The setuidgid in busybox cannot handle supplementary gid, but in Android various permission are actually expressed by supplementary groups, such as 3003(inet).
  • Unlike Linux, you don't various utils in android, so a static-compiled go setuidgid with such feature will be extremely useful.

gosetuidgid's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.