summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-01-05 13:13:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:56 -0500
commit1307337aaf050fa51758b5b844986eddc06693b7 (patch)
tree696da4e8ae5f8c7c8940820bddc9615d775ba43f /source3/printing
parent84da72860e3912cfd8be45919360c0931b8bbbda (diff)
downloadsamba-1307337aaf050fa51758b5b844986eddc06693b7.tar.gz
samba-1307337aaf050fa51758b5b844986eddc06693b7.tar.bz2
samba-1307337aaf050fa51758b5b844986eddc06693b7.zip
r20544: Change copy_file() to return NTSTATUS. This is in preparation of turning
close_file() to NTSTATUS as well. I'm not sure I got all the error codes right, but as I've never come across a smb_copy() call in all my Samba work, I'm leaving it at that. If I'm absolutely bored, I will write a thorough torture test. As far as I can see, Samba4 even does not have a libcli implementation for it... :-) Volker (This used to be commit 5ebdf02ba166df69e210e6f70c01a44e6205ecc1)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index d1d7745d44..5fa5db54e4 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -1746,7 +1746,6 @@ WERROR move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract
SMB_STRUCT_STAT st;
int ver = 0;
int i;
- int err;
memset(inbuf, '\0', sizeof(inbuf));
memset(outbuf, '\0', sizeof(outbuf));
@@ -1826,8 +1825,8 @@ WERROR move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract
slprintf(old_name, sizeof(old_name)-1, "%s/%s", new_dir, driver->driverpath);
if (ver != -1 && (ver=file_version_is_newer(conn, new_name, old_name)) > 0) {
driver_unix_convert(new_name, conn, NULL, &bad_path, &st);
- if ( !copy_file(new_name, old_name, conn, OPENX_FILE_EXISTS_TRUNCATE|
- OPENX_FILE_CREATE_IF_NOT_EXIST, 0, False, &err) ) {
+ if ( !NT_STATUS_IS_OK(copy_file(new_name, old_name, conn, OPENX_FILE_EXISTS_TRUNCATE|
+ OPENX_FILE_CREATE_IF_NOT_EXIST, 0, False))) {
DEBUG(0,("move_driver_to_download_area: Unable to rename [%s] to [%s]\n",
new_name, old_name));
*perr = WERR_ACCESS_DENIED;
@@ -1842,8 +1841,8 @@ WERROR move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract
slprintf(old_name, sizeof(old_name)-1, "%s/%s", new_dir, driver->datafile);
if (ver != -1 && (ver=file_version_is_newer(conn, new_name, old_name)) > 0) {
driver_unix_convert(new_name, conn, NULL, &bad_path, &st);
- if ( !copy_file(new_name, old_name, conn, OPENX_FILE_EXISTS_TRUNCATE|
- OPENX_FILE_CREATE_IF_NOT_EXIST, 0, False, &err) ) {
+ if ( !NT_STATUS_IS_OK(copy_file(new_name, old_name, conn, OPENX_FILE_EXISTS_TRUNCATE|
+ OPENX_FILE_CREATE_IF_NOT_EXIST, 0, False))) {
DEBUG(0,("move_driver_to_download_area: Unable to rename [%s] to [%s]\n",
new_name, old_name));
*perr = WERR_ACCESS_DENIED;
@@ -1860,8 +1859,8 @@ WERROR move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract
slprintf(old_name, sizeof(old_name)-1, "%s/%s", new_dir, driver->configfile);
if (ver != -1 && (ver=file_version_is_newer(conn, new_name, old_name)) > 0) {
driver_unix_convert(new_name, conn, NULL, &bad_path, &st);
- if ( !copy_file(new_name, old_name, conn, OPENX_FILE_EXISTS_TRUNCATE|
- OPENX_FILE_CREATE_IF_NOT_EXIST, 0, False, &err) ) {
+ if ( !NT_STATUS_IS_OK(copy_file(new_name, old_name, conn, OPENX_FILE_EXISTS_TRUNCATE|
+ OPENX_FILE_CREATE_IF_NOT_EXIST, 0, False))) {
DEBUG(0,("move_driver_to_download_area: Unable to rename [%s] to [%s]\n",
new_name, old_name));
*perr = WERR_ACCESS_DENIED;
@@ -1879,8 +1878,8 @@ WERROR move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract
slprintf(old_name, sizeof(old_name)-1, "%s/%s", new_dir, driver->helpfile);
if (ver != -1 && (ver=file_version_is_newer(conn, new_name, old_name)) > 0) {
driver_unix_convert(new_name, conn, NULL, &bad_path, &st);
- if ( !copy_file(new_name, old_name, conn, OPENX_FILE_EXISTS_TRUNCATE|
- OPENX_FILE_CREATE_IF_NOT_EXIST, 0, False, &err) ) {
+ if ( !NT_STATUS_IS_OK(copy_file(new_name, old_name, conn, OPENX_FILE_EXISTS_TRUNCATE|
+ OPENX_FILE_CREATE_IF_NOT_EXIST, 0, False))) {
DEBUG(0,("move_driver_to_download_area: Unable to rename [%s] to [%s]\n",
new_name, old_name));
*perr = WERR_ACCESS_DENIED;
@@ -1907,9 +1906,9 @@ WERROR move_driver_to_download_area(NT_PRINTER_DRIVER_INFO_LEVEL driver_abstract
slprintf(old_name, sizeof(old_name)-1, "%s/%s", new_dir, driver->dependentfiles[i]);
if (ver != -1 && (ver=file_version_is_newer(conn, new_name, old_name)) > 0) {
driver_unix_convert(new_name, conn, NULL, &bad_path, &st);
- if ( !copy_file(new_name, old_name, conn,
+ if ( !NT_STATUS_IS_OK(copy_file(new_name, old_name, conn,
OPENX_FILE_EXISTS_TRUNCATE|
- OPENX_FILE_CREATE_IF_NOT_EXIST, 0, False, &err) ) {
+ OPENX_FILE_CREATE_IF_NOT_EXIST, 0, False))) {
DEBUG(0,("move_driver_to_download_area: Unable to rename [%s] to [%s]\n",
new_name, old_name));
*perr = WERR_ACCESS_DENIED;