summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-01-11 14:50:52 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2020-01-11 14:50:52 +0100
commit0b12020f10a0ccf4543fc087dd2e9e0b2e8d56f8 (patch)
tree85bfc23bb1ce77c19761e6a8335c11ca1605b725
parente55ee7fafd9c0abce539052339a64894e2161e3e (diff)
ip/cifsd: implement SMB_SET_FILE_UNIX_BASIC for wstat
-rw-r--r--sys/src/cmd/ip/cifsd/smb.c18
1 files changed, 17 insertions, 1 deletions
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;