Fix UID/GID options parsing.

PR:		bin/42579
Submitted by:	Belousov Oleg <oleg@belousov.com>
Approved by:	luigi
MFC after:	2 weeks
This commit is contained in:
Maxim Konovalov 2002-11-06 14:57:18 +00:00
parent 751d91aabd
commit d6abaeebeb

View File

@ -2935,7 +2935,7 @@ add(int ac, char *av[])
pwd = (*end == '\0') ? getpwuid(uid) : getpwnam(*av);
if (pwd == NULL)
errx(EX_DATAERR, "uid \"%s\" nonexistent", *av);
cmd32->d[0] = uid;
cmd32->d[0] = pwd->pw_uid;
cmd->len = F_INSN_SIZE(ipfw_insn_u32);
ac--; av++;
}
@ -2954,7 +2954,7 @@ add(int ac, char *av[])
if (grp == NULL)
errx(EX_DATAERR, "gid \"%s\" nonexistent", *av);
cmd32->d[0] = gid;
cmd32->d[0] = grp->gr_gid;
cmd->len = F_INSN_SIZE(ipfw_insn_u32);
ac--; av++;
}