diff options
author | Nathan Straz <nstraz@redhat.com> | 2009-10-08 08:52:33 -0400 |
---|---|---|
committer | Nathan Straz <nstraz@redhat.com> | 2009-10-08 08:52:33 -0400 |
commit | 0d65048dd98bc1b408fe9a2f3e6157c28a1c4c7d (patch) | |
tree | 7b904e2111577c647a848c8b8490d62ff11b35c3 /qarsh.c | |
parent | f5e388528bd8f1b6ca10a43c0f32f3fd1d3dfabe (diff) | |
download | qarsh-0d65048dd98bc1b408fe9a2f3e6157c28a1c4c7d.tar.gz qarsh-0d65048dd98bc1b408fe9a2f3e6157c28a1c4c7d.tar.xz qarsh-0d65048dd98bc1b408fe9a2f3e6157c28a1c4c7d.zip |
Only look up local username if remote not specified
In rare cases the getpwuid() call will fail because of a YP
or LDAP timeout. If we're not using the local username we
shouldn't even bother looking it up.
Diffstat (limited to 'qarsh.c')
-rw-r--r-- | qarsh.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -483,11 +483,11 @@ again: *sp = '\0'; } } - if (!(pw = getpwuid(getuid()))) { - fprintf(stderr, "qarsh: unknown user id.\n"); - exit(1); - } if (remuser == NULL) { + if (!(pw = getpwuid(getuid()))) { + fprintf(stderr, "qarsh: can not look up local username.\n"); + exit(1); + } remuser = strdup(pw->pw_name); } |