diff options
author | Sergey Poznyakoff <gray@Pirx.gnu.org.ua> | 2009-04-27 17:23:50 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@Pirx.gnu.org.ua> | 2009-04-27 17:23:50 +0300 |
commit | 4d22b4e8668cc717440d66120b8607be9a273c97 (patch) | |
tree | 93b4addac108a1c8e913f0d5c68cb513f5c82c31 /src/stat.c | |
parent | fe8f5226e8bc39bdc75e40e1c1ea464e9fc60ad3 (diff) | |
download | tagr-4d22b4e8668cc717440d66120b8607be9a273c97.tar.gz tagr-4d22b4e8668cc717440d66120b8607be9a273c97.tar.bz2 |
Bugfixes.
* src/main.c (change_user): Bugfix
(main): Reset user to the value of user_option, if set.
Fix (again) log_to_stderr initialization.
Switch to user privileges before actually performing any
actions that modify the database and other output files.
* src/report.c (open_db): Don't exit if unable to open
database. Return 1 instead. All callers updated.
* src/tagr.h (open_db): Update prototype.
Diffstat (limited to 'src/stat.c')
-rw-r--r-- | src/stat.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -426,7 +426,8 @@ import (const char *dirname) dirname, strerror (errno)); else if (S_ISREG (st.st_mode)) { - open_db (TAGR_DB_WR); + if (open_db (TAGR_DB_WR)) + exit (EX_UNAVAILABLE); if (import_log (dirname) == 0) count++; close_db (); @@ -445,7 +446,8 @@ import (const char *dirname) switch (rc) { case 0: - open_db (TAGR_DB_WR); + if (open_db (TAGR_DB_WR)) + exit (EX_UNAVAILABLE); for (i = 0; i < gl.gl_pathc; i++) if (import_log (gl.gl_pathv[i]) == 0) count++; |