diff options
author | Jeremy Allison <jra@samba.org> | 2006-07-11 18:01:26 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:19:14 -0500 |
commit | fbdcf2663b56007a438ac4f0d8d82436b1bfe688 (patch) | |
tree | 4e42c1f061391cea3d640152fd240682cbf4fd9a /source3/printing/nt_printing.c | |
parent | 5bf62a0c3cc95abe918f3e772bb10e0a90fdce22 (diff) | |
download | samba-fbdcf2663b56007a438ac4f0d8d82436b1bfe688.tar.gz samba-fbdcf2663b56007a438ac4f0d8d82436b1bfe688.tar.bz2 samba-fbdcf2663b56007a438ac4f0d8d82436b1bfe688.zip |
r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....
Jeremy.
(This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r-- | source3/printing/nt_printing.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index bcdf0e0462..4b71f6e0b6 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -1281,6 +1281,8 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr SMB_STRUCT_STAT stat_buf; BOOL bad_path; + NTSTATUS status; + SET_STAT_INVALID(st); SET_STAT_INVALID(stat_buf); new_create_time = (time_t)0; @@ -1291,16 +1293,16 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr driver_unix_convert(filepath,conn,NULL,&bad_path,&stat_buf); - fsp = open_file_ntcreate(conn, filepath, &stat_buf, + status = open_file_ntcreate(conn, filepath, &stat_buf, FILE_GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0, FILE_ATTRIBUTE_NORMAL, INTERNAL_OPEN_ONLY, - NULL); + NULL, &fsp); - if (!fsp) { + if (!NT_STATUS_IS_OK(status)) { /* Old file not found, so by definition new file is in fact newer */ DEBUG(10,("file_version_is_newer: Can't open old file [%s], errno = %d\n", filepath, errno)); @@ -1327,16 +1329,16 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr pstrcpy(filepath, new_file); driver_unix_convert(filepath,conn,NULL,&bad_path,&stat_buf); - fsp = open_file_ntcreate(conn, filepath, &stat_buf, + status = open_file_ntcreate(conn, filepath, &stat_buf, FILE_GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0, FILE_ATTRIBUTE_NORMAL, INTERNAL_OPEN_ONLY, - NULL); + NULL, &fsp); - if (!fsp) { + if (!NT_STATUS_IS_OK(status)) { /* New file not found, this shouldn't occur if the caller did its job */ DEBUG(3,("file_version_is_newer: Can't open new file [%s], errno = %d\n", filepath, errno)); @@ -1405,6 +1407,7 @@ static uint32 get_correct_cversion(const char *architecture, fstring driverpath_ BOOL bad_path; SMB_STRUCT_STAT st; connection_struct *conn; + NTSTATUS status; SET_STAT_INVALID(st); @@ -1460,16 +1463,16 @@ static uint32 get_correct_cversion(const char *architecture, fstring driverpath_ goto error_exit; } - fsp = open_file_ntcreate(conn, driverpath, &st, + status = open_file_ntcreate(conn, driverpath, &st, FILE_GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0, FILE_ATTRIBUTE_NORMAL, INTERNAL_OPEN_ONLY, - NULL); + NULL, &fsp); - if (!fsp) { + if (!NT_STATUS_IS_OK(status)) { DEBUG(3,("get_correct_cversion: Can't open file [%s], errno = %d\n", driverpath, errno)); *perr = WERR_ACCESS_DENIED; @@ -4368,7 +4371,8 @@ WERROR get_a_printer( Printer_entry *print_hnd, NT_PRINTER_INFO_LEVEL **pp_print fstrcpy( servername, print_hnd->servername ); else { fstrcpy( servername, "%L" ); - standard_sub_basic( "", servername, sizeof(servername)-1 ); + standard_sub_basic( "", "", servername, + sizeof(servername)-1 ); } result = get_a_printer_2( (*pp_printer)->info_2, servername, sharename ); @@ -5441,7 +5445,7 @@ BOOL print_access_check(struct current_user *user, int snum, int access_type) Check the time parameters allow a print operation. *****************************************************************************/ -BOOL print_time_access_check(int snum) +BOOL print_time_access_check(const char *servicename) { NT_PRINTER_INFO_LEVEL *printer = NULL; BOOL ok = False; @@ -5449,7 +5453,7 @@ BOOL print_time_access_check(int snum) struct tm *t; uint32 mins; - if (!W_ERROR_IS_OK(get_a_printer(NULL, &printer, 2, lp_servicename(snum)))) + if (!W_ERROR_IS_OK(get_a_printer(NULL, &printer, 2, servicename))) return False; if (printer->info_2->starttime == 0 && printer->info_2->untiltime == 0) |