Skip to content

Commit

Permalink
smbd: Use srv_put_dos_date2_ts() in reply_printqueue()
Browse files Browse the repository at this point in the history
srv_put_dos_date2_ts() uses convert_timespec_to_time_t() on the passed
timespec, which for ts_nsec==0 returns just tv_sec.

Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Guenther Deschner <[email protected]>
  • Loading branch information
vlendec authored and gd committed Dec 19, 2023
1 parent d5a0d6f commit abf323d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions source3/smbd/smb1_reply.c
Original file line number Diff line number Diff line change
Expand Up @@ -6022,7 +6022,10 @@ void reply_printqueue(struct smb_request *req)
for (i = first; i < num_to_get; i++) {
char blob[28];
char *p = blob;
time_t qtime = spoolss_Time_to_time_t(&info[i].info2.submitted);
struct timespec qtime = {
.tv_sec = spoolss_Time_to_time_t(
&info[i].info2.submitted),
};
int qstatus;
size_t len = 0;
uint16_t qrapjobid = pjobid_to_rap(sharename,
Expand All @@ -6034,7 +6037,7 @@ void reply_printqueue(struct smb_request *req)
qstatus = 3;
}

srv_put_dos_date2(p, 0, qtime);
srv_put_dos_date2_ts(p, 0, qtime);
SCVAL(p, 4, qstatus);
SSVAL(p, 5, qrapjobid);
SIVAL(p, 7, info[i].info2.size);
Expand Down

0 comments on commit abf323d

Please sign in to comment.