I'm trying to write a patch that will do away with the need for users who
have AdminLevel=admin permissions to use sudo when running `srun
--uid=<id>`. I was able to make several changes to various RPC's that
started to get me somewhere, but got stuck in the libsrun/srun.c file.
Here, the _become_user() function calls setuid() in order to switch to the
uid being specified in --uid.

There are 2 problems I'm facing with this:

   1. Only root can call setuid(), so no user will be able to utilize srun
   --uid=<id> without sudo
   2. in the opt struct in srun.c, both opt.uid and opt.euid are set to the
   same uid, even when the original calling user is different than the one
   being passed in the --uid argument

Are these features desired/intentional? In the same scenario but using
sbatch instead, it works just fine without sudo. I'm not finding any code
that sbatch is calling that uses setuid(), so how is sbatch switching users
without this?

Thanks!

Mike

Reply via email to