Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
4060f075
Commit
4060f075
authored
Sep 06, 2003
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename variables for clarity.
parent
92aa4622
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
src/bin/pg_id/pg_id.c
src/bin/pg_id/pg_id.c
+12
-12
No files found.
src/bin/pg_id/pg_id.c
View file @
4060f075
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.2
2 2003/08/09 01:25:4
6 momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.2
3 2003/09/06 01:41:5
6 momjian Exp $
*/
#include "postgres_fe.h"
...
...
@@ -24,9 +24,9 @@ int
main
(
int
argc
,
char
*
argv
[])
{
int
c
;
int
nameflag
=
0
,
real
flag
=
0
,
userflag
=
0
;
int
name
_only_
flag
=
0
,
use_real_uid_
flag
=
0
,
limit_user_info
=
0
;
const
char
*
username
=
NULL
;
struct
passwd
*
pw
;
...
...
@@ -38,13 +38,13 @@ main(int argc, char *argv[])
switch
(
c
)
{
case
'n'
:
nameflag
=
1
;
name
_only_
flag
=
1
;
break
;
case
'r'
:
real
flag
=
1
;
use_real_uid_
flag
=
1
;
break
;
case
'u'
:
userflag
=
1
;
limit_user_info
=
1
;
break
;
default:
fprintf
(
stderr
,
"Usage: %s [-n] [-r] [-u] [username]
\n
"
,
argv
[
0
]);
...
...
@@ -55,12 +55,12 @@ main(int argc, char *argv[])
if
(
argc
-
optind
>=
1
)
username
=
argv
[
optind
];
if
(
name
flag
&&
!
userflag
)
if
(
name
_only_flag
&&
!
limit_user_info
)
{
fprintf
(
stderr
,
"%s: -n must be used together with -u
\n
"
,
argv
[
0
]);
exit
(
1
);
}
if
(
username
&&
real
flag
)
if
(
username
&&
use_real_uid_
flag
)
{
fprintf
(
stderr
,
"%s: -r cannot be used when a user name is given
\n
"
,
argv
[
0
]);
exit
(
1
);
...
...
@@ -76,7 +76,7 @@ main(int argc, char *argv[])
exit
(
1
);
}
}
else
if
(
real
flag
)
else
if
(
use_real_uid_
flag
)
pw
=
getpwuid
(
getuid
());
else
pw
=
getpwuid
(
geteuid
());
...
...
@@ -87,9 +87,9 @@ main(int argc, char *argv[])
exit
(
1
);
}
if
(
!
userflag
)
if
(
!
limit_user_info
)
printf
(
"uid=%d(%s)
\n
"
,
(
int
)
pw
->
pw_uid
,
pw
->
pw_name
);
else
if
(
nameflag
)
else
if
(
name
_only_
flag
)
puts
(
pw
->
pw_name
);
else
#ifdef __BEOS__
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment