Acked-by: Igor Mammedov <niallain@xxxxxxxxx> On Fri, Jan 7, 2011 at 5:11 PM, Jeff Layton <jlayton@xxxxxxxxx> wrote: > Signed-off-by: Jeff Layton <jlayton@xxxxxxxxx> > --- > Âcifs.upcall.c |  28 +++++++++++++--------------- > Â1 files changed, 13 insertions(+), 15 deletions(-) > > diff --git a/cifs.upcall.c b/cifs.upcall.c > index 34b0638..33b7e4c 100644 > --- a/cifs.upcall.c > +++ b/cifs.upcall.c > @@ -675,6 +675,7 @@ int main(const int argc, char *const argv[]) >    Âchar hostbuf[NI_MAXHOST], *host; >    Âstruct decoded_args arg; >    Âconst char *oid; > +    uid_t uid; > >    Âhostbuf[0] = '\0'; >    Âmemset(&arg, 0, sizeof(arg)); > @@ -748,27 +749,24 @@ int main(const int argc, char *const argv[]) >        Âgoto out; >    Â} > > -    if (!legacy_uid && (have & DKD_HAVE_CREDUID)) { > -        rc = setuid(arg.creduid); > -        if (rc == -1) { > -            syslog(LOG_ERR, "setuid: %s", strerror(errno)); > -            goto out; > -        } > -        ccname = find_krb5_cc(CIFS_DEFAULT_KRB5_DIR, arg.creduid); > -    } else if (have & DKD_HAVE_UID) { > -        rc = setuid(arg.uid); > -        if (rc == -1) { > -            syslog(LOG_ERR, "setuid: %s", strerror(errno)); > -            goto out; > -        } > -        ccname = find_krb5_cc(CIFS_DEFAULT_KRB5_DIR, arg.uid); > -    } else { > +    if (!legacy_uid && (have & DKD_HAVE_CREDUID)) > +        uid = arg.creduid; > +    else if (have & DKD_HAVE_UID) > +        uid = arg.uid; > +    else { >        Â/* no uid= or creduid= parm -- something is wrong */ >        Âsyslog(LOG_ERR, "No uid= or creduid= parm specified"); >        Ârc = 1; >        Âgoto out; >    Â} > > +    rc = setuid(uid); > +    if (rc == -1) { > +        syslog(LOG_ERR, "setuid: %s", strerror(errno)); > +        goto out; > +    } > +    ccname = find_krb5_cc(CIFS_DEFAULT_KRB5_DIR, uid); > + >    Âhost = arg.hostname; > >    Â// do mech specific authorization > -- > 1.7.3.4 > > ÿô.nÇ·®+%˱é¥wÿº{.nÇ·¥{±ý¶¡Ü}©²ÆzÚj:+v¨þø®w¥þàÞ¨è&¢)ß«a¶Úÿûz¹ÞúÝjÿwèf