diff options
| author | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2009-04-01 23:47:32 -0400 |
|---|---|---|
| committer | Nalin Dahyabhai <nalin.dahyabhai@pobox.com> | 2009-04-01 23:47:32 -0400 |
| commit | 54607e80544c9c39983bb48951a3363adf3c24ba (patch) | |
| tree | e0ec04acb03183a4ba4f28429d7da1184d26e2be /src/credmonger.c | |
| parent | c62a16822f75e81f51b230d1cb550c7410ac4461 (diff) | |
| download | credmonger-54607e80544c9c39983bb48951a3363adf3c24ba.tar.gz credmonger-54607e80544c9c39983bb48951a3363adf3c24ba.tar.xz credmonger-54607e80544c9c39983bb48951a3363adf3c24ba.zip | |
- add a sample file
- return an error in a few more error cases
- tweak the .spec file
Diffstat (limited to 'src/credmonger.c')
| -rw-r--r-- | src/credmonger.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/credmonger.c b/src/credmonger.c index 488e3a6..e622646 100644 --- a/src/credmonger.c +++ b/src/credmonger.c @@ -426,8 +426,13 @@ entries_poll(void) /* Done with the ccache structure. */ krb5_cc_close(ctx, ccache); /* Fixup permissions. */ - chown(fccache + strlen(FCC_PREFIX), - entries[i]->uid, entries[i]->gid); + if (chown(fccache + strlen(FCC_PREFIX), + entries[i]->uid, entries[i]->gid) != 0) { + fprintf(stderr, "error setting permissions " + "on \"%s\": %s\n", + fccache + strlen(FCC_PREFIX), + strerror(errno)); + } /* If the configuration doesn't want a unique ccache * name, overwrite the destination with the contents of * this temporary file. */ @@ -583,10 +588,15 @@ main(int argc, char **argv) entries = entries_read(); if (entries == NULL) { fprintf(stderr, "nothing configured\n"); + return 1; } if (!nofork) { - daemon(0, 0); + if (daemon(0, 0) != 0) { + fprintf(stderr, "error going to background: %s\n", + strerror(errno)); + return 1; + } } fp = fopen(pidfile, "w"); |
