View Javadoc

    1   // ========================================================================
    2   // Copyright 2002-2005 Mort Bay Consulting Pty. Ltd.
    3   // ------------------------------------------------------------------------
    4   // Licensed under the Apache License, Version 2.0 (the "License");
    5   // you may not use this file except in compliance with the License.
    6   // You may obtain a copy of the License at
    7   // http://www.apache.org/licenses/LICENSE-2.0
    8   // Unless required by applicable law or agreed to in writing, software
    9   // distributed under the License is distributed on an "AS IS" BASIS,
    10  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    11  // See the License for the specific language governing permissions and
    12  // limitations under the License.
    13  // ========================================================================
    14
    15  package org.mortbay.setuid;
    16
    17  /**
    18   * Class is the equivalent java class used for holding values from native c code structure passwd. for more information please see man pages for getpwuid and getpwnam
    19   *   struct passwd {
    20   *        char    *pw_name;      // user name
    21   *        char    *pw_passwd;   // user password
    22   *        uid_t   pw_uid;         // user id
    23   *        gid_t   pw_gid;         // group id
    24   *        char    *pw_gecos;     // real name
    25   *        char    *pw_dir;        // home directory
    26   *       char    *pw_shell;      // shell program
    27   *    };
    28   *
    29   * @author Leopoldo Lee Agdeppa III
    30   */
    31
    32  public class Passwd
    33  {
    34      private String _pwName; /* user name */
    35      private String _pwPasswd; /* user password */
    36      private int _pwUid; /* user id */
    37      private int _pwGid; /* group id */
    38      private String _pwGecos; /* real name */
    39      private String _pwDir; /* home directory */
    40      private String _pwShell; /* shell program */
    41
    42
    43      public String getPwName()
    44      {
    45          return _pwName;
    46      }
    47
    48      public void setPwName(String pwName)
    49      {
    50          _pwName = pwName;
    51      }
    52
    53      public String getPwPasswd()
    54      {
    55          return _pwPasswd;
    56      }
    57
    58      public void setPwPasswd(String pwPasswd)
    59      {
    60          _pwPasswd = pwPasswd;
    61      }
    62
    63      public int getPwUid()
    64      {
    65          return _pwUid;
    66      }
    67
    68      public void setPwUid(int pwUid)
    69      {
    70          _pwUid = pwUid;
    71      }
    72
    73      public int getPwGid()
    74      {
    75          return _pwGid;
    76      }
    77
    78      public void setPwGid(int pwGid)
    79      {
    80          _pwGid = pwGid;
    81      }
    82
    83      public String getPwGecos()
    84      {
    85          return _pwGecos;
    86      }
    87
    88      public void setPwGid(String pwGecos)
    89      {
    90          _pwGecos = pwGecos;
    91      }
    92
    93      public String getPwDir()
    94      {
    95          return _pwDir;
    96      }
    97
    98      public void setPwDir(String pwDir)
    99      {
    100         _pwDir = pwDir;
    101     }
    102
    103     public String getPwShell()
    104     {
    105         return _pwShell;
    106     }
    107
    108     public void setPwShell(String pwShell)
    109     {
    110         _pwShell = pwShell;
    111     }
    112
    113 }