summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-12-10 17:52:50 +0100
committerGünther Deschner <gd@samba.org>2012-12-12 15:00:02 +0100
commit880b0f18bede936bafb806669ee4d160567e90bb (patch)
treef33dbada53f141b3dbe40bf15eba1febfccae8f2 /source3/printing
parent76ac4d923d7ea07ab13190217359ce283e925fac (diff)
downloadsamba-880b0f18bede936bafb806669ee4d160567e90bb.tar.gz
samba-880b0f18bede936bafb806669ee4d160567e90bb.tar.bz2
samba-880b0f18bede936bafb806669ee4d160567e90bb.zip
s3-printing: Correctly create the printing cache path.
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/printing.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index e0d6179c02..c394118303 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -197,13 +197,18 @@ bool print_backend_init(struct messaging_context *msg_ctx)
const char *sversion = "INFO/version";
int services = lp_numservices();
int snum;
+ bool ok;
if (!printer_list_parent_init()) {
return false;
}
+ ok = directory_create_or_exist(cache_path("printing"), geteuid(), 0755);
+ if (!ok) {
+ return false;
+ }
+
unlink(cache_path("printing.tdb"));
- mkdir(cache_path("printing"),0755);
/* handle a Samba upgrade */