diff options
author | Andreas Schneider <asn@samba.org> | 2012-12-10 17:52:50 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2012-12-12 15:00:02 +0100 |
commit | 880b0f18bede936bafb806669ee4d160567e90bb (patch) | |
tree | f33dbada53f141b3dbe40bf15eba1febfccae8f2 /source3/printing/printing.c | |
parent | 76ac4d923d7ea07ab13190217359ce283e925fac (diff) | |
download | samba-880b0f18bede936bafb806669ee4d160567e90bb.tar.gz |
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/printing.c')
-rw-r--r-- | source3/printing/printing.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c index e0d6179c021..c394118303a 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 */ |