[erlang-questions] where is os:getuid() ?

Michael Santos michael.santos@REDACTED
Fri Nov 27 17:08:18 CET 2015


On Thu, Nov 26, 2015 at 09:20:43PM -0500, Mark Steele wrote:
> Happened across a post to the mailing list regarding getuid.
> 
> Just added it here:
> 
> https://github.com/marksteele/passwderl
> 
> Add it to your rebar config, and you're good to go.

A few comments:

* getuid(2), seteuid(2), etc take and return uid_t's and gid_t's. These
  are unsigned 32-bit integers on the platforms I checked, not signed
  values. In particular, passing a signed value into seteuid(2) may have
  unexpected results.

* the getpw* calls are blocking and may take some time to complete since
  names may be resolved against network services like NIS or LDAP.

* there are problems portably using setuid(2) and seteuid(2) that were
  documented in "Setuid Demystified":

  https://www.cs.berkeley.edu/~daw/papers/setuid-usenix02.pdf

  A more predictable interface is setresuid(2) which seems to be available
  on all Unixes except Solaris.

> Cheers,
> 
> 
> Mark Steele
> CISSP, GPEN, GCIA, CSM
> (647) 677-4064
> mark@REDACTED
> 
> LinkedIn: https://ca.linkedin.com/in/markrsteele
> Github: https://github.com/marksteele
> Personal: http://www.control-alt-del.org

> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list