1 <Type Name="UnixUserInfo" FullName="Mono.Unix.UnixUserInfo">
2 <TypeSignature Language="C#" Value="public sealed class UnixUserInfo" />
3 <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit UnixUserInfo extends System.Object" />
5 <AssemblyName>Mono.Posix</AssemblyName>
6 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
7 <AssemblyVersion>2.0.0.0</AssemblyVersion>
8 <AssemblyVersion>4.0.0.0</AssemblyVersion>
10 <ThreadingSafetyStatement>All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.</ThreadingSafetyStatement>
12 <BaseTypeName>System.Object</BaseTypeName>
16 <summary>Provides information about a Unix user.</summary>
19 The <see cref="T:Mono.Unix.UnixUserInfo" /> type is a FxDG-compliant
20 wrapper over the <see cref="T:Mono.Unix.Native.Passwd" /> native type.
21 It represents a single entry from the local password database,
22 typically <c>/etc/passwd</c>.
25 Unix users are part of the file system access rules.
28 Access to file system objects
29 (as represented by <see cref="T:Mono.Unix.UnixFileSystemInfo" />)
30 is controlled by the file system access permissions,
31 <see cref="P:Mono.Unix.UnixFileSystemInfo.FileAccessPermissions" />.
32 <see cref="T:Mono.Unix.FileAccessPermissions" /> is a nine-bit field
33 specifying read, write, and execute access for the owner, group, and
34 everyone else (other).
37 Access by the file's owner is controlled by the bits specified by
39 (<see cref="P:Mono.Unix.UnixFileSystemInfo.FileAccessPermissions" />
41 <see cref="F:Mono.Unix.FileAccessPermissions.UserReadWriteExecute" />)</c>.
42 The owner permissions supersede group permissions and other
43 permissions, even if the owner belongs to the group.
48 <Member MemberName=".ctor">
49 <MemberSignature Language="C#" Value="public UnixUserInfo (Mono.Unix.Native.Passwd passwd);" />
50 <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class Mono.Unix.Native.Passwd passwd) cil managed" />
51 <MemberType>Constructor</MemberType>
53 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
54 <AssemblyVersion>2.0.0.0</AssemblyVersion>
55 <AssemblyVersion>4.0.0.0</AssemblyVersion>
58 <Parameter Name="passwd" Type="Mono.Unix.Native.Passwd" />
62 A <see cref="T:Mono.Unix.Native.Passwd" /> containing the user
63 to get information about.
66 Constructs and initializes a new instance of
67 <see cref="T:Mono.Unix.UnixUserInfo" /> by using the specified
68 <see cref="T:Mono.Unix.Native.Passwd" /> entry.
72 This constructor wraps <paramref name="passwd" />,
73 providing framework-compliant naming conventions over the native
74 <see cref="T:Mono.Unix.Native.Passwd" /> type.
79 <Member MemberName=".ctor">
80 <MemberSignature Language="C#" Value="public UnixUserInfo (long user);" />
81 <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(int64 user) cil managed" />
82 <MemberType>Constructor</MemberType>
84 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
85 <AssemblyVersion>2.0.0.0</AssemblyVersion>
86 <AssemblyVersion>4.0.0.0</AssemblyVersion>
89 <Parameter Name="user" Type="System.Int64" />
93 A <see cref="T:System.Int64" /> containing the user id to get
97 Constructs and initializes a new instance of
98 <see cref="T:Mono.Unix.UnixUserInfo" /> by looking up the specified
99 user id in the local password database file.
103 This constructor looks up the specified user id in the local
107 <exception cref="T:System.ArgumentException">
108 The user id <paramref name="user" /> does not exist in the lcoal
111 <altmember cref="M:Mono.Unix.Native.Syscall.getpwuid_r" />
114 <Member MemberName=".ctor">
115 <MemberSignature Language="C#" Value="public UnixUserInfo (string user);" />
116 <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string user) cil managed" />
117 <MemberType>Constructor</MemberType>
119 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
120 <AssemblyVersion>2.0.0.0</AssemblyVersion>
121 <AssemblyVersion>4.0.0.0</AssemblyVersion>
124 <Parameter Name="user" Type="System.String" />
128 A <see cref="T:System.String" /> containing the user to get
132 Constructs and initializes a new instance of
133 <see cref="T:Mono.Unix.UnixUserInfo" /> by looking up the specified
134 user name in the local password database file.
138 This constructor looks up the specified user name in the local
142 <exception cref="T:System.ArgumentException">
143 The user name <paramref name="user" /> does not exist in the lcoal
146 <altmember cref="M:Mono.Unix.Native.Syscall.getpwnam_r" />
149 <Member MemberName=".ctor">
150 <MemberSignature Language="C#" Value="public UnixUserInfo (uint user);" />
151 <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(unsigned int32 user) cil managed" />
152 <MemberType>Constructor</MemberType>
154 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
155 <AssemblyVersion>2.0.0.0</AssemblyVersion>
156 <AssemblyVersion>4.0.0.0</AssemblyVersion>
160 <AttributeName>System.CLSCompliant(false)</AttributeName>
164 <Parameter Name="user" Type="System.UInt32" />
168 A <see cref="T:System.UInt32" /> containing the user id to get
172 Constructs and initializes a new instance of
173 <see cref="T:Mono.Unix.UnixUserInfo" /> by looking up the specified
174 user id in the local password database file.
178 This constructor looks up the specified user id in the local
182 <exception cref="T:System.ArgumentException">
183 The user id <paramref name="user" /> does not exist in the lcoal
186 <altmember cref="M:Mono.Unix.Native.Syscall.getpwuid_r" />
189 <Member MemberName="Equals">
190 <MemberSignature Language="C#" Value="public override bool Equals (object obj);" />
191 <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool Equals(object obj) cil managed" />
192 <MemberType>Method</MemberType>
194 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
195 <AssemblyVersion>2.0.0.0</AssemblyVersion>
196 <AssemblyVersion>4.0.0.0</AssemblyVersion>
199 <ReturnType>System.Boolean</ReturnType>
202 <Parameter Name="obj" Type="System.Object" />
205 <param name="obj">To be added.</param>
206 <summary>To be added.</summary>
207 <returns>To be added.</returns>
208 <remarks>To be added.</remarks>
211 <Member MemberName="GetHashCode">
212 <MemberSignature Language="C#" Value="public override int GetHashCode ();" />
213 <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetHashCode() cil managed" />
214 <MemberType>Method</MemberType>
216 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
217 <AssemblyVersion>2.0.0.0</AssemblyVersion>
218 <AssemblyVersion>4.0.0.0</AssemblyVersion>
221 <ReturnType>System.Int32</ReturnType>
225 <summary>To be added.</summary>
226 <returns>To be added.</returns>
227 <remarks>To be added.</remarks>
230 <Member MemberName="GetLocalUsers">
231 <MemberSignature Language="C#" Value="public static Mono.Unix.UnixUserInfo[] GetLocalUsers ();" />
232 <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Mono.Unix.UnixUserInfo[] GetLocalUsers() cil managed" />
233 <MemberType>Method</MemberType>
235 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
236 <AssemblyVersion>2.0.0.0</AssemblyVersion>
237 <AssemblyVersion>4.0.0.0</AssemblyVersion>
240 <ReturnType>Mono.Unix.UnixUserInfo[]</ReturnType>
244 <summary>Gets all local users defined in the local password database.</summary>
246 A <see cref="T:Mono.Unix.UnixUserInfo" /> array containing
247 information about all users in the local password database.
251 <exception cref="T:Mono.Unix.UnixIOException">
252 Insufficient memory to allocate the
253 <see cref="T:Mono.Unix.Native.Passwd" /> structure.
254 [<see cref="F:Mono.Unix.Native.Errno.ENOMEM" />]
258 <Member MemberName="GetLoginName">
259 <MemberSignature Language="C#" Value="public static string GetLoginName ();" />
260 <MemberSignature Language="ILAsm" Value=".method public static hidebysig string GetLoginName() cil managed" />
261 <MemberType>Method</MemberType>
263 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
264 <AssemblyVersion>2.0.0.0</AssemblyVersion>
265 <AssemblyVersion>4.0.0.0</AssemblyVersion>
268 <ReturnType>System.String</ReturnType>
272 <summary>Gets the login name of the user executing this process.</summary>
274 A <see cref="T:System.String" /> containing the login name of the
275 user executing this process.
279 It's generally more useful to use the <c>LOGNAME</c> environment
280 variable to find out who the user is, as this provides more
284 <altmember cref="M:Mono.Unix.Native.Syscall.getlogin_r" />
287 <Member MemberName="GetRealUser">
288 <MemberSignature Language="C#" Value="public static Mono.Unix.UnixUserInfo GetRealUser ();" />
289 <MemberSignature Language="ILAsm" Value=".method public static hidebysig class Mono.Unix.UnixUserInfo GetRealUser() cil managed" />
290 <MemberType>Method</MemberType>
292 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
293 <AssemblyVersion>2.0.0.0</AssemblyVersion>
294 <AssemblyVersion>4.0.0.0</AssemblyVersion>
297 <ReturnType>Mono.Unix.UnixUserInfo</ReturnType>
301 <summary>Get's information about the process' real user.</summary>
303 A <see cref="T:Mono.Unix.UnixUserInfo" /> containing information
304 about the real user the process is executing as.
310 <Member MemberName="GetRealUserId">
311 <MemberSignature Language="C#" Value="public static long GetRealUserId ();" />
312 <MemberSignature Language="ILAsm" Value=".method public static hidebysig int64 GetRealUserId() cil managed" />
313 <MemberType>Method</MemberType>
315 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
316 <AssemblyVersion>2.0.0.0</AssemblyVersion>
317 <AssemblyVersion>4.0.0.0</AssemblyVersion>
320 <ReturnType>System.Int64</ReturnType>
324 <summary>Gets the real user id of the process.</summary>
326 A <see cref="T:System.Int64" /> containing the real user id of the
331 <altmember cref="F:Mono.Unix.Native.Syscall.getuid" />
334 <Member MemberName="Group">
335 <MemberSignature Language="C#" Value="public Mono.Unix.UnixGroupInfo Group { get; }" />
336 <MemberSignature Language="ILAsm" Value=".property instance class Mono.Unix.UnixGroupInfo Group" />
337 <MemberType>Property</MemberType>
339 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
340 <AssemblyVersion>2.0.0.0</AssemblyVersion>
341 <AssemblyVersion>4.0.0.0</AssemblyVersion>
344 <ReturnType>Mono.Unix.UnixGroupInfo</ReturnType>
347 <summary>Gets information about the user's group.</summary>
349 A <see cref="T:Mono.Unix.UnixGroupInfo" /> containing information
350 about the group the user belongs to.
354 This is equivalent to
355 <see cref="C:Mono.Unix.UnixGroupInfo" />(<see cref="P:Mono.Unix.UnixUserInfo.GroupId" />).
360 <Member MemberName="GroupId">
361 <MemberSignature Language="C#" Value="public long GroupId { get; }" />
362 <MemberSignature Language="ILAsm" Value=".property instance int64 GroupId" />
363 <MemberType>Property</MemberType>
365 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
366 <AssemblyVersion>2.0.0.0</AssemblyVersion>
367 <AssemblyVersion>4.0.0.0</AssemblyVersion>
370 <ReturnType>System.Int64</ReturnType>
373 <summary>Gets the user's group id.</summary>
375 A <see cref="T:System.Int64" /> containing the users's group id.
379 Access to file system objects
380 (as represented by <see cref="T:Mono.Unix.UnixFileSystemInfo" />)
381 is controlled by the file system access permissions,
382 <see cref="P:Mono.Unix.UnixFileSystemInfo.FileAccessPermissions" />.
383 <see cref="T:Mono.Unix.FileAccessPermissions" /> is a nine-bit field
384 specifying read, write, and execute access for the owner, group, and
385 everyone else (other).
388 Access by the file's owner group is controlled by the bits
390 (<see cref="P:Mono.Unix.UnixFileSystemInfo.FileAccessPermissions" />
392 <see cref="F:Mono.Unix.FileAccessPermissions.GroupReadWriteExecute" />)</c>.
393 All group members get these access permissions, except for the file's
394 owner (if they belong to the file's owner group).
397 <altmember cref="F:Mono.Unix.Native.Passwd.pw_gid" />
400 <Member MemberName="GroupName">
401 <MemberSignature Language="C#" Value="public string GroupName { get; }" />
402 <MemberSignature Language="ILAsm" Value=".property instance string GroupName" />
403 <MemberType>Property</MemberType>
405 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
406 <AssemblyVersion>2.0.0.0</AssemblyVersion>
407 <AssemblyVersion>4.0.0.0</AssemblyVersion>
410 <ReturnType>System.String</ReturnType>
413 <summary>Gets the users's group's name.</summary>
415 A <see cref="T:System.String" /> containing the group name that the
420 This is equivalent to calling
421 <see cref="P:Mono.Unix.UnixUserInfo.Group" />.<see cref="P:Mono.Unix.UnixGroupInfo.GroupName" />.
426 <Member MemberName="HomeDirectory">
427 <MemberSignature Language="C#" Value="public string HomeDirectory { get; }" />
428 <MemberSignature Language="ILAsm" Value=".property instance string HomeDirectory" />
429 <MemberType>Property</MemberType>
431 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
432 <AssemblyVersion>2.0.0.0</AssemblyVersion>
433 <AssemblyVersion>4.0.0.0</AssemblyVersion>
436 <ReturnType>System.String</ReturnType>
439 <summary>Gets the user's home directory.</summary>
441 A <see cref="T:System.String" /> containing the user's home
446 <altmember cref="F:Mono.Unix.Native.Passwd.pw_dir" />
449 <Member MemberName="Password">
450 <MemberSignature Language="C#" Value="public string Password { get; }" />
451 <MemberSignature Language="ILAsm" Value=".property instance string Password" />
452 <MemberType>Property</MemberType>
454 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
455 <AssemblyVersion>2.0.0.0</AssemblyVersion>
456 <AssemblyVersion>4.0.0.0</AssemblyVersion>
459 <ReturnType>System.String</ReturnType>
462 <summary>Gets the user's password.</summary>
464 A <see cref="T:System.String" /> containing the user's password.
468 In years past, this <i>used</i> to contain the user's password.
469 This was later found to be a security problem, as it made it
470 easier to crack the passwords of other users.
473 Currently, the actual user password is not stored in the password
474 database, so this property is of little actual use.
477 <altmember cref="F:Mono.Unix.Native.Passwd.pw_passwd" />
480 <Member MemberName="RealName">
481 <MemberSignature Language="C#" Value="public string RealName { get; }" />
482 <MemberSignature Language="ILAsm" Value=".property instance string RealName" />
483 <MemberType>Property</MemberType>
485 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
486 <AssemblyVersion>2.0.0.0</AssemblyVersion>
487 <AssemblyVersion>4.0.0.0</AssemblyVersion>
490 <ReturnType>System.String</ReturnType>
493 <summary>Gets the user's real name.</summary>
495 A <see cref="T:System.String" /> containing the user's actual name,
496 complete with spaces, first name, last name, and anything else the
497 user wishes to provide.
501 <altmember cref="F:Mono.Unix.Native.Passwd.pw_gecos" />
504 <Member MemberName="ShellProgram">
505 <MemberSignature Language="C#" Value="public string ShellProgram { get; }" />
506 <MemberSignature Language="ILAsm" Value=".property instance string ShellProgram" />
507 <MemberType>Property</MemberType>
509 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
510 <AssemblyVersion>2.0.0.0</AssemblyVersion>
511 <AssemblyVersion>4.0.0.0</AssemblyVersion>
514 <ReturnType>System.String</ReturnType>
517 <summary>Gets the user's login shell program.</summary>
519 A <see cref="T:System.String" /> containing the user's login shell
524 <altmember cref="F:Mono.Unix.Native.Passwd.pw_shell" />
527 <Member MemberName="ToPasswd">
528 <MemberSignature Language="C#" Value="public Mono.Unix.Native.Passwd ToPasswd ();" />
529 <MemberSignature Language="ILAsm" Value=".method public hidebysig instance class Mono.Unix.Native.Passwd ToPasswd() cil managed" />
530 <MemberType>Method</MemberType>
532 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
533 <AssemblyVersion>2.0.0.0</AssemblyVersion>
534 <AssemblyVersion>4.0.0.0</AssemblyVersion>
537 <ReturnType>Mono.Unix.Native.Passwd</ReturnType>
542 Converts this <see cref="T:Mono.Unix.UnixUserInfo" /> instance into
543 an equivalent <see cref="T:Mono.Unix.Native.Passwd" /> instance.
546 A <see cref="T:Mono.Unix.Native.Passwd" /> instance containingn the
547 same information as this instance.
553 <Member MemberName="ToString">
554 <MemberSignature Language="C#" Value="public override string ToString ();" />
555 <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance string ToString() cil managed" />
556 <MemberType>Method</MemberType>
558 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
559 <AssemblyVersion>2.0.0.0</AssemblyVersion>
560 <AssemblyVersion>4.0.0.0</AssemblyVersion>
563 <ReturnType>System.String</ReturnType>
567 <summary>To be added.</summary>
568 <returns>To be added.</returns>
569 <remarks>To be added.</remarks>
572 <Member MemberName="UserId">
573 <MemberSignature Language="C#" Value="public long UserId { get; }" />
574 <MemberSignature Language="ILAsm" Value=".property instance int64 UserId" />
575 <MemberType>Property</MemberType>
577 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
578 <AssemblyVersion>2.0.0.0</AssemblyVersion>
579 <AssemblyVersion>4.0.0.0</AssemblyVersion>
582 <ReturnType>System.Int64</ReturnType>
585 <summary>Gets the user's id.</summary>
587 A <see cref="T:System.Int64" /> containing the user's id.
591 <altmember cref="F:Mono.Unix.Native.Passwd.pw_uid" />
594 <Member MemberName="UserName">
595 <MemberSignature Language="C#" Value="public string UserName { get; }" />
596 <MemberSignature Language="ILAsm" Value=".property instance string UserName" />
597 <MemberType>Property</MemberType>
599 <AssemblyVersion>1.0.5000.0</AssemblyVersion>
600 <AssemblyVersion>2.0.0.0</AssemblyVersion>
601 <AssemblyVersion>4.0.0.0</AssemblyVersion>
604 <ReturnType>System.String</ReturnType>
607 <summary>Gets the user's login name.</summary>
609 A <see cref="T:System.String" /> containing the user's login name.
613 This is what the user logs in to the computer as, and is generally
614 limited to eight characters in length.
617 <altmember cref="F:Mono.Unix.Native.Passwd.pw_name" />