summaryrefslogtreecommitdiff
path: root/src/id.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-08-22 18:56:06 +0200
committerJim Meyering <meyering@redhat.com>2009-08-25 09:21:00 +0200
commit5e778f7c8d1ecf3d8f11385db013af2ba026e2a5 (patch)
treee460d471f37f0dce1ba06f60f88114d1a65326c4 /src/id.c
parent2bc0f3caaafeb240cdcfd050b7ad1fe0ad14addf (diff)
downloadcoreutils-5e778f7c8d1ecf3d8f11385db013af2ba026e2a5.tar.gz
coreutils-5e778f7c8d1ecf3d8f11385db013af2ba026e2a5.tar.bz2
coreutils-5e778f7c8d1ecf3d8f11385db013af2ba026e2a5.zip
global: convert indentation-TABs to spaces
Transformed via this shell code: t=$'\t' git ls-files \ | grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \ | grep -vE 'tests/pr/|help2man' \ | xargs grep -lE "^ *$t" \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
Diffstat (limited to 'src/id.c')
-rw-r--r--src/id.c118
1 files changed, 59 insertions, 59 deletions
diff --git a/src/id.c b/src/id.c
index 78f78e058..b28643b18 100644
--- a/src/id.c
+++ b/src/id.c
@@ -76,7 +76,7 @@ usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
- program_name);
+ program_name);
else
{
printf (_("Usage: %s [OPTION]... [USERNAME]\n"), program_name);
@@ -129,39 +129,39 @@ main (int argc, char **argv)
while ((optc = getopt_long (argc, argv, "agnruGZ", longopts, NULL)) != -1)
{
switch (optc)
- {
- case 'a':
- /* Ignore -a, for compatibility with SVR4. */
- break;
+ {
+ case 'a':
+ /* Ignore -a, for compatibility with SVR4. */
+ break;
case 'Z':
- /* politely decline if we're not on a selinux-enabled kernel. */
- if (!selinux_enabled)
- error (EXIT_FAILURE, 0,
- _("--context (-Z) works only on an SELinux-enabled kernel"));
+ /* politely decline if we're not on a selinux-enabled kernel. */
+ if (!selinux_enabled)
+ error (EXIT_FAILURE, 0,
+ _("--context (-Z) works only on an SELinux-enabled kernel"));
just_context = 1;
break;
- case 'g':
- just_group = true;
- break;
- case 'n':
- use_name = true;
- break;
- case 'r':
- use_real = true;
- break;
- case 'u':
- just_user = true;
- break;
- case 'G':
- just_group_list = true;
- break;
- case_GETOPT_HELP_CHAR;
- case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
- default:
- usage (EXIT_FAILURE);
- }
+ case 'g':
+ just_group = true;
+ break;
+ case 'n':
+ use_name = true;
+ break;
+ case 'r':
+ use_real = true;
+ break;
+ case 'u':
+ just_user = true;
+ break;
+ case 'G':
+ just_group_list = true;
+ break;
+ case_GETOPT_HELP_CHAR;
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
+ default:
+ usage (EXIT_FAILURE);
+ }
}
if (1 < argc - optind)
@@ -172,7 +172,7 @@ main (int argc, char **argv)
if (argc - optind == 1 && just_context)
error (EXIT_FAILURE, 0,
- _("cannot print security context when user specified"));
+ _("cannot print security context when user specified"));
/* If we are on a selinux-enabled kernel and no user is specified,
get our context. Otherwise, leave the context variable alone -
@@ -189,13 +189,13 @@ main (int argc, char **argv)
if (just_user + just_group + just_group_list == 0 && (use_real | use_name))
error (EXIT_FAILURE, 0,
- _("cannot print only names or real IDs in default format"));
+ _("cannot print only names or real IDs in default format"));
if (argc - optind == 1)
{
struct passwd *pwd = getpwnam (argv[optind]);
if (pwd == NULL)
- error (EXIT_FAILURE, 0, _("%s: No such user"), argv[optind]);
+ error (EXIT_FAILURE, 0, _("%s: No such user"), argv[optind]);
ruid = euid = pwd->pw_uid;
rgid = egid = pwd->pw_gid;
}
@@ -214,12 +214,12 @@ main (int argc, char **argv)
else if (just_group)
{
if (!print_group (use_real ? rgid : egid, use_name))
- ok = false;
+ ok = false;
}
else if (just_group_list)
{
if (!print_group_list (argv[optind], ruid, rgid, egid, use_name))
- ok = false;
+ ok = false;
}
else if (just_context)
{
@@ -245,11 +245,11 @@ print_user (uid_t uid)
{
pwd = getpwuid (uid);
if (pwd == NULL)
- {
- error (0, 0, _("cannot find name for user ID %lu"),
- (unsigned long int) uid);
- ok = false;
- }
+ {
+ error (0, 0, _("cannot find name for user ID %lu"),
+ (unsigned long int) uid);
+ ok = false;
+ }
}
if (pwd == NULL)
@@ -281,7 +281,7 @@ print_full_info (const char *username)
printf (_(" euid=%lu"), (unsigned long int) euid);
pwd = getpwuid (euid);
if (pwd)
- printf ("(%s)", pwd->pw_name);
+ printf ("(%s)", pwd->pw_name);
}
if (egid != rgid)
@@ -289,7 +289,7 @@ print_full_info (const char *username)
printf (_(" egid=%lu"), (unsigned long int) egid);
grp = getgrgid (egid);
if (grp)
- printf ("(%s)", grp->gr_name);
+ printf ("(%s)", grp->gr_name);
}
#if HAVE_GETGROUPS
@@ -298,32 +298,32 @@ print_full_info (const char *username)
int i;
int n_groups = mgetgroups (username, (pwd ? pwd->pw_gid : (gid_t) -1),
- &groups);
+ &groups);
if (n_groups < 0)
{
- if (username)
- {
- error (0, errno, _("failed to get groups for user %s"),
- quote (username));
- }
- else
- {
- error (0, errno, _("failed to get groups for the current process"));
- }
- ok = false;
- return;
+ if (username)
+ {
+ error (0, errno, _("failed to get groups for user %s"),
+ quote (username));
+ }
+ else
+ {
+ error (0, errno, _("failed to get groups for the current process"));
+ }
+ ok = false;
+ return;
}
if (n_groups > 0)
fputs (_(" groups="), stdout);
for (i = 0; i < n_groups; i++)
{
- if (i > 0)
- putchar (',');
- printf ("%lu", (unsigned long int) groups[i]);
- grp = getgrgid (groups[i]);
- if (grp)
- printf ("(%s)", grp->gr_name);
+ if (i > 0)
+ putchar (',');
+ printf ("%lu", (unsigned long int) groups[i]);
+ grp = getgrgid (groups[i]);
+ if (grp)
+ printf ("(%s)", grp->gr_name);
}
free (groups);
}