Archive-xattr-Patch
All checks were successful
Source release / source-package (push) Successful in 41s
All checks were successful
Source release / source-package (push) Successful in 41s
This commit is contained in:
@@ -54,6 +54,7 @@ static int act_umode_file=0;
|
||||
#include "nwvolume.h"
|
||||
#include "nwshare.h"
|
||||
#include "nwattrib.h"
|
||||
#include "nwarchive.h"
|
||||
#include "trustee.h"
|
||||
#include "nwfile.h"
|
||||
#include "nwconn.h"
|
||||
@@ -1277,11 +1278,16 @@ static time_t nw_2_un_time_parts(uint16 xdate, uint16 xtime)
|
||||
return(mktime(&s_tm));
|
||||
}
|
||||
|
||||
#define DM_ARCHIVE_DATE 0x0020UL
|
||||
#define DM_ARCHIVE_TIME 0x0040UL
|
||||
#define DM_ARCHIVER_ID 0x0080UL
|
||||
#define DM_MODIFY_DATE 0x0100UL
|
||||
#define DM_MODIFY_TIME 0x0200UL
|
||||
#define DM_LAST_ACCESS_DATE 0x0800UL
|
||||
#define DM_NCP22_25_TIME_BITS \
|
||||
(DM_MODIFY_DATE | DM_MODIFY_TIME | DM_LAST_ACCESS_DATE)
|
||||
#define DM_NCP22_25_ARCHIVE_BITS \
|
||||
(DM_ARCHIVE_DATE | DM_ARCHIVE_TIME | DM_ARCHIVER_ID)
|
||||
|
||||
static int set_ncp22_25_times(int volume, char *unixname, struct stat *stb,
|
||||
NW_SET_DIR_INFO *f, uint32 change_mask,
|
||||
@@ -1342,6 +1348,40 @@ static int set_ncp22_25_times(int volume, char *unixname, struct stat *stb,
|
||||
return(0);
|
||||
}
|
||||
|
||||
static int set_ncp22_25_archive_info(char *unixname,
|
||||
NW_SET_DIR_INFO *f,
|
||||
uint32 change_mask,
|
||||
int is_dir)
|
||||
{
|
||||
uint16 adate = 0;
|
||||
uint16 atime = 0;
|
||||
uint32 aid = 0;
|
||||
|
||||
if (!(change_mask & DM_NCP22_25_ARCHIVE_BITS))
|
||||
return(0);
|
||||
|
||||
if (is_dir) {
|
||||
if (change_mask & DM_ARCHIVE_DATE)
|
||||
adate = (uint16)GET_16(f->u.d.archived.date);
|
||||
if (change_mask & DM_ARCHIVE_TIME)
|
||||
atime = (uint16)GET_16(f->u.d.archived.time);
|
||||
if (change_mask & DM_ARCHIVER_ID)
|
||||
aid = GET_BE32(f->u.d.archived.id);
|
||||
} else {
|
||||
if (change_mask & DM_ARCHIVE_DATE)
|
||||
adate = (uint16)GET_16(f->u.f.archived.date);
|
||||
if (change_mask & DM_ARCHIVE_TIME)
|
||||
atime = (uint16)GET_16(f->u.f.archived.time);
|
||||
if (change_mask & DM_ARCHIVER_ID)
|
||||
aid = GET_BE32(f->u.f.archived.id);
|
||||
}
|
||||
|
||||
return(mars_nwe_set_archive_info(unixname,
|
||||
!!(change_mask & DM_ARCHIVE_DATE), adate,
|
||||
!!(change_mask & DM_ARCHIVE_TIME), atime,
|
||||
!!(change_mask & DM_ARCHIVER_ID), aid));
|
||||
}
|
||||
|
||||
static int get_file_attrib(NW_FILE_INFO *f, char *unixname, struct stat *stb,
|
||||
NW_PATH *nwpath)
|
||||
{
|
||||
@@ -2861,6 +2901,17 @@ void get_dos_file_attrib(NW_DOS_FILE_INFO *f,
|
||||
un_time_2_nw(stb->st_mtime, f->created.time, 0);
|
||||
U32_TO_BE32(nw_owner, f->created.id);
|
||||
|
||||
{
|
||||
uint16 archive_date = 0;
|
||||
uint16 archive_time = 0;
|
||||
uint32 archiver_id = 0;
|
||||
mars_nwe_get_archive_info(unixname, &archive_date, &archive_time,
|
||||
&archiver_id, NULL);
|
||||
U16_TO_16(archive_date, f->archived.date);
|
||||
U16_TO_16(archive_time, f->archived.time);
|
||||
U32_TO_BE32(archiver_id, f->archived.id);
|
||||
}
|
||||
|
||||
un_date_2_nw(stb->st_mtime, f->updated.date, 0);
|
||||
un_time_2_nw(stb->st_mtime, f->updated.time, 0);
|
||||
U32_TO_BE32(nw_owner, f->updated.id);
|
||||
@@ -2888,6 +2939,16 @@ void get_dos_dir_attrib(NW_DOS_DIR_INFO *f,
|
||||
un_date_2_nw(stb->st_mtime, f->created.date,0);
|
||||
un_time_2_nw(stb->st_mtime, f->created.time,0);
|
||||
U32_TO_BE32(get_file_owner(stb), f->created.id);
|
||||
{
|
||||
uint16 archive_date = 0;
|
||||
uint16 archive_time = 0;
|
||||
uint32 archiver_id = 0;
|
||||
mars_nwe_get_archive_info(unixname, &archive_date, &archive_time,
|
||||
&archiver_id, NULL);
|
||||
U16_TO_16(archive_date, f->archived.date);
|
||||
U16_TO_16(archive_time, f->archived.time);
|
||||
U32_TO_BE32(archiver_id, f->archived.id);
|
||||
}
|
||||
un_date_2_nw(stb->st_mtime, f->modify_date, 0);
|
||||
un_time_2_nw(stb->st_mtime, f->modify_time, 0);
|
||||
U32_TO_BE32(MAX_U32, f->max_space);
|
||||
@@ -2995,6 +3056,10 @@ int nw_set_a_directory_entry(int dirhandle,
|
||||
else if (change_mask & DM_NCP22_25_TIME_BITS)
|
||||
s_stat(unixname, &stbuff, NULL);
|
||||
}
|
||||
if (!completition) {
|
||||
completition=set_ncp22_25_archive_info(unixname, f, change_mask,
|
||||
S_ISDIR(stbuff.st_mode));
|
||||
}
|
||||
if (S_ISDIR(stbuff.st_mode)) {
|
||||
if (change_mask & 0x1000) {
|
||||
int result=tru_set_inherited_mask(nwpath.volume, unixname,
|
||||
|
||||
Reference in New Issue
Block a user