Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153476889
D51689.id159601.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D51689.id159601.diff
View Options
diff --git a/usr.bin/id/id.c b/usr.bin/id/id.c
--- a/usr.bin/id/id.c
+++ b/usr.bin/id/id.c
@@ -46,7 +46,7 @@
#include <string.h>
#include <unistd.h>
-static void id_print(struct passwd *, int, int, int);
+static void id_print(struct passwd *);
static void pline(struct passwd *);
static void pretty(struct passwd *);
#ifdef USE_BSM_AUDIT
@@ -202,14 +202,7 @@
exit(0);
}
- if (pw) {
- id_print(pw, 1, 0, 0);
- }
- else {
- id = getuid();
- pw = getpwuid(id);
- id_print(pw, 0, 1, 1);
- }
+ id_print(pw);
exit(0);
}
@@ -254,7 +247,7 @@
}
static void
-id_print(struct passwd *pw, int use_ggl, int p_euid, int p_egid)
+id_print(struct passwd *pw)
{
struct group *gr;
gid_t gid, egid, lastgid;
@@ -277,7 +270,7 @@
if ((groups = malloc(sizeof(gid_t) * ngroups_max)) == NULL)
err(1, "malloc");
- if (use_ggl && pw != NULL) {
+ if (pw != NULL) {
ngroups = ngroups_max;
getgrouplist(pw->pw_name, gid, groups, &ngroups);
}
@@ -292,12 +285,12 @@
printf(" gid=%u", gid);
if ((gr = getgrgid(gid)))
(void)printf("(%s)", gr->gr_name);
- if (p_euid && (euid = geteuid()) != uid) {
+ if (pw == NULL && (euid = geteuid()) != uid) {
(void)printf(" euid=%u", euid);
if ((pw = getpwuid(euid)))
(void)printf("(%s)", pw->pw_name);
}
- if (p_egid && (egid = getegid()) != gid) {
+ if (pw == NULL && (egid = getegid()) != gid) {
(void)printf(" egid=%u", egid);
if ((gr = getgrgid(egid)))
(void)printf("(%s)", gr->gr_name);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 22, 9:26 AM (14 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31904480
Default Alt Text
D51689.id159601.diff (1 KB)
Attached To
Mode
D51689: id: revert to historical and documented behavior for `id`
Attached
Detach File
Event Timeline
Log In to Comment