<html lang="en"> <head> <title>Password Database Functions - Untitled</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="Untitled"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="System-Utilities.html#System-Utilities" title="System Utilities"> <link rel="prev" href="Current-Working-Directory.html#Current-Working-Directory" title="Current Working Directory"> <link rel="next" href="Group-Database-Functions.html#Group-Database-Functions" title="Group Database Functions"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="Password-Database-Functions"></a> <p> Next: <a rel="next" accesskey="n" href="Group-Database-Functions.html#Group-Database-Functions">Group Database Functions</a>, Previous: <a rel="previous" accesskey="p" href="Current-Working-Directory.html#Current-Working-Directory">Current Working Directory</a>, Up: <a rel="up" accesskey="u" href="System-Utilities.html#System-Utilities">System Utilities</a> <hr> </div> <h3 class="section">34.9 Password Database Functions</h3> <p>Octave's password database functions return information in a structure with the following fields. <dl> <dt><code>name</code><dd>The user name. <br><dt><code>passwd</code><dd>The encrypted password, if available. <br><dt><code>uid</code><dd>The numeric user id. <br><dt><code>gid</code><dd>The numeric group id. <br><dt><code>gecos</code><dd>The GECOS field. <br><dt><code>dir</code><dd>The home directory. <br><dt><code>shell</code><dd>The initial shell. </dl> <p>In the descriptions of the following functions, this data structure is referred to as a <var>pw_struct</var>. <!-- ./DLD-FUNCTIONS/getpwent.cc --> <p><a name="doc_002dgetpwent"></a> <div class="defun"> — Loadable Function: <var>pw_struct</var> = <b>getpwent</b> ()<var><a name="index-getpwent-2432"></a></var><br> <blockquote><p>Return a structure containing an entry from the password database, opening it if necessary. Once the end of the data has been reached, <code>getpwent</code> returns 0. </p></blockquote></div> <!-- ./DLD-FUNCTIONS/getpwent.cc --> <p><a name="doc_002dgetpwuid"></a> <div class="defun"> — Loadable Function: <var>pw_struct</var> = <b>getpwuid</b> (<var>uid</var>)<var>.<a name="index-getpwuid-2433"></a></var><br> <blockquote><p>Return a structure containing the first entry from the password database with the user ID <var>uid</var>. If the user ID does not exist in the database, <code>getpwuid</code> returns 0. </p></blockquote></div> <!-- ./DLD-FUNCTIONS/getpwent.cc --> <p><a name="doc_002dgetpwnam"></a> <div class="defun"> — Loadable Function: <var>pw_struct</var> = <b>getpwnam</b> (<var>name</var>)<var><a name="index-getpwnam-2434"></a></var><br> <blockquote><p>Return a structure containing the first entry from the password database with the user name <var>name</var>. If the user name does not exist in the database, <code>getpwname</code> returns 0. </p></blockquote></div> <!-- ./DLD-FUNCTIONS/getpwent.cc --> <p><a name="doc_002dsetpwent"></a> <div class="defun"> — Loadable Function: <b>setpwent</b> ()<var><a name="index-setpwent-2435"></a></var><br> <blockquote><p>Return the internal pointer to the beginning of the password database. </p></blockquote></div> <!-- ./DLD-FUNCTIONS/getpwent.cc --> <p><a name="doc_002dendpwent"></a> <div class="defun"> — Loadable Function: <b>endpwent</b> ()<var><a name="index-endpwent-2436"></a></var><br> <blockquote><p>Close the password database. </p></blockquote></div> </body></html>