/usr/share/doc/libghc-unix-compat-doc/html/System-PosixCompat-User.html is in libghc-unix-compat-doc 0.4.2.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>System.PosixCompat.User</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_System-PosixCompat-User.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/System-PosixCompat-User.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">unix-compat-0.4.2.0: Portable POSIX-compatibility layer.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>Safe</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">System.PosixCompat.User</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">User environment</a><ul><li><a href="#g:2">Querying the user environment</a><ul><li><a href="#g:3">The group database</a></li><li><a href="#g:4">The user database</a></li></ul></li><li><a href="#g:5">Modifying the user environment</a></li></ul></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This module makes the operations exported by <code>System.Posix.User</code>
available on all platforms. On POSIX systems it re-exports operations from
<code>System.Posix.User</code>. On other platforms it provides dummy implementations.</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:getRealUserID">getRealUserID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:UserID">UserID</a></li><li class="src short"><a href="#v:getRealGroupID">getRealGroupID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:GroupID">GroupID</a></li><li class="src short"><a href="#v:getEffectiveUserID">getEffectiveUserID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:UserID">UserID</a></li><li class="src short"><a href="#v:getEffectiveGroupID">getEffectiveGroupID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:GroupID">GroupID</a></li><li class="src short"><a href="#v:getGroups">getGroups</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:GroupID">GroupID</a>]</li><li class="src short"><a href="#v:getLoginName">getLoginName</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:getEffectiveUserName">getEffectiveUserName</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:GroupEntry">GroupEntry</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> = <a href="#v:GroupEntry">GroupEntry</a> {<ul class="subs"><li><a href="#v:groupName">groupName</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li><li><a href="#v:groupPassword">groupPassword</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li><li><a href="#v:groupID">groupID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:GroupID">GroupID</a></li><li><a href="#v:groupMembers">groupMembers</a> :: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>]</li></ul>}</li><li class="src short"><a href="#v:getGroupEntryForID">getGroupEntryForID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:GroupID">GroupID</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a></li><li class="src short"><a href="#v:getGroupEntryForName">getGroupEntryForName</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a></li><li class="src short"><a href="#v:getAllGroupEntries">getAllGroupEntries</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> [<a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a>]</li><li class="src short"><span class="keyword">data</span> <a href="#t:UserEntry">UserEntry</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> = <a href="#v:UserEntry">UserEntry</a> {<ul class="subs"><li><a href="#v:userName">userName</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li><li><a href="#v:userPassword">userPassword</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li><li><a href="#v:userID">userID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:UserID">UserID</a></li><li><a href="#v:userGroupID">userGroupID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:GroupID">GroupID</a></li><li><a href="#v:userGecos">userGecos</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li><li><a href="#v:homeDirectory">homeDirectory</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li><li><a href="#v:userShell">userShell</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></li></ul>}</li><li class="src short"><a href="#v:getUserEntryForID">getUserEntryForID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:UserID">UserID</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a></li><li class="src short"><a href="#v:getUserEntryForName">getUserEntryForName</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a></li><li class="src short"><a href="#v:getAllUserEntries">getAllUserEntries</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> [<a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a>]</li><li class="src short"><a href="#v:setUserID">setUserID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:UserID">UserID</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:setGroupID">setGroupID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:GroupID">GroupID</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> ()</li></ul></div><div id="interface"><h1 id="g:1">User environment</h1><h2 id="g:2">Querying the user environment</h2><div class="top"><p class="src"><a id="v:getRealUserID" class="def">getRealUserID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:UserID">UserID</a> <a href="#v:getRealUserID" class="selflink">#</a></p><div class="doc"><p><code>getRealUserID</code> calls <code>getuid</code> to obtain the real <code>UserID</code>
associated with the current process.</p></div></div><div class="top"><p class="src"><a id="v:getRealGroupID" class="def">getRealGroupID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:GroupID">GroupID</a> <a href="#v:getRealGroupID" class="selflink">#</a></p><div class="doc"><p><code>getRealGroupID</code> calls <code>getgid</code> to obtain the real <code>GroupID</code>
associated with the current process.</p></div></div><div class="top"><p class="src"><a id="v:getEffectiveUserID" class="def">getEffectiveUserID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:UserID">UserID</a> <a href="#v:getEffectiveUserID" class="selflink">#</a></p><div class="doc"><p><code>getEffectiveUserID</code> calls <code>geteuid</code> to obtain the effective
<code>UserID</code> associated with the current process.</p></div></div><div class="top"><p class="src"><a id="v:getEffectiveGroupID" class="def">getEffectiveGroupID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:GroupID">GroupID</a> <a href="#v:getEffectiveGroupID" class="selflink">#</a></p><div class="doc"><p><code>getEffectiveGroupID</code> calls <code>getegid</code> to obtain the effective
<code>GroupID</code> associated with the current process.</p></div></div><div class="top"><p class="src"><a id="v:getGroups" class="def">getGroups</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:GroupID">GroupID</a>] <a href="#v:getGroups" class="selflink">#</a></p><div class="doc"><p><code>getGroups</code> calls <code>getgroups</code> to obtain the list of
supplementary <code>GroupID</code>s associated with the current process.</p></div></div><div class="top"><p class="src"><a id="v:getLoginName" class="def">getLoginName</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:getLoginName" class="selflink">#</a></p><div class="doc"><p><code>getLoginName</code> calls <code>getlogin</code> to obtain the login name
associated with the current process.</p></div></div><div class="top"><p class="src"><a id="v:getEffectiveUserName" class="def">getEffectiveUserName</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:getEffectiveUserName" class="selflink">#</a></p><div class="doc"><p><code>getEffectiveUserName</code> gets the name
associated with the effective <code>UserID</code> of the process.</p></div></div><h3 id="g:3">The group database</h3><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:GroupEntry" class="def">GroupEntry</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> <a href="#t:GroupEntry" class="selflink">#</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:GroupEntry" class="def">GroupEntry</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:groupName" class="def">groupName</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></dfn><div class="doc"><p>The name of this group (gr_name)</p></div></li><li><dfn class="src"><a id="v:groupPassword" class="def">groupPassword</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></dfn><div class="doc"><p>The password for this group (gr_passwd)</p></div></li><li><dfn class="src"><a id="v:groupID" class="def">groupID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:GroupID">GroupID</a></dfn><div class="doc"><p>The unique numeric ID for this group (gr_gid)</p></div></li><li><dfn class="src"><a id="v:groupMembers" class="def">groupMembers</a> :: [<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a>]</dfn><div class="doc"><p>A list of zero or more usernames that are members (gr_mem)</p></div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:GroupEntry" class="caption collapser" onclick="toggleSection('i:GroupEntry')">Instances</p><div id="section.i:GroupEntry" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:GroupEntry:Eq:1" class="instance expander" onclick="toggleSection('i:id:GroupEntry:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> <a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:GroupEntry:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a> -> <a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a> -> <a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:GroupEntry:Read:2" class="instance expander" onclick="toggleSection('i:id:GroupEntry:Read:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Read.html#t:Read">Read</a> <a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:GroupEntry:Read:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:readsPrec">readsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> <a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a> <a href="#v:readsPrec" class="selflink">#</a></p><p class="src"><a href="#v:readList">readList</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> [<a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a>] <a href="#v:readList" class="selflink">#</a></p><p class="src"><a href="#v:readPrec">readPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> <a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a> <a href="#v:readPrec" class="selflink">#</a></p><p class="src"><a href="#v:readListPrec">readListPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> [<a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a>] <a href="#v:readListPrec" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:GroupEntry:Show:3" class="instance expander" onclick="toggleSection('i:id:GroupEntry:Show:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> <a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:GroupEntry:Show:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -> <a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:getGroupEntryForID" class="def">getGroupEntryForID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:GroupID">GroupID</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a> <a href="#v:getGroupEntryForID" class="selflink">#</a></p><div class="doc"><p><code>getGroupEntryForID gid</code> calls <code>getgrgid_r</code> to obtain
the <code>GroupEntry</code> information associated with <code>GroupID</code>
<code>gid</code>. This operation may fail with <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO-Error.html#v:isDoesNotExistError">isDoesNotExistError</a></code>
if no such group exists.</p></div></div><div class="top"><p class="src"><a id="v:getGroupEntryForName" class="def">getGroupEntryForName</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a> <a href="#v:getGroupEntryForName" class="selflink">#</a></p><div class="doc"><p><code>getGroupEntryForName name</code> calls <code>getgrnam_r</code> to obtain
the <code>GroupEntry</code> information associated with the group called
<code>name</code>. This operation may fail with <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO-Error.html#v:isDoesNotExistError">isDoesNotExistError</a></code>
if no such group exists.</p></div></div><div class="top"><p class="src"><a id="v:getAllGroupEntries" class="def">getAllGroupEntries</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> [<a href="System-PosixCompat-User.html#t:GroupEntry">GroupEntry</a>] <a href="#v:getAllGroupEntries" class="selflink">#</a></p><div class="doc"><p><code>getAllGroupEntries</code> returns all group entries on the system by
repeatedly calling <code>getgrent</code></p></div></div><h3 id="g:4">The user database</h3><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:UserEntry" class="def">UserEntry</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Kind.html#t:-42-">*</a> <a href="#t:UserEntry" class="selflink">#</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:UserEntry" class="def">UserEntry</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:userName" class="def">userName</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></dfn><div class="doc"><p>Textual name of this user (pw_name)</p></div></li><li><dfn class="src"><a id="v:userPassword" class="def">userPassword</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></dfn><div class="doc"><p>Password -- may be empty or fake if shadow is in use (pw_passwd)</p></div></li><li><dfn class="src"><a id="v:userID" class="def">userID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:UserID">UserID</a></dfn><div class="doc"><p>Numeric ID for this user (pw_uid)</p></div></li><li><dfn class="src"><a id="v:userGroupID" class="def">userGroupID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:GroupID">GroupID</a></dfn><div class="doc"><p>Primary group ID (pw_gid)</p></div></li><li><dfn class="src"><a id="v:userGecos" class="def">userGecos</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></dfn><div class="doc"><p>Usually the real name for the user (pw_gecos)</p></div></li><li><dfn class="src"><a id="v:homeDirectory" class="def">homeDirectory</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></dfn><div class="doc"><p>Home directory (pw_dir)</p></div></li><li><dfn class="src"><a id="v:userShell" class="def">userShell</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a></dfn><div class="doc"><p>Default shell (pw_shell)</p></div></li></ul></div></td></tr></table></div><div class="subs instances"><p id="control.i:UserEntry" class="caption collapser" onclick="toggleSection('i:UserEntry')">Instances</p><div id="section.i:UserEntry" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:UserEntry:Eq:1" class="instance expander" onclick="toggleSection('i:id:UserEntry:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> <a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:UserEntry:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a> -> <a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a> -> <a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:UserEntry:Read:2" class="instance expander" onclick="toggleSection('i:id:UserEntry:Read:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Read.html#t:Read">Read</a> <a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:UserEntry:Read:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:readsPrec">readsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> <a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a> <a href="#v:readsPrec" class="selflink">#</a></p><p class="src"><a href="#v:readList">readList</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> [<a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a>] <a href="#v:readList" class="selflink">#</a></p><p class="src"><a href="#v:readPrec">readPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> <a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a> <a href="#v:readPrec" class="selflink">#</a></p><p class="src"><a href="#v:readListPrec">readListPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> [<a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a>] <a href="#v:readListPrec" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:UserEntry:Show:3" class="instance expander" onclick="toggleSection('i:id:UserEntry:Show:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> <a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a></span></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:UserEntry:Show:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -> <a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:getUserEntryForID" class="def">getUserEntryForID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:UserID">UserID</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a> <a href="#v:getUserEntryForID" class="selflink">#</a></p><div class="doc"><p><code>getUserEntryForID gid</code> calls <code>getpwuid_r</code> to obtain
the <code>UserEntry</code> information associated with <code>UserID</code>
<code>uid</code>. This operation may fail with <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO-Error.html#v:isDoesNotExistError">isDoesNotExistError</a></code>
if no such user exists.</p></div></div><div class="top"><p class="src"><a id="v:getUserEntryForName" class="def">getUserEntryForName</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a> <a href="#v:getUserEntryForName" class="selflink">#</a></p><div class="doc"><p><code>getUserEntryForName name</code> calls <code>getpwnam_r</code> to obtain
the <code>UserEntry</code> information associated with the user login
<code>name</code>. This operation may fail with <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO-Error.html#v:isDoesNotExistError">isDoesNotExistError</a></code>
if no such user exists.</p></div></div><div class="top"><p class="src"><a id="v:getAllUserEntries" class="def">getAllUserEntries</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> [<a href="System-PosixCompat-User.html#t:UserEntry">UserEntry</a>] <a href="#v:getAllUserEntries" class="selflink">#</a></p><div class="doc"><p><code>getAllUserEntries</code> returns all user entries on the system by
repeatedly calling <code>getpwent</code></p></div></div><h2 id="g:5">Modifying the user environment</h2><div class="top"><p class="src"><a id="v:setUserID" class="def">setUserID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:UserID">UserID</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> () <a href="#v:setUserID" class="selflink">#</a></p><div class="doc"><p><code>setUserID uid</code> calls <code>setuid</code> to set the real, effective, and
saved set-user-id associated with the current process to <code>uid</code>.</p></div></div><div class="top"><p class="src"><a id="v:setGroupID" class="def">setGroupID</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-Posix-Types.html#t:GroupID">GroupID</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> () <a href="#v:setGroupID" class="selflink">#</a></p><div class="doc"><p><code>setGroupID gid</code> calls <code>setgid</code> to set the real, effective, and
saved set-group-id associated with the current process to <code>gid</code>.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.2</p></div></body></html>
|