printing/printfsp.c

ソースコードを見る。

関数

NTSTATUS print_fsp_open (connection_struct *conn, const char *fname, files_struct **result)
void print_fsp_end (files_struct *fsp, enum file_close_type close_type)

変数

current_user current_user


関数

NTSTATUS print_fsp_open ( connection_struct conn,
const char *  fname,
files_struct **  result 
)

printfsp.c31 行で定義されています。

参照先 files_struct::access_maskfiles_struct::can_lockfiles_struct::can_readfiles_struct::can_writecurrent_user::conncurrent_userfiles_struct::deverrnofd_handle::fdfiles_struct::fhfile_free()file_new()files_struct::fsp_nameGetTimeOfDay()files_struct::inodefiles_struct::is_directorymap_nt_error_from_unix()files_struct::modefiles_struct::modifiednameconnection_struct::num_files_openfiles_struct::open_timefiles_struct::oplock_typepjob_delete()pjobid_to_rap()fd_handle::posfiles_struct::print_fileprint_job_fd()print_job_fname()print_job_start()files_struct::rap_print_jobidresultfiles_struct::sent_oplock_breakstatusstring_set()current_user::vuidfiles_struct::vuidfiles_struct::wbmpx_ptrfiles_struct::wcp.

参照元 open_file_ntcreate()reply_printopen().

00033 {
00034         int jobid;
00035         SMB_STRUCT_STAT sbuf;
00036         files_struct *fsp;
00037         fstring name;
00038         NTSTATUS status;
00039 
00040         status = file_new(conn, &fsp);
00041         if(!NT_STATUS_IS_OK(status)) {
00042                 return status;
00043         }
00044 
00045         fstrcpy( name, "Remote Downlevel Document");
00046         if (fname) {
00047                 const char *p = strrchr(fname, '/');
00048                 fstrcat(name, " ");
00049                 if (!p) {
00050                         p = fname;
00051                 }
00052                 fstrcat(name, p);
00053         }
00054 
00055         jobid = print_job_start(&current_user, SNUM(conn), name, NULL);
00056         if (jobid == -1) {
00057                 status = map_nt_error_from_unix(errno);
00058                 file_free(fsp);
00059                 return status;
00060         }
00061 
00062         /* Convert to RAP id. */
00063         fsp->rap_print_jobid = pjobid_to_rap(lp_const_servicename(SNUM(conn)), jobid);
00064         if (fsp->rap_print_jobid == 0) {
00065                 /* We need to delete the entry in the tdb. */
00066                 pjob_delete(lp_const_servicename(SNUM(conn)), jobid);
00067                 file_free(fsp);
00068                 return NT_STATUS_ACCESS_DENIED; /* No errno around here */
00069         }
00070 
00071         /* setup a full fsp */
00072         fsp->fh->fd = print_job_fd(lp_const_servicename(SNUM(conn)),jobid);
00073         GetTimeOfDay(&fsp->open_time);
00074         fsp->vuid = current_user.vuid;
00075         fsp->fh->pos = -1;
00076         fsp->can_lock = True;
00077         fsp->can_read = False;
00078         fsp->access_mask = FILE_GENERIC_WRITE;
00079         fsp->can_write = True;
00080         fsp->print_file = True;
00081         fsp->modified = False;
00082         fsp->oplock_type = NO_OPLOCK;
00083         fsp->sent_oplock_break = NO_BREAK_SENT;
00084         fsp->is_directory = False;
00085         string_set(&fsp->fsp_name,print_job_fname(lp_const_servicename(SNUM(conn)),jobid));
00086         fsp->wbmpx_ptr = NULL;      
00087         fsp->wcp = NULL; 
00088         SMB_VFS_FSTAT(fsp,fsp->fh->fd, &sbuf);
00089         fsp->mode = sbuf.st_mode;
00090         fsp->inode = sbuf.st_ino;
00091         fsp->dev = sbuf.st_dev;
00092 
00093         conn->num_files_open++;
00094 
00095         *result = fsp;
00096         return NT_STATUS_OK;
00097 }

void print_fsp_end ( files_struct fsp,
enum file_close_type  close_type 
)

printfsp.c103 行で定義されています。

参照先 files_struct::connfd_handle::fdfiles_struct::fhfiles_struct::fsp_nameprint_job_end()fd_handle::private_optionsfiles_struct::rap_print_jobidrap_to_pjobid()string_free()sys_ftruncate().

参照元 close_normal_file().

00104 {
00105         uint32 jobid;
00106         fstring sharename;
00107 
00108         if (fsp->fh->private_options & FILE_DELETE_ON_CLOSE) {
00109                 /*
00110                  * Truncate the job. print_job_end will take
00111                  * care of deleting it for us. JRA.
00112                  */
00113                 sys_ftruncate(fsp->fh->fd, 0);
00114         }
00115 
00116         if (fsp->fsp_name) {
00117                 string_free(&fsp->fsp_name);
00118         }
00119 
00120         if (!rap_to_pjobid(fsp->rap_print_jobid, sharename, &jobid)) {
00121                 DEBUG(3,("print_fsp_end: Unable to convert RAP jobid %u to print jobid.\n",
00122                         (unsigned int)fsp->rap_print_jobid ));
00123                 return;
00124         }
00125 
00126         print_job_end(SNUM(fsp->conn),jobid, close_type);
00127 }


変数

struct current_user current_user

smbrun.c24 行で定義されています。


Sambaに対してSat Aug 29 21:24:04 2009に生成されました。  doxygen 1.4.7