Hi Guys,
I’ve got a resource manager up and running - and it’s fine for local QNX
file read/writes + directory listings, etc.
As soon as I try and do simple reads or writes via Samba from a Windows
box, I get permission denied errors - and my trace tools lead to lots of
retrys and IO_STAT requests - which I have implemented.
Anyway, I’ve included a dump of which IO calls get made, and some flags,
as well as some of my code for IO_STAT handling.
Has anyone come up against this before - and e.g. knows which pitfalls I
need to have avoided?
Any help appreciated. This is for QNX4 - but I doubt it makes much
difference.
Cheers
Lance Roberts
<Code for IO_STAT handling - and dir calls for files>
static struct _io_fstat_reply *MakeMessageStatDetails(MessageDetails *m,
int oflag, int *len, int mtype)
{
static struct _io_fstat_reply info;
MSGQHeader *hdr;
if (m == NULL) {
info.status = ENOENT, info.zero = 0;
memset(&info.stat, 0, sizeof(struct stat));
}
else if ((hdr = DiskHeader(m->mRecno)) != NULL) {
info.status = EOK, info.zero = 0;
info.stat.st_ino = 0;
info.stat.st_dev = makedev(getnid(), Device, 0);
info.stat.st_size = hdr->hLength + sizeof(MSGQHeader);
info.stat.st_rdev = makedev(getnid(), Device, 0);
info.stat.st_ouid = info.stat.st_ogid = 0;
if (mtype == TYPE_WMSG)
info.stat.st_mode = _S_IFNAM | S_IPERMS;
else
info.stat.st_mode = _S_IFNAM | (S_IPERMS & ~(S_IWUSR | S_IWGRP |
S_IWOTH));
info.stat.st_ftime = info.stat.st_mtime = info.stat.st_atime =
m->mReceived;
info.stat.st_ctime = m->mCreation;
info.stat.st_nlink = hdr->hPriority;
info.stat.st_status = _FILE_USED;
info.stat.st_spare0 = 0;
}
else {
info.status = errno, info.zero = 0;
memset(&info.stat, 0, sizeof(struct stat));
}
return(*len = sizeof(info), &info);
}