Git Product home page Git Product logo

userchown's Introduction

General User Chown & Copy

A program that allows the a specified user to copy files as any other user belonging to a specified group to a specific set of directories.

Design

A setuid binary is required, so we may as well write in C as it isn't that large a program. Will be packaged as an RPM and installed on PHENIX nodes.

Reads a configuration file to determine the allowed user, target-user's group, and target locations.

Limitations

The program will become the target user to copy files, so the inputs must be readable by that user (likely world-readable). The target directories must be enumerated in the config file and must be underneath this. They also cannot contain any back-references "../" or symbolic links that point outside of this target directory.

Exit Codes

The following possible error codes provided by the program all have special meanings documented below:

Error Code--Meaning

    1. NO_ERROR Everything was successful
    1. USAGE_ERROR Commandline-usage error
    1. CONFIG_ERROR Error reading or parsing config file, or missing config section
    1. USERPERM_ERROR User is not authorized in config, target user is in the incorrect group, or the user does not have permission to suid to the target.
    1. USERABSENT_ERROR Target user or the target required-group does not exist
    1. PATHPERM_ERROR Destination target is not in the list of allowed destination directories
    1. FILEPERM_ERROR Error opening input to read or creating output file
    1. PATHRESOLV_ERROR Error fully resolving the output path or any of the configured allowed-paths
    1. IO_ERROR An error occured reading/writing the output file other than disk-quota
    1. QUOTA_ERROR A user's quota was reached while writing output file
    1. NO_ACTION_ERROR Multiple input files were selected and none were valid

Abnormal Errors -- will have bit 5 set

    1. MEMORY_ERROR A memory allocation failed somewhere
    1. LDAP_ERROR A lookup of user or group info failed (library call fail)
    1. INTERNAL_ERROR Something strange that should not happen did

userchown's People

Watchers

 avatar  avatar

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.