summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-07-22 19:32:13 +0000
committerJeremy Allison <jra@samba.org>2002-07-22 19:32:13 +0000
commit36606f727d07cc454f2a3106ef599376fa0635f7 (patch)
treed1f80efdc5b549803049649d3bb526cbbcc0c517 /source3/printing
parent88bef55a6efceef72a1378d0c7fa93c277fb1940 (diff)
downloadsamba-36606f727d07cc454f2a3106ef599376fa0635f7.tar.gz
samba-36606f727d07cc454f2a3106ef599376fa0635f7.tar.bz2
samba-36606f727d07cc454f2a3106ef599376fa0635f7.zip
Ensure we're root before opening a printer backend tdb.
Jeremy. (This used to be commit 48ab4ae4221ed0be34c269e01a4e8b6bc93f87d7)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/printing.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 9b0e8cdfb0..3579ddd7a0 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -188,7 +188,11 @@ static struct tdb_print_db *get_print_db_byname(const char *printername)
pstrcpy(printdb_path, lock_path("printing/"));
pstrcat(printdb_path, printername);
pstrcat(printdb_path, ".tdb");
+
+ become_root();
p->tdb = tdb_open_log(printdb_path, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
+ unbecome_root();
+
if (!p->tdb) {
DEBUG(0,("get_print_db: Failed to open printer backend database %s.\n",
printdb_path ));