Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 6e204a966e8c42d976f99a1700ce5f20 > files > 4225

ghc-7.4.2-4.mga5.i586.rpm

<!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.Posix.User</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_System-Posix-User.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">unix-2.5.1.1: POSIX functionality</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>non-portable (requires POSIX)</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Maintainer</th><td>libraries@haskell.org</td></tr><tr><th>Safe Haskell</th><td>Trustworthy</td></tr></table><p class="caption">System.Posix.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>POSIX user/group support
</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="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-Posix-Types.html#t:UserID">UserID</a></li><li class="src short"><a href="#v:getRealGroupID">getRealGroupID</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</a></li><li class="src short"><a href="#v:getEffectiveUserID">getEffectiveUserID</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-Posix-Types.html#t:UserID">UserID</a></li><li class="src short"><a href="#v:getEffectiveGroupID">getEffectiveGroupID</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</a></li><li class="src short"><a href="#v:getGroups">getGroups</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</a>]</li><li class="src short"><a href="#v:getLoginName">getLoginName</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:getEffectiveUserName">getEffectiveUserName</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.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="#v:GroupEntry">GroupEntry</a> {<ul class="subs"><li><a href="#v:groupName">groupName</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li><a href="#v:groupPassword">groupPassword</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li><a href="#v:groupID">groupID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</a></li><li><a href="#v:groupMembers">groupMembers</a> :: [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>]</li></ul>}</li><li class="src short"><a href="#v:getGroupEntryForID">getGroupEntryForID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="System-Posix-User.html#t:GroupEntry">GroupEntry</a></li><li class="src short"><a href="#v:getGroupEntryForName">getGroupEntryForName</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="System-Posix-User.html#t:GroupEntry">GroupEntry</a></li><li class="src short"><a href="#v:getAllGroupEntries">getAllGroupEntries</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="System-Posix-User.html#t:GroupEntry">GroupEntry</a>]</li><li class="src short"><span class="keyword">data</span>  <a href="#t:UserEntry">UserEntry</a>  = <a href="#v:UserEntry">UserEntry</a> {<ul class="subs"><li><a href="#v:userName">userName</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li><a href="#v:userPassword">userPassword</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li><a href="#v:userID">userID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:UserID">UserID</a></li><li><a href="#v:userGroupID">userGroupID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</a></li><li><a href="#v:userGecos">userGecos</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li><a href="#v:homeDirectory">homeDirectory</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li><a href="#v:userShell">userShell</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li></ul>}</li><li class="src short"><a href="#v:getUserEntryForID">getUserEntryForID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:UserID">UserID</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="System-Posix-User.html#t:UserEntry">UserEntry</a></li><li class="src short"><a href="#v:getUserEntryForName">getUserEntryForName</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="System-Posix-User.html#t:UserEntry">UserEntry</a></li><li class="src short"><a href="#v:getAllUserEntries">getAllUserEntries</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="System-Posix-User.html#t:UserEntry">UserEntry</a>]</li><li class="src short"><a href="#v:setUserID">setUserID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:UserID">UserID</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:setGroupID">setGroupID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:setEffectiveUserID">setEffectiveUserID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:UserID">UserID</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:setEffectiveGroupID">setEffectiveGroupID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:setGroups">setGroups</a> :: [<a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</a>] -&gt; <a href="../base-4.5.1.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 name="v:getRealUserID" class="def">getRealUserID</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-Posix-Types.html#t:UserID">UserID</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 name="v:getRealGroupID" class="def">getRealGroupID</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</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 name="v:getEffectiveUserID" class="def">getEffectiveUserID</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-Posix-Types.html#t:UserID">UserID</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 name="v:getEffectiveGroupID" class="def">getEffectiveGroupID</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</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 name="v:getGroups" class="def">getGroups</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</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 name="v:getLoginName" class="def">getLoginName</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</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 name="v:getEffectiveUserName" class="def">getEffectiveUserName</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="../base-4.5.1.0/Data-String.html#t:String">String</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 name="t:GroupEntry" class="def">GroupEntry</a>  </p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:GroupEntry" class="def">GroupEntry</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:groupName" class="def">groupName</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></dt><dd class="doc"><p>The name of this group (gr_name)
</p></dd><dt class="src"><a name="v:groupPassword" class="def">groupPassword</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></dt><dd class="doc"><p>The password for this group (gr_passwd)
</p></dd><dt class="src"><a name="v:groupID" class="def">groupID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</a></dt><dd class="doc"><p>The unique numeric ID for this group (gr_gid)
</p></dd><dt class="src"><a name="v:groupMembers" class="def">groupMembers</a> :: [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>]</dt><dd class="doc"><p>A list of zero or more usernames that are members (gr_mem)
</p></dd></dl><div class="clear"></div></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"><a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="System-Posix-User.html#t:GroupEntry">GroupEntry</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="../base-4.5.1.0/Text-Read.html#t:Read">Read</a> <a href="System-Posix-User.html#t:GroupEntry">GroupEntry</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="../base-4.5.1.0/Text-Show.html#t:Show">Show</a> <a href="System-Posix-User.html#t:GroupEntry">GroupEntry</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:getGroupEntryForID" class="def">getGroupEntryForID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="System-Posix-User.html#t:GroupEntry">GroupEntry</a></p><div class="doc"><p><code>getGroupEntryForID gid</code> calls <code>getgrgid</code> to obtain
   the <code>GroupEntry</code> information associated with <code>GroupID</code>
   <code>gid</code>.
</p></div></div><div class="top"><p class="src"><a name="v:getGroupEntryForName" class="def">getGroupEntryForName</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="System-Posix-User.html#t:GroupEntry">GroupEntry</a></p><div class="doc"><p><code>getGroupEntryForName name</code> calls <code>getgrnam</code> to obtain
   the <code>GroupEntry</code> information associated with the group called
   <code>name</code>.
</p></div></div><div class="top"><p class="src"><a name="v:getAllGroupEntries" class="def">getAllGroupEntries</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="System-Posix-User.html#t:GroupEntry">GroupEntry</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 name="t:UserEntry" class="def">UserEntry</a>  </p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:UserEntry" class="def">UserEntry</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:userName" class="def">userName</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></dt><dd class="doc"><p>Textual name of this user (pw_name)
</p></dd><dt class="src"><a name="v:userPassword" class="def">userPassword</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></dt><dd class="doc"><p>Password -- may be empty or fake if shadow is in use (pw_passwd)
</p></dd><dt class="src"><a name="v:userID" class="def">userID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:UserID">UserID</a></dt><dd class="doc"><p>Numeric ID for this user (pw_uid)
</p></dd><dt class="src"><a name="v:userGroupID" class="def">userGroupID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</a></dt><dd class="doc"><p>Primary group ID (pw_gid)
</p></dd><dt class="src"><a name="v:userGecos" class="def">userGecos</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></dt><dd class="doc"><p>Usually the real name for the user (pw_gecos)
</p></dd><dt class="src"><a name="v:homeDirectory" class="def">homeDirectory</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></dt><dd class="doc"><p>Home directory (pw_dir)
</p></dd><dt class="src"><a name="v:userShell" class="def">userShell</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></dt><dd class="doc"><p>Default shell (pw_shell)
</p></dd></dl><div class="clear"></div></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"><a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="System-Posix-User.html#t:UserEntry">UserEntry</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="../base-4.5.1.0/Text-Read.html#t:Read">Read</a> <a href="System-Posix-User.html#t:UserEntry">UserEntry</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="../base-4.5.1.0/Text-Show.html#t:Show">Show</a> <a href="System-Posix-User.html#t:UserEntry">UserEntry</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:getUserEntryForID" class="def">getUserEntryForID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:UserID">UserID</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="System-Posix-User.html#t:UserEntry">UserEntry</a></p><div class="doc"><p><code>getUserEntryForID gid</code> calls <code>getpwuid</code> to obtain
   the <code>UserEntry</code> information associated with <code>UserID</code>
   <code>uid</code>.
</p></div></div><div class="top"><p class="src"><a name="v:getUserEntryForName" class="def">getUserEntryForName</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> <a href="System-Posix-User.html#t:UserEntry">UserEntry</a></p><div class="doc"><p><code>getUserEntryForName name</code> calls <code>getpwnam</code> to obtain
   the <code>UserEntry</code> information associated with the user login
   <code>name</code>.
</p></div></div><div class="top"><p class="src"><a name="v:getAllUserEntries" class="def">getAllUserEntries</a> :: <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="System-Posix-User.html#t:UserEntry">UserEntry</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 name="v:setUserID" class="def">setUserID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:UserID">UserID</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</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 name="v:setGroupID" class="def">setGroupID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</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 class="top"><p class="src"><a name="v:setEffectiveUserID" class="def">setEffectiveUserID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:UserID">UserID</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p><code>setEffectiveUserID uid</code> calls <code>seteuid</code> to set the effective
   user-id associated with the current process to <code>uid</code>. This
   does not update the real user-id or set-user-id.
</p></div></div><div class="top"><p class="src"><a name="v:setEffectiveGroupID" class="def">setEffectiveGroupID</a> :: <a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p><code>setEffectiveGroupID uid</code> calls <code>setegid</code> to set the effective
   group-id associated with the current process to <code>gid</code>. This
   does not update the real group-id or set-group-id.
</p></div></div><div class="top"><p class="src"><a name="v:setGroups" class="def">setGroups</a> :: [<a href="../base-4.5.1.0/System-Posix-Types.html#t:GroupID">GroupID</a>] -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> ()</p><div class="doc"><p><code>setGroups</code> calls <code>setgroups</code> to set the list of
   supplementary <code>GroupID</code>s associated with the current process.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>