Patch: FYI: add real name property

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Tom proposed an interesting patch to GCJ:

Tom Tromey wrote:
> I'm checking this in on the trunk.
> 
> The Eclipse ChangeLog plugin wants to know the user's real name, but,
> strangely, there is no Java system property for this.  I don't see why
> we shouldn't provide this as a GNU extension.  This is both useful and
> safe, as code can easily check for the property's existence at
> runtime.
> 
> Tom
> 
> Index: libjava/ChangeLog
> from  Tom Tromey  <tromey@xxxxxxxxxx>
> 
> 	* gnu/classpath/natSystemProperties.cc (insertSystemProperties):
> 	Set gnu.gcj.user.realname.
> 
> Index: gcc/java/ChangeLog
> from  Tom Tromey  <tromey@xxxxxxxxxx>
> 
> 	* gcj.texi (libgcj Runtime Properties): Document
> 	gnu.gcj.user.realname.
> 
> Index: gcc/java/gcj.texi
> ===================================================================
> --- gcc/java/gcj.texi	(revision 114466)
> +++ gcc/java/gcj.texi	(working copy)
> @@ -2785,6 +2785,12 @@
>  used, or the program binary name in the case where an application is compiled 
>  to a native binary.
>  
> +@item gnu.gcj.user.realname
> +The real name of the user, as taken from the password file.  This may
> +not always hold only the user's name (as some sites put extra
> +information in this field).  Also, this property is not available on
> +all platforms.
> +
>  @item gnu.gcj.runtime.NameFinder.use_addr2line
>  Whether an external process, @command{addr2line}, should be used to determine
>  line number information when tracing the stack. Setting this to @code{false} 
> Index: libjava/gnu/classpath/natSystemProperties.cc
> ===================================================================
> --- libjava/gnu/classpath/natSystemProperties.cc	(revision 114466)
> +++ libjava/gnu/classpath/natSystemProperties.cc	(working copy)
> @@ -1,7 +1,7 @@
>  // natSystemProperties.cc - Implementation of native side of
>  // SystemProperties class.
>  
> -/* Copyright (C) 2005  Free Software Foundation
> +/* Copyright (C) 2005, 2006  Free Software Foundation
>  
>     This file is part of libgcj.
>  
> @@ -250,6 +250,7 @@
>      {
>        SET ("user.name", pwd_entry->pw_name);
>        SET ("user.home", pwd_entry->pw_dir);
> +      SET ("gnu.gcj.user.realname", pwd_entry->pw_gecos);
>      }
>  #endif /* HAVE_PWD_H */
>  #endif /* NO_GETUID */
> 
> 
I like the idea but would like to see this directed from GNU Classpath.

Instead of:

gnu.gcj.user.realname

it should be named:

gnu.classpath.user.realname

and put into our property documentation file as well as the VM integration
guide: "Optionally set this property to the real user name as it can be read
from the password file on GNU/Posix systems."

We can then go to the eclipse guys and ask them politely about supporting this
extension. :)

What do people think about it?

cya
Robert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : http://developer.classpath.org/pipermail/classpath/attachments/20060609/2e273122/signature.pgp

[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux