bug-coreutils
[Top][All Lists]
Advanced

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

Re: print ID of given group


From: Eric Blake
Subject: Re: print ID of given group
Date: Fri, 17 Oct 2008 05:07:14 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Arkadiusz Miskiewicz on 10/17/2008 1:44 AM:
> Hello,
> 
> Consider adding "print ID of given group" utility to coreutils:
> 
> http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/~checkout~/SOURCES/coreutils-getgid.patch?rev=1.11;content-type=text%2Fplain

Thanks for the suggestion.  However, there are several procedural hurdles
first.  Is this something that would be worth adding as part of the id(1)
command, rather than inventing a new command?  Are there any existing
commands that can do this, or any existing implementations of this utility
in other OSs where we have documented behavior that we should be copying
for compatibility?

The patch you refer to claims to be written by Artur Frysiak; have you
contacted him about this proposition?  He would need to assign copyright
of these changes to FSF before we could accept them.

We don't need the translation to pl in this patch; instead, the
translation comes from the translation project based on the .pot file
updates after the English portion of the patch is applied.

Before we can apply the patch, it needs to be updated to the current
coreutils.git (post-7.0), since the coreutils 6.10 sources are somewhat
old.  Also, the patch should use GNU coding style, as given by the default
parameters to GNU indent.  For example, this snippet:

+       gr = getgrnam(argv[optind]);
+       if (gr == NULL) {
+               error (0, 0, _("cannot find group name %s"), 
quote(argv[optind]));
+               exit(EXIT_FAILURE);
+       } else
+               printf("%lu\n", (unsigned long int) gr->gr_gid);
+       exit(EXIT_SUCCESS);

should be rendered:

+  gr = getgrnam (argv[optind]);
+  if (gr == NULL)
+    error (EXIT_FAILURE, errno, _("cannot find group name %s"),
+           quote (argv[optind]));
+  printf ("%lu\n", (unsigned long int) gr->gr_gid);
+  exit (EXIT_SUCCESS);

There are probably several other technical merits that need improvements,
but it is not worth my time reviewing unless we first clear the legal
hurdle of whether it is safe to include, and the technical hurdle of
whether this is the best way to get at this functionality.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkj4ceIACgkQ84KuGfSFAYAaqwCgqglB7mKLrsT4WHra5FHFF0iv
nUwAoIll/QuknuLQxwRuSh9S0w+31WTO
=187U
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]