summaryrefslogtreecommitdiffabout
path: root/src/stat.c
authorSergey Poznyakoff <gray@Pirx.gnu.org.ua>2009-04-27 14:23:50 (GMT)
committer Sergey Poznyakoff <gray@Pirx.gnu.org.ua>2009-04-27 14:23:50 (GMT)
commit4d22b4e8668cc717440d66120b8607be9a273c97 (patch) (side-by-side diff)
tree93b4addac108a1c8e913f0d5c68cb513f5c82c31 /src/stat.c
parentfe8f5226e8bc39bdc75e40e1c1ea464e9fc60ad3 (diff)
downloadtagr-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') (more/less context) (ignore whitespace changes)
-rw-r--r--src/stat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/stat.c b/src/stat.c
index 85b76d9..813c5cb 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -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++;

Return to:

Send suggestions and report system problems to the System administrator.