Skip to content

b3yc0d3/exas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

exas

exas is a minimalist alternative for sudo(8)1 and doas(1)2 that allows the execution of commands as another user.

The configuration is done before compiling, following the principles of suckless.org software, through a header file.

Warning

This software is unfinished. Keep your expectations low. Help to improve exas by contributing.

Getting Started

In this section we will guide you trough the easy process of building exas from source, 'cuase there aren't any package versions of it.

Prerequisites

The things you need before installing the software.

  • GNU Make Utility
  • Clang (can be changed in the config.mk)

Configuration

As mentioned in the intro text, exas if configured through a specific header file that is called config.h (which is a copy of config.def.h).

By default the config.h looks like the following sniped. It allows all users that are in the group of wheel to execute any command as root.

static const Rule rules[] = {
    /* permit   user    group      target user   command     arguments */
    { true,     NULL,   "wheel",   "root",       NULL,       NULL},
};

Lets explain what which "parameter" does and what value it takes.

permit : Whether the rule allows or denys the execution of a match.
Takes a bool value of true or false.

user : Name of user that should be matched by the rule.
Takes an char *. If set to NULL, no user name matching will be done.

group : Name of group that should be matched by the rule.
Takes an char *. If set to NULL, no group name matching will be done.

target user : Name of user to execute as.
Takes an char *. If set to NULL, the rule will allow any target user.

command : Command that should be matched by the rule.
Takes an char *. If set to NULL, the rule will not check for a command.

arguments : Arguments for command.
Takes an array of char **. If set to NULL, the rule will not check for any arguments.

Build Process

  1. Clone exas repository

    git clone https://github.com/b3yc0d3/exas.git
    cd exas
  2. Initial exas build using gmake

    gmake
  3. Edit the configuration in config.h
    The default configuration allows all members of the wheels group to execute any command as root.
    See Configuration section

  4. Build exas using gmake

    gmake

Installation

Installation requires the steps from Build Process.

You most likely need to run the following command(s) with root privileges

In order to install exas globally on your system, as any other software, simple run the following command

gmake clean install

Optionally DESTDIR can be set.

gmake DESTDIR=/your/installation/path clean install

Usage

Usage: exas [-u user] -- command [args ...]

Options:
   -u user    specify user to execute as

Parameters
   command    command that should be executed
   args       zero or more arguments for ``command``

A few examples of how to use exas.

exas -- pacman -Syu

For more information, read the manual page of exas

man exas

License

This project is licensed under the ISC-License. See LICENSE file for more informations.

Footnotes

  1. Linux Manual Page - Source - Project Site

  2. OpenBSD Manual Page - Source