userv

Olly Betts

Disclaimer

I'm not an expert

Pronunciation

you-serve

 user-vee 

High-level Summary

a Unix system facility to allow one program to invoke another when only limited trust exists between them

History

Debian Popcon

Debian popcon installs:

PackageInstalls
userv25
survex37
XML::Filter::Sort44
sudo64,629

Total popcon reports: 90,141

Scenario #1

userv to the rescue!

Solution

~richard/.userv/rc:

if ( glob service swigsync
   & glob calling-user richard olly )
     reset
     suppress-args
     execute /home/richard/bin/swigsync.sh
fi

I run:

olly$ userv richard swigsync

Solution

~richard/.userv/rc:

if ( glob service swigsync
   & glob calling-user richard olly )
     reset
     suppress-args
     execute /home/richard/bin/swigsync.sh
fi

Non-approved user runs:

eve$ userv richard swigsync
uservd: request rejected
userv: uservd reports that service failed

Scenario #2

Public git mirror of Subversion

Update trigger

~olly/.procmailrc:

:0 hic
* ^List-Id:.*xapian-commits\.lists\.xapian\.org
| userv xapian-git git-svn-fetch

git-svn

~xapian-git/.userv/rc:

if ( glob service git-svn-fetch
   & glob calling-user olly james richard root
   )
        reset
        suppress-args
        execute bin/git-svn-fetch
        quit
fi

git-daemon

~xapian-anongit/.userv/rc:

if ( glob service init.d/git-daemon
   & glob calling-user olly james richard root
   )
        reset
        no-suppress-args
        execute bin/init.d-git-daemon
        quit
fi

Scenario #2 summary

Alternatives - server process

Run a server using a domain socket or TCP port.

Alternatives - setuid

Alternatives - group writable

Set permissions on a file or directory to give any user in a particular group write permission.

Examples: shared high scores, man page cache

Alternatives - sudo

xkcd

xkcd corrected

The End

 Questions welcome

 

Image credits: