Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: compaudit slow with many groups
- X-seq: zsh-workers 19669
- From: Danek Duvall <duvall@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: compaudit slow with many groups
- Date: Sun, 21 Mar 2004 10:46:56 -0800
- In-reply-to: <20040319215724.GB23658@xxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Danek Duvall <duvall@xxxxxxxxxxx>, zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20040319215724.GB23658@xxxxxxxxxxxxxxxxxx>
On Fri, Mar 19, 2004 at 01:57:24PM -0800, Danek Duvall wrote:
> local GROUP GROUPMEM _i_pw _i_gid _i_ulwdirs
> if (( UID == EUID )); then
> getent group $UID | IFS=: read GROUP _i_pw _i_gid GROUPMEM
> [[ $GROUP == $LOGNAME ]] || unset GROUP GROUPMEM
> else
> getent group $EGID | IFS=: read GROUP _i_pw _i_gid GROUPMEM
> (( _i_gid == EGID )) || unset GROUP GROUPMEM
> fi
Hm. That's pretty obviously broken. But I think this is right:
if ((UID == EUID )); then
getent group $LOGNAME | IFS=: read GROUP _i_pw _i_gid GROUPMEM
else
getent group $EGID | IFS=: read GROUP _i_pw _i_gid GROUPMEM
fi
Much quicker. :)
Thanks,
Danek
Messages sorted by:
Reverse Date,
Date,
Thread,
Author