From 0b12020f10a0ccf4543fc087dd2e9e0b2e8d56f8 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 11 Jan 2020 14:50:52 +0100 Subject: [PATCH] ip/cifsd: implement SMB_SET_FILE_UNIX_BASIC for wstat --- sys/src/cmd/ip/cifsd/smb.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sys/src/cmd/ip/cifsd/smb.c b/sys/src/cmd/ip/cifsd/smb.c index d0917ddca..08278e609 100644 --- a/sys/src/cmd/ip/cifsd/smb.c +++ b/sys/src/cmd/ip/cifsd/smb.c @@ -1232,7 +1232,7 @@ static int setfilepathinformation(Req *r, Dir *d, File *f, char *path, int level, uchar *b, uchar *p, uchar *e) { int attr, adt, atm, mdt, mtm, delete; - vlong len, atime, mtime; + vlong len, ctime, atime, mtime, mode; Dir nd; nulldir(&nd); @@ -1282,6 +1282,22 @@ setfilepathinformation(Req *r, Dir *d, File *f, char *path, int level, uchar *b, nd.length = len; break; + case 0x0200: /* SMB_SET_FILE_UNIX_BASIC */ + if(!unpack(b, p, e, "v________vvv____________________________________________v________", + &len, &ctime, &atime, &mtime, &mode)) + goto unsup; + if(len != -1LL) + nd.length = len; + if(atime && atime != -1LL) + nd.atime = fromfiletime(atime); + if(mtime && mtime != -1LL) + nd.mtime = fromfiletime(mtime); + else if(ctime && ctime != -1LL) + nd.mtime = fromfiletime(ctime); + if(mode != -1LL) + nd.mode = (d->mode & ~0777) | (mode & 0777); + break; + default: logit("[%.4x] unknown SET infolevel", level); return STATUS_OS2_INVALID_LEVEL;