NTMAKE_HEADERS = nmake /nologo /f ntmakefile install_headers
NTMAKE_LIBUTILS = nmake /nologo /f ntmakefile install_libutils
MKDIR = mkdir
-OBJ = src
+#OBJ = src
# Standard install directory.
!IFDEF AFSDEV_DESTDIR
$(INCFILEDIR)\fs_utils.h \
$(INCFILEDIR)\krb.h \
$(INCFILEDIR)\krb_prot.h \
+ $(INCFILEDIR)\cm_dir.h \
$(INCFILEDIR)\smb.h \
$(INCFILEDIR)\smb3.h \
$(INCFILEDIR)\smb_iocons.h \
if (code == ERROR_SUCCESS)
afsi_log("LAN adapter number %d", LANadapter);
else {
- LANadapter = 0;
- afsi_log("Default LAN adapter number 0");
+ LANadapter = -1;
+ afsi_log("Default LAN adapter number");
}
dummyLen = sizeof(cacheSize);
}
else
{
- LANadapter = 0;
- afsi_log("Default LAN adapter number 0");
+ LANadapter = -1;
+ afsi_log("Default LAN adapter number");
}
if (as->parms[1].items) {
#include <winsock2.h>
#include <osi.h>
+\r
+#ifdef DEBUG\r
+//#define NOTSERVICE\r
+#endif\r
extern void afsi_log(char *pattern, ...);
WaitToTerminate = CreateEvent(NULL, TRUE, FALSE, NULL);
+#ifndef NOTSERVICE\r
StatusHandle = RegisterServiceCtrlHandler(AFS_DAEMON_SERVICE_NAME,
(LPHANDLER_FUNCTION) afsd_ServiceControlHandler);
ServiceStatus.dwWaitHint = 15000;
ServiceStatus.dwControlsAccepted = 0;
SetServiceStatus(StatusHandle, &ServiceStatus);
+#endif
{
HANDLE h; char *ptbuf[1];
h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME);
if (code != 0)
osi_panic(reason, __FILE__, __LINE__);
+#ifndef NOTSERVICE
ServiceStatus.dwCurrentState = SERVICE_RUNNING;
ServiceStatus.dwWin32ExitCode = NO_ERROR;
ServiceStatus.dwCheckPoint = 0;
ServiceStatus.dwWaitHint = 0;
ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
SetServiceStatus(StatusHandle, &ServiceStatus);
+#endif
{
HANDLE h; char *ptbuf[1];
h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME);
SetServiceStatus(StatusHandle, &ServiceStatus);
}
+#ifdef NOTSERVICE
+void main()
+{
+ afsd_Main();
+ Sleep(1000);
+ return ;
+}
+#else
void _CRTAPI1 main()
{
LONG status = ERROR_SUCCESS;
if (!StartServiceCtrlDispatcher(dispatchTable))
status = GetLastError();
}
+#endif
} else
cellp = cm_rootCellp;
+ if (flags & PIOCTL_LOGON) {
+ userp = smb_FindCMUserByName(/*ioctlp->fidp->vcp,*/ uname,
+ ioctlp->fidp->vcp->rname);
+ }
+
/* store the token */
lock_ObtainMutex(&userp->mx);
ucellp = cm_GetUCell(userp, cellp);
extern smb_vc_t *smb_allVCsp; /* global vcp list */
smb_vc_t *vcp;
smb_user_t *usersp;
- cm_user_t *userp;
+ cm_user_t *userp = NULL;
cm_ucell_t *ucellp;
BOOL bExpired=FALSE;
*/
lock_ObtainWrite(&smb_rctLock);
for(vcp=smb_allVCsp; vcp; vcp=vcp->nextp) {
- for(usersp=vcp->usersp; usersp; usersp=usersp->nextp) {
- userp=usersp->userp;
- osi_assert(userp);
+ for(usersp=vcp->usersp; usersp; usersp=usersp->nextp) {\r
+ if (usersp->unp) {
+ if ((userp=usersp->unp->userp)==0)\r
+ continue;\r
+ } else\r
+ continue;\r
lock_ObtainMutex(&userp->mx);
for(ucellp=userp->cellInfop; ucellp; ucellp=ucellp->nextp) {
if(ucellp->flags & CM_UCELLFLAG_RXKAD) {
EVENT_HANDLE ncb_event;
} NCB, *PNCB;
+/* this struct is returned by NCBENUM command in Win32 but is not available
+ in DJGPP. */
+typedef struct {
+ int length;
+ int lana[8];
+} LANA_ENUM;
+
#define NCBCALL 0x10
#define NCBLISTEN 0x11
* directory or online at http://www.openafs.org/dl/license10.html
*/
+//#define NOSERVICE 1
+
#include <afs/param.h>
#include <afs/stds.h>
osi_log_t *smb_logp;
osi_rwlock_t smb_globalLock;
osi_rwlock_t smb_rctLock;
-
-unsigned char smb_LANadapter;
+osi_rwlock_t smb_ListenerLock;
+
+char smb_LANadapter;
unsigned char smb_sharename[NCBNAMSZ+1] = {0};
/* for debugging */
#define Sessionmax 100
EVENT_HANDLE SessionEvents[Sessionmax];
unsigned short LSNs[Sessionmax];
+int lanas[Sessionmax];
BOOL dead_sessions[Sessionmax];
+LANA_ENUM lana_list;
/* for raw I/O */
osi_mutex_t smb_RawBufLock;
smb_vc_t *smb_allVCsp;
+smb_username_t *usernamesp = NULL;
+
smb_waitingLock_t *smb_allWaitingLocks;
/* forward decl */
#define EXPIREDATE 834000000 /* Wed Jun 5 1996 */
+char * myCrt_Dispatch(int i)
+{
+ switch (i)
+ {
+ default:
+ return "unknown SMB op";
+ case 0x00:
+ return "(00)ReceiveCoreMakeDir";
+ case 0x01:
+ return "(01)ReceiveCoreRemoveDir";
+ case 0x02:
+ return "(02)ReceiveCoreOpen";
+ case 0x03:
+ return "(03)ReceiveCoreCreate";
+ case 0x04:
+ return "(04)ReceiveCoreClose";
+ case 0x05:
+ return "(05)ReceiveCoreFlush";
+ case 0x06:
+ return "(06)ReceiveCoreUnlink";
+ case 0x07:
+ return "(07)ReceiveCoreRename";
+ case 0x08:
+ return "(08)ReceiveCoreGetFileAttributes";
+ case 0x09:
+ return "(09)ReceiveCoreSetFileAttributes";
+ case 0x0a:
+ return "(0a)ReceiveCoreRead";
+ case 0x0b:
+ return "(0b)ReceiveCoreWrite";
+ case 0x0c:
+ return "(0c)ReceiveCoreLockRecord";
+ case 0x0d:
+ return "(0d)ReceiveCoreUnlockRecord";
+ case 0x0e:
+ return "(0e)SendCoreBadOp";
+ case 0x0f:
+ return "(0f)ReceiveCoreCreate";
+ case 0x10:
+ return "(10)ReceiveCoreCheckPath";
+ case 0x11:
+ return "(11)SendCoreBadOp";
+ case 0x12:
+ return "(12)ReceiveCoreSeek";
+ case 0x1a:
+ return "(1a)ReceiveCoreReadRaw";
+ case 0x1d:
+ return "(1d)ReceiveCoreWriteRawDummy";
+ case 0x22:
+ return "(22)ReceiveV3SetAttributes";
+ case 0x23:
+ return "(23)ReceiveV3GetAttributes";
+ case 0x24:
+ return "(24)ReceiveV3LockingX";
+ case 0x29:
+ return "(29)SendCoreBadOp";
+ case 0x2b:
+ return "(2b)ReceiveCoreEcho";
+ case 0x2d:
+ return "(2d)ReceiveV3OpenX";
+ case 0x2e:
+ return "(2e)ReceiveV3ReadX";
+ case 0x32:
+ return "(32)ReceiveV3Tran2A";
+ case 0x33:
+ return "(33)ReceiveV3Tran2A";
+ case 0x34:
+ return "(34)ReceiveV3FindClose";
+ case 0x35:
+ return "(35)ReceiveV3FindNotifyClose";
+ case 0x70:
+ return "(70)ReceiveCoreTreeConnect";
+ case 0x71:
+ return "(71)ReceiveCoreTreeDisconnect";
+ case 0x72:
+ return "(72)ReceiveNegotiate";
+ case 0x73:
+ return "(73)ReceiveV3SessionSetupX";
+ case 0x74:
+ return "(74)ReceiveV3UserLogoffX";
+ case 0x75:
+ return "(75)ReceiveV3TreeConnectX";
+ case 0x80:
+ return "(80)ReceiveCoreGetDiskAttributes";
+ case 0x81:
+ return "(81)ReceiveCoreSearchDir";
+ case 0xA0:
+ return "(A0)ReceiveNTTransact";
+ case 0xA2:
+ return "(A2)ReceiveNTCreateX";
+ case 0xA4:
+ return "(A4)ReceiveNTCancel";
+ case 0xc0:
+ return "(c0)SendCoreBadOp";
+ case 0xc1:
+ return "(c1)SendCoreBadOp";
+ case 0xc2:
+ return "(c2)SendCoreBadOp";
+ case 0xc3:
+ return "(c3)SendCoreBadOp";
+ }
+}
+char * myCrt_2Dispatch(int i)
+{
+ switch (i)
+ {
+ default:
+ return "unknown SMB op-2";
+ case 0:
+ return "S(00)CreateFile";
+ case 1:
+ return "S(01)FindFirst";
+ case 2:
+ return "S(02)FindNext"; /* FindNext */
+ case 3:
+ return "S(03)QueryFileSystem_ReceiveTran2QFSInfo";
+ case 4:
+ return "S(04)??";
+ case 5:
+ return "S(05)QueryFileInfo_ReceiveTran2QPathInfo";
+ case 6:
+ return "S(06)SetFileInfo_ReceiveTran2SetPathInfo";
+ case 7:
+ return "S(07)SetInfoHandle_ReceiveTran2QFileInfo";
+ case 8:
+ return "S(08)??_ReceiveTran2SetFileInfo";
+ case 9:
+ return "S(09)??_ReceiveTran2FSCTL";
+ case 10:
+ return "S(0a)_ReceiveTran2IOCTL";
+ case 11:
+ return "S(0b)_ReceiveTran2FindNotifyFirst";
+ case 12:
+ return "S(0c)_ReceiveTran2FindNotifyNext";
+ case 13:
+ return "S(0d)CreateDirectory_ReceiveTran2MKDir";
+ }
+}
/* scache must be locked */
unsigned int smb_Attributes(cm_scache_t *scp)
#endif /* !DJGPP */
}
-smb_vc_t *smb_FindVC(unsigned short lsn, int flags)
+smb_vc_t *smb_FindVC(unsigned short lsn, int flags, int lana)
{
smb_vc_t *vcp;
lock_ObtainWrite(&smb_rctLock);
for(vcp = smb_allVCsp; vcp; vcp=vcp->nextp) {
- if (lsn == vcp->lsn) {
+ if (lsn == vcp->lsn && lana == vcp->lana) {
vcp->refCount++;
break;
}
vcp->refCount = 1;
vcp->tidCounter = 1;
vcp->fidCounter = 1;
+ vcp->uidCounter = 1; /* UID 0 is reserved for blank user */
vcp->nextp = smb_allVCsp;
smb_allVCsp = vcp;
lock_InitializeMutex(&vcp->mx, "vc_t mutex");
vcp->lsn = lsn;
+ vcp->lana = lana;
}
lock_ReleaseWrite(&smb_rctLock);
return vcp;
smb_user_t *smb_FindUID(smb_vc_t *vcp, unsigned short uid, int flags)
{
- smb_user_t *uidp;
+ smb_user_t *uidp = NULL;
lock_ObtainWrite(&smb_rctLock);
for(uidp = vcp->usersp; uidp; uidp = uidp->nextp) {
if (uid == uidp->userID) {
uidp->refCount++;
- break;
+#ifdef DEBUG_VERBOSE
+ {
+ HANDLE h; char *ptbuf[1],buf[132];
+ h = RegisterEventSource(NULL, "AFS Service - smb_FindUID (Find by UID)");
+ sprintf(buf, "VCP[%x] found-uid[%d] name[%s]",vcp,uidp->userID,(uidp->unp ? uidp->unp->name : ""));
+ ptbuf[0] = buf;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+ DeregisterEventSource(h);
+ }
+#endif
+ break;
}
}
if (!uidp && (flags & SMB_FLAG_CREATE)) {
vcp->usersp = uidp;
lock_InitializeMutex(&uidp->mx, "uid_t mutex");
uidp->userID = uid;
+#ifdef DEBUG_VERBOSE
+ {
+ HANDLE h; char *ptbuf[1],buf[132];
+ h = RegisterEventSource(NULL, "AFS Service - smb_FindUID (Find by UID)");
+ sprintf(buf, "VCP[%x] new-uid[%d] name[%s]",vcp,uidp->userID,(uidp->unp ? uidp->unp->name : ""));
+ ptbuf[0] = buf;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+ DeregisterEventSource(h);
+ }
+#endif
}
lock_ReleaseWrite(&smb_rctLock);
return uidp;
}
+smb_username_t *smb_FindUserByName(char *usern, char *machine, int flags)
+{
+ smb_username_t *unp= NULL;
+
+ lock_ObtainWrite(&smb_rctLock);
+ for(unp = usernamesp; unp; unp = unp->nextp) {
+ if (stricmp(unp->name, usern) == 0 &&
+ stricmp(unp->machine, machine) == 0) {
+ unp->refCount++;
+ break;
+ }
+ }
+ if (!unp && (flags & SMB_FLAG_CREATE)) {
+ unp = malloc(sizeof(*unp));
+ memset(unp, 0, sizeof(*unp));
+ unp->nextp = usernamesp;
+ unp->name = strdup(usern);
+ unp->machine = strdup(machine);
+ usernamesp = unp;
+ lock_InitializeMutex(&unp->mx, "username_t mutex");
+ }
+ lock_ReleaseWrite(&smb_rctLock);
+ return unp;
+}
+
+smb_user_t *smb_FindUserByNameThisSession(smb_vc_t *vcp, char *usern)
+{
+ smb_user_t *uidp= NULL;
+
+ lock_ObtainWrite(&smb_rctLock);
+ for(uidp = vcp->usersp; uidp; uidp = uidp->nextp) {
+ if (!uidp->unp)
+ continue;
+ if (stricmp(uidp->unp->name, usern) == 0) {
+ uidp->refCount++;
+#ifdef DEBUG_VERBOSE
+ {
+ HANDLE h; char *ptbuf[1],buf[132];
+ h = RegisterEventSource(NULL, "AFS Service - smb_FindUserByNameThisSession");
+ sprintf(buf, "VCP[%x] uid[%d] match-name[%s]",vcp,uidp->userID,usern);
+ ptbuf[0] = buf;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+ DeregisterEventSource(h);
+ }
+#endif
+ break;
+ } else
+ continue;
+ }
+ lock_ReleaseWrite(&smb_rctLock);
+ return uidp;
+}
void smb_ReleaseUID(smb_user_t *uidp)
{
smb_user_t *up;
osi_assert(up != NULL);
*lupp = up->nextp;
lock_FinalizeMutex(&uidp->mx);
- userp = uidp->userp; /* remember to drop ref later */
+ if (uidp->unp)
+ userp = uidp->unp->userp; /* remember to drop ref later */
}
lock_ReleaseWrite(&smb_rctLock);
if (userp) {
smbp = (smb_t *) inp;
uidp = smb_FindUID(vcp, smbp->uid, 0);
- if (!uidp) return NULL;
+ if ((!uidp) || (!uidp->unp))
+ return NULL;
lock_ObtainMutex(&uidp->mx);
- up = uidp->userp;
+ up = uidp->unp->userp;
cm_HoldUser(up);
lock_ReleaseMutex(&uidp->mx);
{
if (var = smb_stristr(p, VNUserName)) {
uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
- smb_subst(p, var, sizeof(VNUserName),
- uidp->name);
+ if (uidp && uidp->unp)
+ smb_subst(p, var, sizeof(VNUserName),
+ uidp->unp->name);
+ else
+ smb_subst(p, var, sizeof(VNUserName),
+ " ");
smb_ReleaseUID(uidp);
}
else if (var = smb_stristr(p, VNLCUserName)) {
uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
- strcpy(temp, uidp->name);
+ if (uidp && uidp->unp)
+ strcpy(temp, uidp->unp->name);
+ else strcpy(temp, " ");
_strlwr(temp);
smb_subst(p, var, sizeof(VNLCUserName), temp);
smb_ReleaseUID(uidp);
ncbp->ncb_length = extra; /* bytes to send */
ncbp->ncb_lsn = (unsigned char) vcp->lsn; /* vc to use */
- ncbp->ncb_lana_num = smb_LANadapter;
+ ncbp->ncb_lana_num = vcp->lana;
ncbp->ncb_command = NCBSEND; /* op means send data */
#ifndef DJGPP
ncbp->ncb_buffer = (char *) inp;/* packet */
ncbp->ncb_length = (unsigned short) finalCount;
ncbp->ncb_lsn = (unsigned char) vcp->lsn;
- ncbp->ncb_lana_num = smb_LANadapter;
+ ncbp->ncb_lana_num = vcp->lana;
ncbp->ncb_command = NCBSEND;
ncbp->ncb_buffer = rawBuf;
/* Raw Write */
code = smb_ReceiveCoreWriteRaw (vcp, inp, outp,
rwcp);
- else
- code = (*(dp->procp)) (vcp, inp, outp);
+ else {
+
+#ifdef DEBUG_VERBOSE
+ HANDLE h; char *ptbuf[1],buf[132];DWORD err;
+ h = RegisterEventSource(NULL, "AFS Server - Dispatch");
+ sprintf(buf,"%s vcp[%x] lana[%d] lsn[%d]",myCrt_Dispatch(inp->inCom),vcp,vcp->lana,vcp->lsn);
+ ptbuf[0] = buf;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+ DeregisterEventSource(h);
+#endif
+ code = (*(dp->procp)) (vcp, inp, outp);
+
+#ifdef DEBUG_VERBOSE
+ h = RegisterEventSource(NULL, "AFS Server - Dispatch return ");
+ sprintf(buf,"code[%d]",code-CM_ERROR_BASE);
+ if (code)
+ ptbuf[0] = buf;
+ else
+ ptbuf[0] = "code[0]";
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+ DeregisterEventSource(h);
+#endif
+ }
if (oldGen != sessionGen) {
#ifndef DJGPP
1005, NULL, 1, ncbp->ncb_length, ptbuf, smbp);
DeregisterEventSource(h);
#else /* DJGPP */
- osi_Log1(afsd_logp, "Pkt straddled session startup, "
- "ncb length %d", ncbp->ncb_length);
+ osi_Log1(afsd_logp, "Pkt straddled session startup, "
+ "ncb length %d", ncbp->ncb_length);
#endif /* !DJGPP */
}
}
#endif /* DJGPP */
ncbp->ncb_lsn = (unsigned char) LSNs[idx_session];
ncbp->ncb_command = NCBRECV | ASYNCH;
- ncbp->ncb_lana_num = smb_LANadapter;
+ ncbp->ncb_lana_num = lanas[idx_session];
#ifndef DJGPP
ncbp->ncb_buffer = (unsigned char *) bufs[idx_NCB];
ncbp->ncb_event = NCBevents[idx_NCB];
case NRC_SNUMOUT:
/* Client closed session */
dead_sessions[idx_session] = TRUE;
- vcp = smb_FindVC(ncbp->ncb_lsn, 0);
+ vcp = smb_FindVC(ncbp->ncb_lsn, 0, lanas[idx_session]);
/* Should also release vcp. Also, would do
* sanity check that all TID's are gone. */
if (dead_vcp)
loggedOut = 1;
loggedOutTime = vcp->logoffTime;
loggedOutName =
- strdup(vcp->justLoggedOut->name);
+ strdup(vcp->justLoggedOut->unp->name);
loggedOutUserp = vcp->justLoggedOut;
lock_ObtainWrite(&smb_rctLock);
loggedOutUserp->refCount++;
if (smb_concurrentCalls > smb_maxObsConcurrentCalls)
smb_maxObsConcurrentCalls = smb_concurrentCalls;
- vcp = smb_FindVC(ncbp->ncb_lsn, 0);
+ vcp = smb_FindVC(ncbp->ncb_lsn, 0, ncbp->ncb_lana_num);
vcp->errorCount = 0;
bufp = (struct smb_packet *) ncbp->ncb_buffer;
#ifdef DJGPP
rwevent = thrd_CreateEvent(NULL, FALSE, FALSE, NULL);
ncbp->ncb_command = NCBRECV | ASYNCH;
ncbp->ncb_lsn = (unsigned char) vcp->lsn;
- ncbp->ncb_lana_num = smb_LANadapter;
+ ncbp->ncb_lana_num = vcp->lana;
ncbp->ncb_buffer = rwc.buf;
ncbp->ncb_length = 65535;
ncbp->ncb_event = rwevent;
dos_ptr dos_ncb;
time_t now;
#endif /* DJGPP */
+ int lana = (int) parmp;
ncbp = GetNCB();
#ifdef DJGPP
#endif /* DJGPP */
while (1) {
+ memset(ncbp, 0, sizeof(NCB));
#ifdef DJGPP
/* terminate if shutdown flag is set */
if (smbShutdownFlag == 1)
strcpy(ncbp->ncb_callname, "*");
for(i=1; i<NCBNAMSZ; i++) ncbp->ncb_callname[i] = ' ';
- ncbp->ncb_lana_num = smb_LANadapter;
+ ncbp->ncb_lana_num = lana;
#ifndef DJGPP
code = Netbios(ncbp);
if (code != 0)
{
- fprintf(stderr, "NCBLISTEN lana=%d (smb_LANadapter=%d) "
- "failed with code %d\n",
- ncbp->ncb_lana_num, smb_LANadapter, code);
- osi_Log3(0, "NCBLISTEN lana=%d (smb_LANadapter=%d) "
- "failed with code %d",
- ncbp->ncb_lana_num, smb_LANadapter, code);
+ fprintf(stderr, "NCBLISTEN lana=%d failed with code %d\n",
+ ncbp->ncb_lana_num, code);
+ osi_Log2(0, "NCBLISTEN lana=%d failed with code %d",
+ ncbp->ncb_lana_num, code);
fprintf(stderr, "\nClient exiting due to network failure "
"(possibly due to power-saving mode)\n");
fprintf(stderr, "Please restart client.\n");
afs_exit(AFS_EXITCODE_NETWORK_FAILURE);
}
#endif /* !DJGPP */
+
osi_assert(code == 0);
/* check for remote conns */
flags |= SMB_VCFLAG_REMOTECONN;
osi_Log1(afsd_logp, "New session lsn %d", ncbp->ncb_lsn);
+ /* lock */
+ lock_ObtainMutex(&smb_ListenerLock);
/* New generation */
sessionGen++;
/* Log session startup */
+#ifdef NOSERVICE
+ fprintf(stderr, "New session(ncb_lsn,ncb_lana_num) %d,%d starting from host "
+ "%s\n",
+ ncbp->ncb_lsn,ncbp->ncb_lana_num, rname);
+#endif
if (reportSessionStartups) {
#ifndef DJGPP
HANDLE h;
1, 0, ptbuf, NULL);
DeregisterEventSource(h);
#else /* DJGPP */
- afsi_log("NCBLISTEN completed, call from %s",rname);
- osi_Log1(afsd_logp, "SMB session startup, %d ongoing o
-ps",
- ongoingOps);
- time(&now);
- fprintf(stderr, "%s: New session starting from host %s
-\n",
- asctime(localtime(&now)), rname);
- fflush(stderr);
+ afsi_log("NCBLISTEN completed, call from %s",rname);
+ osi_Log1(afsd_logp, "SMB session startup, %d ongoing ops",
+ ongoingOps);
+ time(&now);
+ fprintf(stderr, "%s: New session %d starting from host "
+ "%s\n",
+ asctime(localtime(&now)), ncbp->ncb_lsn, rname);
+ fflush(stderr);
#endif /* !DJGPP */
}
/* now ncbp->ncb_lsn is the connection ID */
- vcp = smb_FindVC(ncbp->ncb_lsn, SMB_FLAG_CREATE);
+ vcp = smb_FindVC(ncbp->ncb_lsn, SMB_FLAG_CREATE, ncbp->ncb_lana_num);
vcp->flags |= flags;
+ strcpy(vcp->rname, rname);
/* Allocate slot in session arrays */
/* Re-use dead session if possible, otherwise add one more */
}
}
LSNs[i] = ncbp->ncb_lsn;
+ lanas[i] = ncbp->ncb_lana_num;
+
if (i == numSessions) {
/* Add new NCB for new session */
InitNCBslot(numNCBs);
} else {
thrd_SetEvent(SessionEvents[i]);
}
+ /* unlock */
+ lock_ReleaseMutex(&smb_ListenerLock);
} /* dispatch while loop */
}
/* initialize Netbios */
void smb_NetbiosInit()
{
- NCB *ncbp;
+ NCB *ncbp;
#ifdef DJGPP
- dos_ptr dos_ncb;
+ dos_ptr dos_ncb;
#endif /* DJGPP */
- int i, lana, code;
- char s[100];
- int delname_tried=0;
- int len;
-
- /* setup the NCB system */
- ncbp = GetNCB();
+ int i, lana, code, l;
+ char s[100];
+ int delname_tried=0;
+ int len;
+ int lana_found = 0;
+
+ /* setup the NCB system */
+ ncbp = GetNCB();
#ifdef DJGPP
- dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
+ dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
#endif /* DJGPP */
#ifndef DJGPP
- /* reset the adaptor: in Win32, this is required for every process, and
+ if (smb_LANadapter == -1) {
+ ncbp->ncb_command = NCBENUM;
+ ncbp->ncb_buffer = &lana_list;
+ ncbp->ncb_length = sizeof(lana_list);
+ code = Netbios(ncbp);
+ if (code != 0) {
+ sprintf(s, "Netbios NCBENUM error code %d", code);
+ afsi_log(s);
+ osi_panic(s, __FILE__, __LINE__);
+ }
+ }
+ else {
+ lana_list.length = 1;
+ lana_list.lana[0] = smb_LANadapter;
+ }
+
+ for (i = 0; i < lana_list.length; i++) {
+ /* reset the adaptor: in Win32, this is required for every process, and
* acts as an init call, not as a real hardware reset.
*/
ncbp->ncb_command = NCBRESET;
ncbp->ncb_callname[0] = 100;
ncbp->ncb_callname[2] = 100;
- ncbp->ncb_lana_num = smb_LANadapter;
+ ncbp->ncb_lana_num = lana_list.lana[i];
code = Netbios(ncbp);
if (code == 0) code = ncbp->ncb_retcode;
- if (code != 0) {
- sprintf(s, "Netbios NCBRESET error code %d", code);
- afsi_log(s);
- osi_panic(s, __FILE__, __LINE__);
- }
+ if (code != 0) {
+ sprintf(s, "Netbios NCBRESET lana %d error code %d", lana_list.lana[i], code);
+ afsi_log(s);
+ lana_list.lana[i] = 255; /* invalid lana */
+ }
+ else {
+ sprintf(s, "Netbios NCBRESET lana %d succeeded", lana_list.lana[i]);
+ afsi_log(s);
+ }
+ }
+#else
+ /* for DJGPP, there is no NCBENUM and NCBRESET is a real reset. so
+ we will just fake the LANA list */
+ if (smb_LANadapter == -1) {
+ for (i = 0; i < 8; i++)
+ lana_list.lana[i] = i;
+ lana_list.length = 8;
+ }
+ else {
+ lana_list.length = 1;
+ lana_list.lana[0] = smb_LANadapter;
+ }
#endif /* !DJGPP */
- try_addname:
- /* and declare our name so we can receive connections */
- memset(ncbp, 0, sizeof(*ncbp));
- ncbp->ncb_lana_num = smb_LANadapter;
+ try_addname:
+ /* and declare our name so we can receive connections */
+ memset(ncbp, 0, sizeof(*ncbp));
+ len=lstrlen(smb_localNamep);
+ memset(smb_sharename,' ',NCBNAMSZ);
+ memcpy(smb_sharename,smb_localNamep,len);
+#if 0
+ /*ncbp->ncb_lana_num = smb_LANadapter;*/
+ strcpy(ncbp->ncb_name, smb_localNamep);
+ len = strlen(smb_localNamep);
+ for(i=len; i<NCBNAMSZ; i++) ncbp->ncb_name[i] = ' ';
+#endif
+ /* Keep the name so we can unregister it later */
+ for (l = 0; l < lana_list.length; l++) {
+ lana = lana_list.lana[l];
+
ncbp->ncb_command = NCBADDNAME;
- strcpy(ncbp->ncb_name, smb_localNamep);
- len = strlen(smb_localNamep);
- for(i=len; i<NCBNAMSZ; i++) ncbp->ncb_name[i] = ' ';
- /* Keep the name so we can unregister it later */
- memcpy(smb_sharename,ncbp->ncb_name,NCBNAMSZ);
- lana = smb_LANadapter;
-
- do { /* try multiple LANA numbers until we find one that works */
- ncbp->ncb_lana_num = lana;
+ ncbp->ncb_lana_num = lana;
+ memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ);
#ifndef DJGPP
- code = Netbios(ncbp);
+ code = Netbios(ncbp);
#else /* DJGPP */
- code = Netbios(ncbp, dos_ncb);
+ code = Netbios(ncbp, dos_ncb);
#endif /* !DJGPP */
- afsi_log("Netbios NCBADDNAME code=%d retcode=%d complete=%d",code,
- ncbp->ncb_retcode,ncbp->ncb_cmd_cplt);
- {
- char name[200];
- int i;
- for (i=0;i<NCBNAMSZ;++i)
- name[i] = ncbp->ncb_name[i];
- name[i] = '\0';
+ afsi_log("Netbios NCBADDNAME lana=%d code=%d retcode=%d complete=%d",
+ lana, code, ncbp->ncb_retcode,ncbp->ncb_cmd_cplt);
+ {
+ char name[NCBNAMSZ+1];
+ name[NCBNAMSZ]=0;
+ memcpy(name,ncbp->ncb_name,NCBNAMSZ);
afsi_log("Netbios NCBADDNAME added new name >%s<",name);
- }
+ }
- if (code == 0)
- {
- code = ncbp->ncb_retcode;
- smb_LANadapter = lana; /* correct LANA number */
- break;
- }
- else
- {
+ if (code == 0) code = ncbp->ncb_retcode;
+ if (code == 0) {
+ fprintf(stderr, "Netbios NCBADDNAME succeeded on lana %d\n", lana);
+#ifdef DJGPP
+ /* we only use one LANA with djgpp */
+ lana_list.lana[0] = lana;
+ lana_list.length = 1;
+#endif
+ }
+ else {
sprintf(s, "Netbios NCBADDNAME lana %d error code %d", lana, code);
afsi_log(s);
- if (code != NRC_BRIDGE) /* invalid LANA num */
- break;
- else
- lana = (lana + 1) % 8;
- }
- } while (lana != smb_LANadapter); /* quit when we loop back to orig. */
-
- if (code == NRC_DUPNAME)
- {
- /* Name already exists; try to delete it */
- memset(ncbp, 0, sizeof(*ncbp));
- ncbp->ncb_command = NCBDELNAME;
- memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ);
- ncbp->ncb_lana_num = smb_LANadapter;
+ fprintf(stderr, "Netbios NCBADDNAME lana %d error code %d\n", lana, code);
+ if (code == NRC_BRIDGE) { /* invalid LANA num */
+ lana_list.lana[l] = 255;
+ continue;
+ }
+ else if (code == NRC_DUPNAME) {
+ /* Name already exists; try to delete it */
+ memset(ncbp, 0, sizeof(*ncbp));
+ ncbp->ncb_command = NCBDELNAME;
+ memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ);
+ ncbp->ncb_lana_num = lana;
#ifndef DJGPP
- code = Netbios(ncbp);
+ code = Netbios(ncbp);
#else
- code = Netbios(ncbp, dos_ncb);
+ code = Netbios(ncbp, dos_ncb);
#endif /* DJGPP */
- if (code == 0) code = ncbp->ncb_retcode;
- if (code != 0) {
- fprintf(stderr, "Netbios NCBDELNAME error code %d", code);
- }
- fflush(stderr);
- if (code == 0 && !delname_tried)
- {
- delname_tried = 1;
- goto try_addname;
- }
+ if (code == 0) code = ncbp->ncb_retcode;
+ else
+ fprintf(stderr, "Netbios NCBDELNAME lana %d error code %d\n", lana, code);
+ fflush(stderr);
+ if (code != 0 || delname_tried) {
+ lana_list.lana[l] = 255;
+ }
+ else if (code == 0) {
+ if (!delname_tried) {
+ lana--;
+ delname_tried = 1;
+ continue;
+ }
+ }
+ }
+ else {
+ sprintf(s, "Netbios NCBADDNAME lana %d error code %d", lana, code);
+ afsi_log(s);
+ lana_list.lana[l] = 255; /* invalid lana */
+ osi_panic(s, __FILE__, __LINE__);
+ }
}
+ if (code == 0) {
+ lana_found = 1; /* at least one worked */
+#ifdef DJGPP
+ break;
+#endif
+ }
+ }
- if (code != 0)
- osi_panic(s, __FILE__, __LINE__);
+ osi_assert(lana_list.length >= 0);
+ if (!lana_found) {
+ sprintf(s, "No valid LANA numbers found!");
+ osi_panic(s, __FILE__, __LINE__);
+ }
- fprintf(stderr, "Using LAN Adapter %d\n", smb_LANadapter, code);
- afsi_log("Netbios NCBADDNAME lana=%d name number=%d", smb_LANadapter,
- ncbp->ncb_num);
-
- /* we're done with the NCB now */
- FreeNCB(ncbp);
+ /* we're done with the NCB now */
+ FreeNCB(ncbp);
}
void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt,
/* Raw I/O data structures */
lock_InitializeMutex(&smb_RawBufLock, "smb raw buffer lock");
+ lock_InitializeMutex(&smb_ListenerLock, "smb listener lock");
+
/* 4 Raw I/O buffers */
#ifndef DJGPP
smb_RawBufs = GlobalAlloc(GMEM_FIXED, 65536);
/* Start listeners, waiters, servers, and daemons */
- phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_Listener,
- NULL, 0, &lpid, "smb_Listener");
- osi_assert(phandle != NULL);
- thrd_CloseHandle(phandle);
+ for (i = 0; i < lana_list.length; i++) {
+ if (lana_list.lana[i] == 255) continue;
+ phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_Listener,
+ (void*)lana_list.lana[i], 0, &lpid, "smb_Listener");
+ osi_assert(phandle != NULL);
+ thrd_CloseHandle(phandle);
+ }
#ifndef DJGPP
phandle = thrd_Create(NULL, 65536, (ThreadFunc) smb_ClientWaiter,
/*fprintf(stderr, "NCBHANGUP session %d LSN %d\n", i, LSNs[i]);*/
ncbp->ncb_command = NCBHANGUP;
- ncbp->ncb_lana_num = smb_LANadapter;
+ ncbp->ncb_lana_num = lanas[i]; /*smb_LANadapter;*/
ncbp->ncb_lsn = LSNs[i];
code = Netbios(ncbp, dos_ncb);
/*fprintf(stderr, "returned from NCBHANGUP session %d LSN %d\n", i, LS
}
}
+#if 1
/* Delete Netbios name */
- ncbp->ncb_command = NCBDELNAME;
- memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ);
- ncbp->ncb_lana_num = smb_LANadapter;
- code = Netbios(ncbp, dos_ncb);
- if (code == 0) code = ncbp->ncb_retcode;
- if (code != 0) {
- fprintf(stderr, "Netbios NCBDELNAME error code %d", code);
- }
- fflush(stderr);
+ for (i = 0; i < lana_list.length; i++) {
+ if (lana_list.lana[i] == 255) continue;
+ ncbp->ncb_command = NCBDELNAME;
+ ncbp->ncb_lana_num = lana_list.lana[i];
+ memcpy(ncbp->ncb_name,smb_sharename,NCBNAMSZ);
+ code = Netbios(ncbp, dos_ncb);
+ if (code == 0) code = ncbp->ncb_retcode;
+ if (code != 0) {
+ fprintf(stderr, "Netbios NCBDELNAME lana %d error code %d",
+ ncbp->ncb_lana_num, code);
+ }
+ fflush(stderr);
+ }
+#endif
}
#endif /* DJGPP */
struct smb_fid *fidsp; /* the first child in the open file list */
struct smb_user *justLoggedOut; /* ready for profile upload? */
unsigned long logoffTime; /* tick count when logged off */
- struct cm_user *logonDLLUser; /* integrated logon user */
+ /*struct cm_user *logonDLLUser; /* integrated logon user */
unsigned char errorCount;
+ char rname[17];
+ int lana;
} smb_vc_t;
/* have we negotiated ... */
osi_mutex_t mx;
long userID; /* the session identifier */
struct smb_vc *vcp; /* back ptr to virtual circuit */
- struct cm_user *userp; /* CM user structure */
- char *name; /* user name */
+ struct smb_username *unp; /* user name struct */
} smb_user_t;
+typedef struct smb_username {
+ struct smb_username *nextp; /* next sibling */
+ long refCount; /* ref count */
+ long flags; /* flags; locked by mx */
+ osi_mutex_t mx;
+ struct cm_user *userp; /* CM user structure */
+ char *name; /* user name */
+ char *machine; /* machine name */
+} smb_username_t;
+
#define SMB_USERFLAG_DELETE 1 /* delete struct when ref count zero */
/* one per tree-connect */
/* flags */
long flags;
+
+ /* fid pointer */
+ struct smb_fid *fidp;
} smb_ioctl_t;
/* flags for smb_ioctl_t */
osi_queue_t q;
char *dptr; /* ptr to attr, time, data, sizel, sizeh */
cm_fid_t fid;
+ cm_dirEntry_t *dep; /* temp */
} smb_dirListPatch_t;
/* waiting lock list elements */
extern void smb_UnixTimeFromDosUTime(long *unixTimep, long dosUTime);
-extern smb_vc_t *smb_FindVC(unsigned short lsn, int flags);
+extern smb_vc_t *smb_FindVC(unsigned short lsn, int flags, int lana);\r
extern void smb_ReleaseVC(smb_vc_t *vcp);
#include "smb3.h"
#include "smb_ioctl.h"
#include "smb_iocons.h"
+\r
+cm_user_t *smb_FindOrCreateUser(smb_vc_t *vcp, char *usern);\r
#endif /* whole file */
* directory or online at http://www.openafs.org/dl/license10.html
*/
+//#define NOSERVICE 1
+
#include <afs/param.h>
#include <afs/stds.h>
cm_user_t *smb_GetTran2User(smb_vc_t *vcp, smb_tran2Packet_t *inp)
{
smb_user_t *uidp;
- cm_user_t *up;
+ cm_user_t *up = NULL;
uidp = smb_FindUID(vcp, inp->uid, 0);
if (!uidp) return NULL;
lock_ObtainMutex(&uidp->mx);
- up = uidp->userp;
- cm_HoldUser(up);
+ if (uidp->unp) {
+ up = uidp->unp->userp;
+ cm_HoldUser(up);
+ }
lock_ReleaseMutex(&uidp->mx);
smb_ReleaseUID(uidp);
long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
{
- char *tp;
- char *usern, *pwd, *pwdx;
- smb_user_t *uidp, *dead_uidp;
- unsigned short newUid;
- unsigned long caps;
- cm_user_t *userp;
- char *s1 = " ";
-
- /* Check for bad conns */
- if (vcp->flags & SMB_VCFLAG_REMOTECONN)
- return CM_ERROR_REMOTECONN;
-
- /* For NT LM 0.12 and up, get capabilities */
- if (vcp->flags & SMB_VCFLAG_USENT) {
- caps = smb_GetSMBParm(inp, 11);
- if (caps & 0x40)
- vcp->flags |= SMB_VCFLAG_STATUS32;
- /* for now, ignore other capability bits */
- }
-
- /* Parse the data */
- tp = smb_GetSMBData(inp, NULL);
- if (vcp->flags & SMB_VCFLAG_USENT)
- pwdx = smb_ParseString(tp, &tp);
- pwd = smb_ParseString(tp, &tp);
- usern = smb_ParseString(tp, &tp);
-
- /* Create a new UID and cm_user_t structure */
- userp = cm_NewUser();
- lock_ObtainMutex(&vcp->mx);
- newUid = vcp->uidCounter++;
- lock_ReleaseMutex(&vcp->mx);
-
- /* Create a new smb_user_t structure and connect them up */
- uidp = smb_FindUID(vcp, newUid, SMB_FLAG_CREATE);
- lock_ObtainMutex(&uidp->mx);
- uidp->userp = userp;
- uidp->name = strdup(usern);
- lock_ReleaseMutex(&uidp->mx);
- smb_ReleaseUID(uidp);
-
- if (dead_vcp) {
- dead_uidp = dead_vcp->usersp;
- while (dead_uidp) {
- if (dead_uidp->userp
- && strcmp(dead_uidp->name, usern) == 0)
- break;
- dead_uidp = dead_uidp->nextp;
- }
- }
-
- /* transfer tokens from dead vcp */
- if (dead_vcp && dead_uidp) {
- cm_user_t *dead_userp;
- s1 = ", tokens from terminated session";
- dead_userp = dead_uidp->userp;
- cm_ResetACLCache(dead_userp);
- userp->cellInfop = dead_userp->cellInfop;
- dead_userp->cellInfop = NULL;
- dead_vcp = NULL;
- }
-
- /* transfer tokens from integrated logon */
- if (vcp->logonDLLUser) {
- s1 = ", tokens from integrated logon";
- cm_ResetACLCache(vcp->logonDLLUser);
- userp->cellInfop = vcp->logonDLLUser->cellInfop;
- vcp->logonDLLUser->cellInfop = NULL;
- vcp->logonDLLUser = NULL;
- }
-
- /* transfer tokens for logoff profile upload */
- if (vcp->justLoggedOut) {
- cm_user_t *logout_userp;
- if (GetTickCount() - vcp->logoffTime <
- 1000 * smb_LogoffTransferTimeout
- && strcmp(vcp->justLoggedOut->name, usern) == 0) {
- s1 = ", tokens from logoff";
- logout_userp = vcp->justLoggedOut->userp;
- cm_ResetACLCache(logout_userp);
- userp->cellInfop = logout_userp->cellInfop;
- logout_userp->cellInfop = NULL;
+ char *tp;
+ char *usern, *pwd, *pwdx;
+ smb_user_t *uidp, *dead_uidp;
+ unsigned short newUid;
+ unsigned long caps;
+ cm_user_t *userp;
+ smb_username_t *unp;
+ char *s1 = " ";
+
+ /* Check for bad conns */
+ if (vcp->flags & SMB_VCFLAG_REMOTECONN)
+ return CM_ERROR_REMOTECONN;
+
+ /* For NT LM 0.12 and up, get capabilities */
+ if (vcp->flags & SMB_VCFLAG_USENT) {
+ caps = smb_GetSMBParm(inp, 11);
+ if (caps & 0x40)
+ vcp->flags |= SMB_VCFLAG_STATUS32;
+ /* for now, ignore other capability bits */
+ }
+
+ /* Parse the data */
+ tp = smb_GetSMBData(inp, NULL);
+ if (vcp->flags & SMB_VCFLAG_USENT)
+ pwdx = smb_ParseString(tp, &tp);
+ pwd = smb_ParseString(tp, &tp);
+ usern = smb_ParseString(tp, &tp);
+
+ if (strlen(usern)==0) {
+ /*return CM_ERROR_NOACCESS;*/
+ newUid = 0; /* always assign uid 0 for blank username */
+ uidp = smb_FindUID(vcp, newUid, SMB_FLAG_CREATE);
+#ifdef DEBUG_VERBOSE
+ {
+ HANDLE h; char *ptbuf[1],buf[132];
+ h = RegisterEventSource(NULL, "AFS Service - smb_ReceiveV3SessionSetupX");
+ sprintf(buf, "VCP[%x] lsn[%d] anonymous, uid[%d]",vcp,vcp->lsn,uidp->userID);
+ ptbuf[0] = buf;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+ DeregisterEventSource(h);
}
- vcp->justLoggedOut = NULL;
- }
- else if (loggedOut) {
- cm_user_t *logout_userp;
- if (GetTickCount() - loggedOutTime <
- 1000 * smb_LogoffTransferTimeout
- && strcmp(loggedOutName, usern) == 0) {
- s1 = ", tokens from logoff";
- logout_userp = loggedOutUserp->userp;
- cm_ResetACLCache(logout_userp);
- userp->cellInfop = logout_userp->cellInfop;
- logout_userp->cellInfop = NULL;
+#endif
+ smb_ReleaseUID(uidp);
+ goto done;
+ }
+
+ /* On Windows 2000, this function appears to be called more often than
+ it is expected to be called. This resulted in multiple smb_user_t
+ records existing all for the same user session which results in all
+ of the users tokens disappearing.
+
+ To avoid this problem, we look for an existing smb_user_t record
+ based on the users name, and use that one if we find it.
+ */
+
+ uidp = smb_FindUserByNameThisSession(vcp, usern);
+ if (uidp) { /* already there, so don't create a new one */
+ unp = uidp->unp;
+ userp = unp->userp;
+ newUid = (unsigned short)uidp->userID; /* For some reason these are different types!*/
+#ifdef DEBUG_VERBOSE
+ {
+ HANDLE h; char *ptbuf[1],buf[132];
+ h = RegisterEventSource(NULL, "AFS Service - smb_ReceiveV3SessionSetupX");
+ sprintf(buf,"FindUserByName:VCP[%x],Lana[%d],lsn[%d],userid[%d],name[%s]",vcp,vcp->lana,vcp->lsn,newUid,usern);
+ ptbuf[0] = buf;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+ DeregisterEventSource(h);
+ }
+#endif
+ smb_ReleaseUID(uidp);
+ }
+ else {
+ /* do a global search for the username/machine name pair */
+ unp = smb_FindUserByName(usern, vcp->rname, SMB_FLAG_CREATE);
+
+ /* Create a new UID and cm_user_t structure */
+ userp = unp->userp;
+ if (!userp)
+ userp = cm_NewUser();
+ lock_ObtainMutex(&vcp->mx);
+ newUid = vcp->uidCounter++;
+ lock_ReleaseMutex(&vcp->mx);
+
+ /* Create a new smb_user_t structure and connect them up */
+ lock_ObtainMutex(&unp->mx);
+ unp->userp = userp;
+ lock_ReleaseMutex(&unp->mx);
+
+ uidp = smb_FindUID(vcp, newUid, SMB_FLAG_CREATE);
+ lock_ObtainMutex(&uidp->mx);
+ uidp->unp = unp;
+#ifdef DEBUG_VERBOSE
+ {
+ HANDLE h; char *ptbuf[1],buf[132];
+ h = RegisterEventSource(NULL, "AFS Service - smb_ReceiveV3SessionSetupX");
+ sprintf(buf,"NewUser:VCP[%x],Lana[%d],lsn[%d],userid[%d],name[%s]",vcp,vcp->lana,vcp->lsn,newUid,usern);
+ ptbuf[0] = buf;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+ DeregisterEventSource(h);
}
- smb_ReleaseUID(loggedOutUserp);
- loggedOutUserp = NULL;
- free(loggedOutName);
- loggedOutName = NULL;
- loggedOut = 0;
- }
-
- /* Return UID to the client */
- ((smb_t *)outp)->uid = newUid;
- /* Also to the next chained message */
- ((smb_t *)inp)->uid = newUid;
-
- osi_Log3(afsd_logp, "SMB3 session setup name %s creating ID %d%s",
- osi_LogSaveString(afsd_logp, usern), newUid, osi_LogSaveString(afsd_logp, s1));
- smb_SetSMBParm(outp, 2, 0);
- smb_SetSMBDataLength(outp, 0);
- return 0;
+#endif
+ lock_ReleaseMutex(&uidp->mx);
+ smb_ReleaseUID(uidp);
+ }
+
+ done:
+ /* Return UID to the client */
+ ((smb_t *)outp)->uid = newUid;
+ /* Also to the next chained message */
+ ((smb_t *)inp)->uid = newUid;
+
+ osi_Log3(afsd_logp, "SMB3 session setup name %s creating ID %d%s",
+ osi_LogSaveString(afsd_logp, usern), newUid, osi_LogSaveString(afsd_logp, s1));
+ smb_SetSMBParm(outp, 2, 0);
+ smb_SetSMBDataLength(outp, 0);
+ return 0;
}
long smb_ReceiveV3UserLogoffX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
if (uidp) {
char *s1 = NULL, *s2 = NULL;
- /* Also, this is not logon session any more */
- if (uidp->userp == vcp->logonDLLUser) {
- s1 = ", was logon session";
- vcp->logonDLLUser = NULL;
- }
-
- /* But its tokens might be needed later */
- if (uidp->userp && !(uidp->userp->flags & CM_USERFLAG_WASLOGON)
- && smb_LogoffTokenTransfer) {
- s2 = ", pre-logout effect";
- vcp->justLoggedOut = uidp;
- vcp->logoffTime = GetTickCount();
- }
-
if (s2 == NULL) s2 = " ";
if (s1 == NULL) {s1 = s2; s2 = " ";}
osi_Log4(afsd_logp, "SMB3 user logoffX uid %d name %s%s%s",
uidp->userID,
- osi_LogSaveString(afsd_logp, uidp->name),
- s1, s2);
+ osi_LogSaveString(afsd_logp,
+ (uidp->unp) ? uidp->unp->name: " "), s1, s2);
lock_ObtainMutex(&uidp->mx);
uidp->flags |= SMB_USERFLAG_DELETE;
smb_FreeTran2Packet(outp);
return 0;
}
-
+
lock_ObtainMutex(&scp->mx);
code = cm_SyncOp(scp, NULL, userp, &req, 0,
CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
curPatchp->fid.volume = scp->fid.volume;
curPatchp->fid.vnode = ntohl(dep->fid.vnode);
curPatchp->fid.unique = ntohl(dep->fid.unique);
+
+ /* temp */
+ curPatchp->dep = dep;
}
if (searchFlags & 4)
{
lock_InitializeMutex(&smb_Dir_Watch_Lock, "Directory Watch List Lock");
}
+
+cm_user_t *smb_FindCMUserByName(/*smb_vc_t *vcp,*/ char *usern, char *machine)
+{
+ cm_user_t *userp;
+ /*int newUid;*/
+ smb_user_t *uidp;
+ smb_username_t *unp;
+
+ unp = smb_FindUserByName(usern, machine, SMB_FLAG_CREATE);
+ if (!unp->userp) {
+ lock_ObtainMutex(&unp->mx);
+ unp->userp = cm_NewUser();
+ lock_ReleaseMutex(&unp->mx);
+#ifdef DEBUG_VERBOSE
+ { //jimpeter
+ HANDLE h; char *ptbuf[1],buf[132];
+ h = RegisterEventSource(NULL, "AFS Service - smb_FindCMUserByName");
+ sprintf(buf,"New User name[%s] machine[%s]",usern,machine);
+ ptbuf[0] = buf;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+ DeregisterEventSource(h);
+ }
+#endif
+ }
+#ifdef DEBUG_VERBOSE
+ else { //jimpeter
+ HANDLE h; char *ptbuf[1],buf[132];
+ h = RegisterEventSource(NULL, "AFS Service - smb_FindCMUserByName");
+ sprintf(buf,"Found-name[%s] machine[%s]",usern,machine);
+ ptbuf[0] = buf;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, ptbuf, NULL);
+ DeregisterEventSource(h);
+ }
+#endif
+ return unp->userp;
+}
+
smb_ioctlProc_t *smb_ioctlProcsp[SMB_IOCTL_MAXPROCS];
-extern unsigned char smb_LANadapter;
+/*extern unsigned char smb_LANadapter;*/
+extern LANA_ENUM lana_list;
void smb_InitIoctl(void)
{
iop = malloc(sizeof(*iop));
memset(iop, 0, sizeof(*iop));
fidp->ioctlp = iop;
+ iop->fidp = fidp;
}
if (prefix) {
copyPrefix = cm_GetSpace();
return code;
}
- if (iop->flags & SMB_IOCTLFLAG_LOGON) {
- vcp->logonDLLUser = userp;
- userp->flags |= CM_USERFLAG_WASLOGON;
- }
-
leftToCopy = (iop->outDatap - iop->outAllocp) - iop->outCopied;
if (count > leftToCopy) count = leftToCopy;
smb_user_t *uidp;
uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
- osi_Log3(afsd_logp, "Ioctl uid %d user %x name %s",
- uidp->userID, userp,
- osi_LogSaveString(afsd_logp, uidp->name));
+ if (uidp && uidp->unp)
+ osi_Log3(afsd_logp, "Ioctl uid %d user %x name %s",
+ uidp->userID, userp,
+ osi_LogSaveString(afsd_logp, uidp->unp->name));
+ else
+ osi_Log2(afsd_logp, "Ioctl uid %d user %x no name",
+ uidp->userID, userp);
smb_ReleaseUID(uidp);
}
return code;
}
- if (iop->flags & SMB_IOCTLFLAG_LOGON) {
- vcp->logonDLLUser = userp;
- userp->flags |= CM_USERFLAG_WASLOGON;
- }
-
leftToCopy = (iop->outDatap - iop->outAllocp) - iop->outCopied;
if (count > leftToCopy) count = leftToCopy;
smb_user_t *uidp;
uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
- osi_Log3(afsd_logp, "Ioctl uid %d user %x name %s",
- uidp->userID, userp,
- osi_LogSaveString(afsd_logp, uidp->name));
+ if (uidp && uidp->unp)
+ osi_Log3(afsd_logp, "Ioctl uid %d user %x name %s",
+ uidp->userID, userp,
+ osi_LogSaveString(afsd_logp, uidp->unp->name));
+ else
+ osi_Log2(afsd_logp, "Ioctl uid %d user %x no name",
+ uidp->userID, userp);
smb_ReleaseUID(uidp);
}
return code;
}
- if (iop->flags & SMB_IOCTLFLAG_LOGON) {
- vcp->logonDLLUser = userp;
- userp->flags |= CM_USERFLAG_WASLOGON;
- }
-
leftToCopy = (iop->outDatap - iop->outAllocp) - iop->outCopied;
ncbp = outp->ncbp;
ncbp->ncb_length = (unsigned short) leftToCopy;
ncbp->ncb_lsn = (unsigned char) vcp->lsn;
ncbp->ncb_command = NCBSEND;
- ncbp->ncb_lana_num = smb_LANadapter;
+ /*ncbp->ncb_lana_num = smb_LANadapter;*/
+ ncbp->ncb_lana_num = vcp->lana;
#ifndef DJGPP
ncbp->ncb_buffer = iop->outCopied + iop->outAllocp;
if not exist "Registry Entries" mkdir "Registry Entries"
if not exist "Script Files" mkdir "Script Files"
if not exist "Setup Files" mkdir "Setup Files"
-
-if not exist "Setup Files\Uncompressed Files" mkdir "Setup Files\Uncompressed Files"
-if not exist "Setup Files\Uncompressed Files\Language Independent" mkdir "Setup Files\Uncompressed Files\Language Independent"
-if not exist "Setup Files\Uncompressed Files\Language Independent\OS Independent" mkdir "Setup Files\Uncompressed Files\Language Independent\OS Independent"
-if not exist "Setup Files\Compressed Files" mkdir "Setup Files\Compressed Files"
-if not exist "Setup Files\Compressed Files\Language Independent" mkdir "Setup Files\Compressed Files\Language Independent"
-if not exist "Setup Files\Compressed Files\Language Independent\OS Independent" mkdir "Setup Files\Compressed Files\Language Independent\OS Independent"
-
+\r
+set sub1=Uncompressed Files\r
+call :gencomp\r
+set sub1=Compressed Files\r
+call :gencomp\r
+goto shell\r
+\r
+:gencomp\r
+if not exist "Setup Files\%sub1%" mkdir "Setup Files\%sub1%"\r
+set sub2=Language Independent\r
+call :gencomp2\r
+set sub2=0009-English\r
+call :gencomp2\r
+set sub2=0007-German\r
+call :gencomp2\r
+set sub2=0011-Japanese\r
+call :gencomp2\r
+set sub2=0012-Korean\r
+call :gencomp2\r
+set sub2=0416-Portuguese (Brazilian)\r
+call :gencomp2\r
+set sub2=0404-Chinese (Taiwan)\r
+call :gencomp2\r
+set sub2=000a-Spanish\r
+call :gencomp2\r
+set sub2=0804-Chinese (PRC)\r
+call :gencomp2\r
+goto :eof\r
+\r
+:gencomp2\r
+rem echo ]%sub1%] ]%sub2%]\r
+if not exist "Setup Files\%sub1%\%sub2%" mkdir "Setup Files\%sub1%\%sub2%"
+if not exist "Setup Files\%sub1%\%sub2%\OS Independent" mkdir "Setup Files\%sub1%\%sub2%\OS Independent"
+if not exist "Setup Files\%sub1%\%sub2%\Intel 32" mkdir "Setup Files\%sub1%\%sub2%\Intel 32"
+goto :eof\r
+\r
+:shell\r
if not exist "Shell Objects" mkdir "Shell Objects"
if not exist "String Tables" mkdir "String Tables"
if not exist "String Tables\0009-English" mkdir "String Tables\0009-English"
if not exist "String Tables\000a-Spanish" mkdir "String Tables\000a-Spanish"
if not exist "Text Substitutions" mkdir "Text Substitutions"
-
+:eof
\ No newline at end of file
---FileGroup---=
HKLM0=Software\TransarcCorporation\AFS Client\CurrentVersion
HKLM1=Software\TransarcCorporation\AFS Client
-HKLM2=Software\TransarcCorporation\AFS Client\3.6
+HKLM2=Software\TransarcCorporation\AFS Client\1.0 4.01
HKLM3=SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon
HKCR0=CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}
HKLM4=SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters
HKLM5=SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider
HKCR2=*\shellex\ContextMenuHandlers\AFS Client Shell Extension
HKCR3=FOLDER\shellex\ContextMenuHandlers\AFS Client Shell Extension
+HKLM6=SYSTEM\CurrentControlSet\Services\NetBT\Parameters\r
[Client:HKCR:*\shellex\ContextMenuHandlers\AFS Client Shell Extension]
---Comment---=
HKLM0=Software\TransarcCorporation\AFS Server\CurrentVersion
HKLM1=System\CurrentControlSet\Services\EventLog\Application\AFS Service
HKLM2=Software\TransarcCorporation\AFS Server
-HKLM3=Software\TransarcCorporation\AFS Server\3.6
+HKLM3=Software\TransarcCorporation\AFS Server\1.0 4.01
[WinNT_Client_NoUninstall:HKLM:SOFTWARE\Microsoft\Windows NT\CurrentVersion\File Manager\AddOns]
---Comment---=
---FileGroup---=
HKLM0=Software\TransarcCorporation\AFS Control Center\CurrentVersion
HKLM1=Software\TransarcCorporation\AFS Control Center
-HKLM2=Software\TransarcCorporation\AFS Control Center\3.6
+HKLM2=Software\TransarcCorporation\AFS Control Center\1.0 4.01
-[Client:HKLM:Software\TransarcCorporation\AFS Client\3.6]
-PatchLevel=N,0
-BetaLevel=N,0
+[Client:HKLM:Software\TransarcCorporation\AFS Client\1.0 4.01]
+PatchLevel=N,401
+BetaLevel=N,1
Revision=N,0
---Comment---=
(Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
Title=S,<CLIENT_TITLE>
InstallDateString=S,<INSTALL_DATE>
PathName=S,<TARGETDIR>\Client
Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
Description=S,<CLIENT_DESC>
[Client_NoUninstall]
(Default)=S,
Gateway=S,
-[Control_Center:HKLM:Software\TransarcCorporation\AFS Control Center\3.6]
-PatchLevel=N,0
-BetaLevel=N,0
+[Control_Center:HKLM:Software\TransarcCorporation\AFS Control Center\1.0 4.01]
+PatchLevel=N,401
+BetaLevel=N,1
Revision=N,0
---Comment---=
(Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
InstallDateString=S,<INSTALL_DATE>
PathName=S,<TARGETDIR>\Control Center
Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
Description=S,AFS Control Center for Windows NT
[Client_NoUninstall:HKLM:SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved]
(Default)=S,
[Control_Center:HKLM:Software\TransarcCorporation\AFS Control Center\CurrentVersion]
-PatchLevel=N,0
-BetaLevel=N,0
+PatchLevel=N,401
+BetaLevel=N,1
Revision=N,0
---Comment---=
(Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
InstallDateString=S,<INSTALL_DATE>
PathName=S,<TARGETDIR>\Control Center
Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
Description=S,AFS Control Center for Windows NT
[Light_Client]
---FileGroup---=
HKLM0=Software\TransarcCorporation\AFS Supplemental Documentation\CurrentVersion
HKLM1=Software\TransarcCorporation\AFS Supplemental Documentation
-HKLM2=Software\TransarcCorporation\AFS Supplemental Documentation\3.6
+HKLM2=Software\TransarcCorporation\AFS Supplemental Documentation\1.0 4.01
[Data]
Set0=Server
Set7=Docs
[Client:HKLM:Software\TransarcCorporation\AFS Client\CurrentVersion]
-PatchLevel=N,0
-BetaLevel=N,0
+PatchLevel=N,401
+BetaLevel=N,1
Revision=N,0
---Comment---=
(Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
Title=S,<CLIENT_TITLE>
InstallDateString=S,<INSTALL_DATE>
PathName=S,<TARGETDIR>\Client
Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
Description=S,<CLIENT_DESC>
[Full_Client]
HKLM0=SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters
[Docs:HKLM:Software\TransarcCorporation\AFS Supplemental Documentation\CurrentVersion]
-PatchLevel=N,0
-BetaLevel=N,0
+PatchLevel=N,401
+BetaLevel=N,1
Revision=N,0
---Comment---=
(Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
InstallDateString=S,<INSTALL_DATE>
PathName=S,<TARGETDIR>\Documentation
Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
Description=S,AFS System Administration Documentation
-[Server:HKLM:Software\TransarcCorporation\AFS Server\3.6]
-PatchLevel=N,0
-BetaLevel=N,0
+[Server:HKLM:Software\TransarcCorporation\AFS Server\1.0 4.01]
+PatchLevel=N,401
+BetaLevel=N,1
Revision=N,0
---Comment---=
(Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
InstallDateString=S,<INSTALL_DATE>
PathName=S,<TARGETDIR>\Server
Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
Description=S,AFS Server for Windows NT
[Client:HKLM:SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider]
---FileGroup---=
HKLM0=SOFTWARE\Microsoft\Windows NT\CurrentVersion\File Manager\AddOns
-[Docs:HKLM:Software\TransarcCorporation\AFS Supplemental Documentation\3.6]
-PatchLevel=N,0
-BetaLevel=N,0
+[Docs:HKLM:Software\TransarcCorporation\AFS Supplemental Documentation\1.0 4.01]
+PatchLevel=N,401
+BetaLevel=N,1
Revision=N,0
---Comment---=
(Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
InstallDateString=S,<INSTALL_DATE>
PathName=S,<TARGETDIR>\Documentation
Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
Description=S,AFS System Administration Documentation
[General]
(Default)=S,{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}
[Server:HKLM:Software\TransarcCorporation\AFS Server\CurrentVersion]
-PatchLevel=N,0
-BetaLevel=N,0
+PatchLevel=N,401
+BetaLevel=N,1
Revision=N,0
---Comment---=
(Default)=S,
-MajorVersion=N,3
+MajorVersion=N,1
InstallDateString=S,<INSTALL_DATE>
PathName=S,<TARGETDIR>\Server
Software Type=S,File System
-MinorVersion=N,6
+MinorVersion=N,0
ReleaseType=S,<RELEASE_TYPE>
-VersionString=S,3.6
+VersionString=S,1.0 4.01
Description=S,AFS Server for Windows NT
[Client:HKCR:CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}]
echo [TopDir] > Client_System32_Files.fgl
echo file0=%IS5_DEST%\root.client\usr\vice\etc\afs_cpa.cpl >> Client_System32_Files.fgl
echo file1=%MSVCDIR%\REDIST\Msvcrt.dll >> Client_System32_Files.fgl
-echo file2=%SYSTEMROOT%\system32\Msvcrtd.dll >> Client_System32_Files.fgl
-echo file3=%MSVCDIR%\REDIST\Mfc42.dll >> Client_System32_Files.fgl
-echo file4=%SYSTEMROOT%\system32\mfc42d.dll >> Client_System32_Files.fgl
-echo file5=%SYSTEMROOT%\system32\mfco42d.dll >> Client_System32_Files.fgl
+echo file2=%MSVCDIR%\REDIST\Mfc42.dll >> Client_System32_Files.fgl
echo. >> Client_System32_Files.fgl
echo [General] >> Client_System32_Files.fgl
echo Type=FILELIST >> Client_System32_Files.fgl
echo [TopDir] > Light_Client_System32_Files.fgl
echo file0=%MSVCDIR%\REDIST\Msvcrt.dll >> Light_Client_System32_Files.fgl
-echo file1=%SYSTEMROOT%\system32\Msvcrtd.dll >> Light_Client_System32_Files.fgl
-echo file2=%MSVCDIR%\REDIST\Mfc42.dll >> Light_Client_System32_Files.fgl
-echo file3=%SYSTEMROOT%\system32\mfc42d.dll >> Light_Client_System32_Files.fgl
-echo file4=%SYSTEMROOT%\system32\mfco42d.dll >> Light_Client_System32_Files.fgl
-echo file5=%IS5_DEST%\root.client\usr\vice\etc\afs_cpa.cpl >> Light_Client_System32_Files.fgl
+echo file1=%MSVCDIR%\REDIST\Mfc42.dll >> Light_Client_System32_Files.fgl
+echo file2=%IS5_DEST%\root.client\usr\vice\etc\afs_cpa.cpl >> Light_Client_System32_Files.fgl
echo. >> Light_Client_System32_Files.fgl
echo [General] >> Light_Client_System32_Files.fgl
echo Type=FILELIST >> Light_Client_System32_Files.fgl
echo [TopDir] > Light95_Client_System32_Files.fgl
echo file0=%MSVCDIR%\REDIST\Msvcrt.dll >> Light95_Client_System32_Files.fgl
-echo file1=%SYSTEMROOT%\system32\Msvcrtd.dll >> Light95_Client_System32_Files.fgl
-echo file2=%MSVCDIR%\REDIST\Mfc42.dll >> Light95_Client_System32_Files.fgl
-echo file3=%SYSTEMROOT%\system32\mfc42d.dll >> Light95_Client_System32_Files.fgl
-echo file4=%SYSTEMROOT%\system32\mfco42d.dll >> Light95_Client_System32_Files.fgl
-echo file5=%IS5_DEST%\root.client\usr\vice\etc\afs_cpa.cpl >> Light95_Client_System32_Files.fgl
+echo file1=%MSVCDIR%\REDIST\Mfc42.dll >> Light95_Client_System32_Files.fgl
+echo file2=%IS5_DEST%\root.client\usr\vice\etc\afs_cpa.cpl >> Light95_Client_System32_Files.fgl
echo. >> Light95_Client_System32_Files.fgl
echo [General] >> Light95_Client_System32_Files.fgl
echo Type=FILELIST >> Light95_Client_System32_Files.fgl
echo [TopDir] > Server_System32_Files.fgl
echo file0=%IS5_DEST%\root.server\usr\afs\bin\afsserver.cpl >> Server_System32_Files.fgl
echo file1=%MSVCDIR%\REDIST\Msvcrt.dll >> Server_System32_Files.fgl
-echo file2=%SYSTEMROOT%\system32\Msvcrtd.dll >> Server_System32_Files.fgl
echo. >> Server_System32_Files.fgl
echo [General] >> Server_System32_Files.fgl
echo Type=FILELIST >> Server_System32_Files.fgl
echo [TopDir] > Control_Center_System32_Files.fgl
echo file0=%IS5_DEST%\root.client\usr\vice\etc\afs_cpa.cpl >> Control_Center_System32_Files.fgl
echo file1=%MSVCDIR%\REDIST\Msvcrt.dll >> Control_Center_System32_Files.fgl
-echo file2=%SYSTEMROOT%\system32\Msvcrtd.dll >> Control_Center_System32_Files.fgl
echo. >> Control_Center_System32_Files.fgl
echo [General] >> Control_Center_System32_Files.fgl
echo Type=FILELIST >> Control_Center_System32_Files.fgl
rem Trad_Chinese
set FILEGROUP=Release_Notes_Trad_Chinese_Files.fgl
set IS5_DOC=%IS5_DOCROOT%\install\Documentation\zh_TW
-call :Generate_Release_Notes_File_Group
-
-rem Simp_Chinese
-set FILEGROUP=Release_Notes_Simp_Chinese_Files.fgl
-set IS5_DOC=%IS5_DOCROOT%\install\Documentation\zh_CN
-call :Generate_Release_Notes_File_Group
+call :Generate_Release_Notes_File_Group\r
+\r
+rem Simp_Chinese\r
+set FILEGROUP=Release_Notes_Simp_Chinese_Files.fgl\r
+set IS5_DOC=%IS5_DOCROOT%\install\Documentation\zh_CN\r
+call :Generate_Release_Notes_File_Group\r
rem German
set FILEGROUP=Release_Notes_German_Files.fgl
rem English
set FILEGROUP=Install_Guide_English_Files.fgl
-set IS5_DOC=%IS5_DOCROOT%\install\Documentation\en_US\Html
-call :Generate_Install_Guide_File_Group
+set IS5_DOC=%IS5_DOCROOT%\install\Documentation\en_US\Html\r
+call :Generate_Install_Guide_File_Group\r
rem Japanese
set FILEGROUP=Install_Guide_Japanese_Files.fgl
rem Simp_Chinese
set FILEGROUP=Install_Guide_Simp_Chinese_Files.fgl
-set IS5_DOC=%IS5_DOCROOT%\install\Documentation\zh_CN\Html
+set IS5_DOC=%IS5_DOCROOT%\install\Documentation\zh_CN\Html\r
call :Generate_Install_Guide_File_Group
-
+\r
rem German
set FILEGROUP=Install_Guide_German_Files.fgl
set IS5_DOC=%IS5_DOCROOT%\install\Documentation\de_DE\Html
set FILEGROUP=Install_Guide_Portuguese_Files.fgl
set IS5_DOC=%IS5_DOCROOT%\install\Documentation\pt_BR\Html
call :Generate_Install_Guide_File_Group
-
+\r
goto Sys_Admin_Guide_Files
-:Generate_Install_Guide_File_Group
+:Generate_Install_Guide_File_Group\r
echo [TopDir] > %FILEGROUP%
echo file0=%IS5_DOC%\InstallGd\awqbg000.htm >> %FILEGROUP%
echo file1=%IS5_DOC%\InstallGd\awqbg002.htm >> %FILEGROUP%
set IS5_DOC=%IS5_DOCROOT%\install\Documentation\ko_KR\Html
call :Generate_Doc_Misc_File_Group
copy %AFSROOT%\src\WINNT\license\lang\%IS5_LANG%.rtf %AFSROOT%\src\WINNT\install\InstallShield5\lang\%IS5_LANG%\license.rtf
-
+\r
rem Trad_Chinese
set FILEGROUP=Doc_Misc_Trad_Chinese_Files.fgl
set IS5_LANG=zh_TW
set IS5_DOC=%IS5_DOCROOT%\install\Documentation\zh_TW\Html
call :Generate_Doc_Misc_File_Group
-copy %AFSROOT%\src\WINNT\license\lang\%IS5_LANG%.rtf %AFSROOT%\src\WINNT\install\InstallShield5\lang\%IS5_LANG%\license.rtf
-
+copy %AFSROOT%\src\WINNT\license\lang\%IS5_LANG%.rtf %AFSROOT%\src\WINNT\install\InstallShield5\lang\%IS5_LANG%\license.rtf\r
+\r
rem Simp_Chinese
set FILEGROUP=Doc_Misc_Simp_Chinese_Files.fgl
set IS5_LANG=zh_CN
set IS5_DOC=%IS5_DOCROOT%\install\Documentation\zh_CN\Html
call :Generate_Doc_Misc_File_Group
copy %AFSROOT%\src\WINNT\license\lang\%IS5_LANG%.rtf %AFSROOT%\src\WINNT\install\InstallShield5\lang\%IS5_LANG%\license.rtf
-
+\r
rem German
set FILEGROUP=Doc_Misc_German_Files.fgl
set IS5_LANG=de_DE
goto Doc_Files
-:Generate_Doc_Misc_File_Group
+:Generate_Doc_Misc_File_Group\r
echo [TopDir] > %FILEGROUP%
echo file0=%IS5_DOC%\banner.gif >> %FILEGROUP%
echo file1=%IS5_DOC%\books.gif >> %FILEGROUP%
echo file1=%IS5_INCL%\afs\debug.h >> Client_Afs_Header_Files.fgl
echo file2=%IS5_INCL%\afs\param.h >> Client_Afs_Header_Files.fgl
echo file3=%IS5_INCL%\afs\afs_sysnames.h >> Client_Afs_Header_Files.fgl
-echo file4=%IS5_INCL%\afs\bnode.h >> Client_Afs_Header_Files.fgl
+echo file4=%IS5_INCL%\afs\permit_xprt.h >> Client_Afs_Header_Files.fgl
echo file5=%IS5_INCL%\afs\stds.h >> Client_Afs_Header_Files.fgl
echo file6=%IS5_INCL%\afs\icl.h >> Client_Afs_Header_Files.fgl
echo file7=%IS5_INCL%\afs\procmgmt.h >> Client_Afs_Header_Files.fgl
echo file88=%IS5_INCL%\afs\volint.h >> Client_Afs_Header_Files.fgl
echo file89=%IS5_INCL%\afs\fs_stats.h >> Client_Afs_Header_Files.fgl
echo file90=%IS5_INCL%\afs\bosint.h >> Client_Afs_Header_Files.fgl
+echo file91=%IS5_INCL%\afs\bnode.h >> Client_Afs_Header_Files.fgl
echo. >> Client_Afs_Header_Files.fgl
echo [General] >> Client_Afs_Header_Files.fgl
echo Type=FILELIST >> Client_Afs_Header_Files.fgl
echo Type=FILELIST >> Client_Sample_Files.fgl
echo Version=1.00.000 >> Client_Sample_Files.fgl
+:EOF\r
CompileScript.bat
build:
- BuildSetup.bat
- xcopy/s/e "Media\Transarc AFS\Disk Images\disk1\*.*" $(DESTDIR)\WinInstall
- copy AFS_component_version_number.txt $(DESTDIR)\WinInstall\Version.txt
- del /q "Media\Transarc AFS\Disk Images\disk1\*.*"
+ BuildSetup.bat\r
+ xcopy/s/e/y "Media\Transarc AFS\Disk Images\disk1\*.*" $(DESTDIR)\WinInstall
+ copy AFS_component_version_number.txt $(DESTDIR)\WinInstall\Version.txt\r
+ $(DEL) /q "Media\Transarc AFS\Disk Images\disk1\*.*"
+!IF ((EXIST("$(ISWEB)")) &&("$(ISWEB)"!=""))\r
+! IF (!EXIST($(DESTDIR)\Wininstall\PackageWeb))
+ $(MKDIR) $(DESTDIR)\Wininstall\PackageWeb
+! ENDIF
+ $(DEL) /q $(DESTDIR)\Wininstall\PackageWeb\*.*\r
+ $(ISWEB)\Pftwwiz.exe $(AFSROOT)\src\winnt\install\InstallShield5\PackageWeb.pfw -s -a \r
+!ENDIF\r
install: prep build
-# This file must change to specify a cell.
-# The "511.01.01.01" represents an IP address.
>PutCellNameHere # CellName Comment
511.01.01.01 #DBServerMachineName1
511.02.02.02 #DBServerMachineName2
NOTHING_SELECTED_MSG=You must select something to install before continuing.
DOWNGRADE_LIGHT_CLIENT_MSG=Downgrade AFS Light Client
SETUP_FINISHED_MSG=Setup has finished installing AFS® for Windows on your computer.
-TITLE_MAIN=AFS® for Windows 3.6
-SEVERE_DIALOG_TITLE=AFS® for Windows
+TITLE_MAIN=Open AFS for Windows 1.0 4.01
+SEVERE_DIALOG_TITLE=Open AFS for Windows
UPGRADE_CLIENT_MSG=Upgrade AFS Client
-PRODUCT_VERSION_MINOR=6
+PRODUCT_VERSION_MINOR=0
CONFIGURING_AFS_CLIENT_SERVICE=Configuring the AFS Client service
PRODUCT_NAME_CC=AFS Control Center
PRODUCT_NAME_SERVER=AFS Server
UPGRADE_CC_MSG=Upgrade AFS Control Center
DOWNGRADE_SERVER_MSG=Downgrade AFS Server
-UNINST_DISPLAY_NAME_LIGHT_CLIENT=AFS Light 3.6
+UNINST_DISPLAY_NAME_LIGHT_CLIENT=AFS Light 1.0 4.01
PRODUCT_NAME_LIGHT_CLIENT=AFS Light
ERROR_COMPONENT=Component:
COMPANY_NAME=TransarcCorporation
REINSTALL_CLIENT_MSG=Reinstall AFS Client
DOWNGRADE_CC_MSG=Downgrade AFS Control Center
-UNINST_DISPLAY_NAME_DOCS=AFS Supplemental Documentation 3.6
+UNINST_DISPLAY_NAME_DOCS=AFS Supplemental Documentation 1.0 4.01
UNINST_KEY_SERVER=AFS Server
VIEW_README_PROMPT_MSG=View the readme file
INSTALL_LIGHT_CLIENT_MSG=AFS Light Client
-PRODUCT_VERSION_TITLE=3.6
-UNINST_DISPLAY_NAME_CC=AFS Control Center 3.6
+PRODUCT_VERSION_TITLE=1.0 4.01
+UNINST_DISPLAY_NAME_CC=AFS Control Center 1.0 4.01
ERROR_FILEGROUP=File Group:
ERROR_MOVEDATA=An error occurred during the move data process: %d
CONFIGURING_AFS_SERVER_SERVICE=Configuring the AFS Server service
CLIENT_DESC=AFS Client
SET_NETWORK_PROVIDER_ERROR=Unable to configure the AFS Client as a Network Provider.
-PRODUCT_VERSION_MAJOR=3
-UNINST_DISPLAY_NAME_SERVER=AFS Server 3.6
+PRODUCT_VERSION_MAJOR=1
+UNINST_DISPLAY_NAME_SERVER=AFS Server 1.0 4.01
SETUPUTILS_NOT_FOUND=The file InstallUtils.dll could not be loaded. Setup cannot continue.
LIGHT_CLIENT_ALREADY_INSTALLED_MSG=AFS Light is already installed on this computer.
SETUP_TYPE_MSG=Select the AFS® for Windows products that you wish to install:
UNINST_KEY_CLIENT=AFS Client
UPGRADE_DOCS_MSG=Upgrade AFS Supplemental Documentation
DOWNGRADE_PREP_MSG=Preparing to downgrade the %s. Please wait...this may be a lengthy process.
-PRODUCT_VERSION_PATCH_LEVEL=0
+PRODUCT_VERSION_PATCH_LEVEL=401
NON_UPGRADABLE_SOFTWARE_INSTALLED_ERROR_MSG=Non-upgradable versions of this product are installed on your computer. These \nversions must be uninstalled before the current versions can be installed.
CANT_INSTALL_BOTH_CLIENTS_MSG=Please select only one of the AFS Clients to install. You cannot install both.
UNINST_KEY_LIGHT_CLIENT=AFS Light
UPGRADE_LIGHT_CLIENT_MSG=Upgrade AFS Light Client
UNINST_KEY_DOCS=AFS Supplemental Documentation
-UNINST_DISPLAY_NAME_CLIENT=AFS Client 3.6
+UNINST_DISPLAY_NAME_CLIENT=AFS Client 1.0 4.01
REINSTALL_DOCS_MSG=Reinstall AFS Supplemental Documentation
UPGRADE_PREP_MSG=Preparing to upgrade the %s. Please wait...this may be a lengthy process.
MUST_BE_AN_ADMIN_MSG=You must be a member of the local Administrators group on this Windows system in order to install this product.
////////////////////////////////////////////////////////////////////////////////
//
-// Copyright (C) 1998 Transarc Corporation.
+// Copyright (C) 1998 OpenAFS
// All rights reserved.
//
//
#include "sdlang.h"
#include "sddialog.h"
+
////////////////////// string defines ////////////////////////////
// If the user places a file with this name in the same directory as
///////////////////////////////////////////////////////////////////////////////
function AddPath(szPath)
begin
- LongPathToShortPath(szPath);
-
- if (AddToPath(szPath) < 0) then
- ShowError(@ADD_PATH_ERROR, WARNING);
+ LongPathToShortPath(szPath);
+ if (bWin98 || bWin95) then
+ if (EzBatchAddPath ("Path", szPath, "", AFTER) < 0) then
+ ShowError(@ADD_PATH_ERROR, WARNING);
+ endif;
+ else
+ if (AddToPath(szPath) < 0) then
+ ShowError(@ADD_PATH_ERROR, WARNING);
+ endif;
endif;
-
return 0;
end;
+
+
# directory or online at http://www.openafs.org/dl/license10.html
+
!INCLUDE ..\..\..\config\NTMakefile.$(SYS_NAME)
!INCLUDE ..\..\..\config\NTMakefile.version
OUTDIR = $(DESTDIR)\WinInstall
COMPONENTS = \
INSTALL.BAT \
- UNINSTALL.BAT \
afsd.pif \
cellservdb \
- readme.doc \
+ readme.RTF \
license.txt \
- AFSD.EXE \
templet.reg \
runonce.pif \
$(DESTDIR)\bin\util_cr.exe \
$(DESTDIR)\lib\win95\pthread.dll \
$(DESTDIR)\lib\afsrpc.dll
-
-$(COMPONENTS)::
+$(COMPONENTS)::\r
+ $(DESTDIR)\bin\util_cr.exe ~ $@ "Missing $@"
$(COPY) $@ $(DESTDIR)\WinInstall\.
-!IF (EXIST(ISBUILD.H))
+!IF (EXIST(ISBUILD.MAK))
!INCLUDE ISBUILD.MAK
!ENDIF
$(DEL) $(OUTDIR)\DiskIm~1\Disk1\*
$(DEL) $(OUTDIR)\DiskIm~1\WebInstall\*
-.SILENT:
prep :
- if not exist $(DESTDIR)\WinInstall\sock.vxd $(DESTDIR)\bin\util_cr.exe ~ "SOCK.VXD is missing from $(DESTDIR)\WinInstall\."
- if not exist $(DESTDIR)\WinInstall\mmap.vxd $(DESTDIR)\bin\util_cr.exe ~ "MMAP.VXD is missing from $(DESTDIR)\WinInstall\."
- if not exist $(DESTDIR)\WinInstall\afsd.exe $(DESTDIR)\bin\util_cr.exe ~ "AFSD.EXE is missing from $(DESTDIR)\WinInstall\."
-
+ $(DESTDIR)\bin\util_cr.exe ~ "$(DESTDIR)\WinInstall\sock.vxd" "SOCK.VXD is missing from $(DESTDIR)\WinInstall\."
+ $(DESTDIR)\bin\util_cr.exe ~ "$(DESTDIR)\WinInstall\MMAP.vxd" "MMAP.VXD is missing from $(DESTDIR)\WinInstall\."
+ $(DESTDIR)\bin\util_cr.exe ~ "$(DESTDIR)\WinInstall\AFSD.EXE" "AFSD.EXE is missing from $(DESTDIR)\WinInstall\."
pthread_95.obj: pthread.c
$(C2OBJ) pthread.c -DAFS_WIN95_ENV /Fopthread_95.obj
-install: $(PTHR_DLLFILE) $(LIBINCLUDES)
-
-install9x: $(PTHR95_DLLFILE) install
+install: $(PTHR95_DLLFILE) $(PTHR_DLLFILE) $(LIBINCLUDES)
+\r
+install9x: install\r
pthread.res: pthread.rc AFS_component_version_number.h
$(RC) $*.rc
HLPDIR= .\HELP
+prep :
+ $(DESTDIR)\bin\util_cr.exe ~ "$(MSSDK)\Include\windows.h" "MSSDK must point to SDK include headers "
+
!IF "$(AFSDEV_BUILDTYPE)" == "FREE"
INTDIR=.
HLP_PROJ = /x
# Begin Custom Macros
# End Custom Macros
-
+\r
INSTALL : prep "$(OUTDIR)\WinAfsLoad.exe" "$(OUTDIRHLP)\afswin9x.HLP" "$(OUTDIR)\afswin9x.CNT"
CLEAN ::
install9x: install
-.SILENT:
-prep :
- if not exist $(MSSDK)\Include\$(NULL) $(DESTDIR)\bin\util_cr.exe ~ "MSSDK must point to SDK include headers "
-
SRCDIR=DEST/
# compilation and link editor flags
-DBG=-g
-#OPTMZ=-O2
+#DBG=-g
+OPTMZ=-O2
#PAM_CFLAGS = -O2 -Dlinux -DLINUX_PAM -fPIC
# Put -O2 here to _ensure_ all Makefiles pick it up.
XCFLAGS= ${DBG} -Dfds_bits=fd_bits
$(INCFILEDIR)\afs_sysnames.h \
$(INCFILEDIR)\stds.h \
$(INCFILEDIR)\icl.h
-
+\r
$(INCFILEDIR)\param.h: param.$(SYS_NAME).h
$(COPY) $? $@
$(MKDIR) $(DESTDIR)\root.client\usr\vice\etc
! ENDIF
-
+INCCOPY = \\r
+ $(DESTDIR)\bin\rmbat.bat \\r
+ $(DESTDIR)\bin\rmbat.rsp \\r
+ $(DESTDIR)\bin\NTBUILD.bat\r
+\r
+$(DESTDIR)\bin\rmbat.bat:..\rmbat.bat\r
+ $(COPY) $? $@
+ util_cr + $@
+\r
+$(DESTDIR)\bin\rmbat.rsp:..\rmbat.rsp\r
+ $(COPY) $? $@
+\r
+$(DESTDIR)\bin\NTBUILD.bat:..\NTBUILD.bat\r
+ $(COPY) $? $@
+ util_cr + $@
+\r
+$(DESTDIR)\bin\NTLang.bat: NTLang.bat util_cr.exe
+ $(COPY) NTLang.bat $(DESTDIR)\bin
+ util_cr + $(DESTDIR)\bin\NTLang.bat
+\r
+$(DESTDIR)\NTDllmap.txt:NTDllmap.txt\r
+ $(COPY) $? $@
+\r
# Create link to docs needed for media build; allow to fail in case
# symlink not available, e.g. if using a 3.4a client, since most builds
# aren't media builds.
$(COPY) NTMakefile.version-NOCML NTMakefile.version
! ENDIF
-$(DESTDIR)\bin\util_cr.exe: util_cr.exe
- $(COPY) util_cr.exe $(DESTDIR)\bin
-
-$(DESTDIR)\bin\touch.exe: touch.exe
- $(COPY) touch.exe $(DESTDIR)\bin
-
-$(DESTDIR)\bin\mkvers.exe: mkvers.exe
- $(COPY) mkvers.exe $(DESTDIR)\bin
-
-
-$(DESTDIR)\NTDllmap.txt: NTDllmap.txt
- $(COPY) NTDllmap.txt $(DESTDIR)
-
-
-# $$$: make CR/LF when doing copy here
-$(DESTDIR)\bin\NTLang.bat: NTLang.bat util_cr.exe
- $(COPY) NTLang.bat $(DESTDIR)\bin
- util_cr + $(DESTDIR)\bin\NTLang.bat
-
-util_cr.obj : util_cr.c
- $(cc) $(cflags) $(cdebug) $(cvarsdll) $(afscflags) $(afscdefs) $*.c
-
+INCTOOLS = \\r
+ $(DESTDIR)\bin\mkvers.exe \\r
+ $(DESTDIR)\bin\util_cr.exe \\r
+ $(DESTDIR)\bin\touch.exe\r
+\r
+#mkvers.exe : mkvers.obj
+# $(EXECONLINK)
+\r
+$(DESTDIR)\bin\mkvers.exe:mkvers.exe\r
+ $(COPY) mkvers.exe $(DESTDIR)\bin\.
+
+$(DESTDIR)\bin\util_cr.exe:util_cr.exe\r
+ $(COPY) util_cr.exe $(DESTDIR)\bin\.
+\r
util_cr.exe : util_cr.obj
$(EXECONLINK)
+\r
+$(DESTDIR)\bin\touch.exe:touch.exe\r
+ $(COPY) touch.exe $(DESTDIR)\bin\.
langsetup: $(DESTDIR)\bin\NTLang.bat
-install: idirs version $(DESTDIR)\bin\touch.exe $(DESTDIR)\bin\util_cr.exe $(INCFILES) $(DESTDIR)\NTDllmap.txt langsetup
+install: idirs $(INCTOOLS) $(INCCOPY) version $(INCFILES) $(DESTDIR)\NTDllmap.txt langsetup
install9x: install
clean::
$(DEL) $(DESTDIR)\LIB\*.DLL
- $(DEL) $(DESTDIR)\bin\mkvers.exe
\ No newline at end of file
+ $(DEL) $(DESTDIR)\bin\mkver.exe\r
+ $(DEL) $(DESTDIR)\bin\touch.exe\r
+ $(DEL) $(DESTDIR)\bin\util_cr.exe\r
+ $(DEL) mkver.exe\r
+ $(DEL) touch.exe\r
+ $(DEL) util_cr.exe
\ No newline at end of file
# Command macros.
COPY = copy
DEL = -del
+#DEL = $(DESTDIR)\BIN\rmbat # win 98 must use batch file
MKDIR = mkdir
REN = ren
ECHO = echo
COPY = copy
#DEL = del
#DEL = rm -f # to delete multiple files on one command line
-DEL = $(AFSROOT)\src\rmbat # win 98 must use batch file
+DEL = $(DESTDIR)\BIN\rmbat # win 98 must use batch file
MKDIR = mkdir
REN = ren
ECHO = echo
*/
#include "stdio.h"
-#include "io.h"
+#include "io.h"\r
+#include <assert.h>
#include "string.h"
#include "process.h"
#include "windows.h"
OR util_cr * \"-[register key value]\" ; aremove register key value\n\
OR util_cr & file.ini \"SectionKey=value\" ; update ini-ipr-pwf file\n\
OR util_cr ~ ;force error\n");
- exit(1);
+ exit(0xc000);
}
if(!result)
{
printf("AFS Error - Could Not create a registration key\n");
- exit(1);
+ exit(0xc000);
}
if (stag==NULL) return;
if ((sval)&&(strlen(sval)))
if(result!=ERROR_SUCCESS)
{
printf("AFS Error - Could Not create a registration key\n");
- exit(1);
+ exit(0xc000);
}
}
if(result!=ERROR_SUCCESS)
{
printf("AFS Error - Could Not create a registration key\n");
- exit(1);
+ exit(0xc000);
}
}
int l,i;
char **pvar,*ch;
long len;
- typedef char * CHARP;
+ typedef char * CHARP;\r
if (argc<3)
usuage();
if (strcmp(argv[1],"~")==0)
- {
- exit(2);
+ { //check for file presence\r
+ if (fopen(argv[2],"r"))\r
+ return(0);
+ printf("Error---%s\n",argv[3]);\r
+ exit(0xc000);
}
if (strcmp(argv[1],"*")==0)
{ /* "[HKEY_CLASSES_ROOT\CLSID\{DC515C27-6CAC-11D1-BAE7-00C04FD140D2}] @=AFS Client Shell Extension" */
if ((ssub==NULL) || (skey==NULL))
{
printf("format error parameter %s\n",argv[i]);
- exit(1);
+ exit(0xc000);
}
option=(*ssub=='-');
stag=strtok(NULL,"\0");
if ((ssect==NULL) || (skey==NULL))
{
printf("format error parameter %s\n",argv[i]);
- exit(1);
+ exit(0xc000);
}
while(*skey==' ')
skey++;
if (sval==NULL)
{
printf("format error parameter %s\n",argv[i]);
- exit(1);
+ exit(0xc000);
}
- printf("parameters %s %s %s %s\n",ssect,skey,sval,argv[2]);
+// printf("parameters %s %s %s %s\n",ssect,skey,sval,argv[2]);
if (WritePrivateProfileString(ssect,skey,sval,argv[2])==0)
{
LPVOID lpMsgBuf;
);
printf("Error writing profile string - %s",lpMsgBuf);
LocalFree( lpMsgBuf );
- exit(1);
+ exit(0xc000);
}
argc-=1;
}
{
file=fopen(fname,"rb");
if (file==NULL)
- exit(2);
+ exit(0xc000);
len=filelength(_fileno(file));
ch=(char *)malloc(len+2);
*ch++=0; /* a small hack to allow matching /r/n if /n is first character*/
strcpy(fname,argv[2]);
file=fopen(fname,"rb");
if (file==NULL)
- exit(2);
+ exit(0xc000);
len=filelength(_fileno(file));
ch=(char *)malloc(len+1);
len=fread(ch,sizeof(char),len,file);
strcat(fname,".et");
file=fopen(fname,"rb");
if (file==NULL)
- exit(2);
+ exit(0xc000);
len=filelength(_fileno(file));
ch=(char *)malloc(len+1);
len=fread(ch,sizeof(char),len,file);
#include <sys/types.h>
#ifdef AFS_NT40_ENV
#include <winsock2.h>
+#define snprintf _snprintf
#else
#include <sys/socket.h>
#include <netdb.h>
*/
#define IGNORE_STDS_H 1
-#ifndef AFS_DJGPP_ENV
+/*#ifndef AFS_DJGPP_ENV*/
#include <afs/param.h>
-#endif /* AFS_DJGPP_ENV */
+/*#endif /* AFS_DJGPP_ENV */
#if defined(RIOS)
.set newsp,16
+#ifdef AFS_DJGPP_ENV
+.globl _PRE_Block
+.globl _savecontext
+_savecontext:
+#else
.globl PRE_Block
.globl savecontext
-
savecontext:
+#endif /* AFS_DJGPP_ENV */
pushl %ebp /* New Frame! */
movl %esp,%ebp
pusha /* Push all registers */
+#ifdef AFS_DJGPP_ENV
+ movl $1,_PRE_Block /* Pre-emption code */
+#else
movl $1,PRE_Block /* Pre-emption code */
+#endif /* AFS_DJGPP_ENV */
movl area1(%ebp),%eax /* eax = base of savearea */
movl %esp,(%eax) /* area->topstack = esp */
movl newsp(%ebp),%eax /* get new sp into eax */
/* Shouldnt be here....*/
+#ifdef AFS_DJGPP_ENV
+ call _abort
+#else
call abort
+#endif /* AFS_DJGPP_ENV */
/*
* returnto(area2)
/* stack offset */
.set area2,8
+#ifdef AFS_DJGPP_ENV
+.globl _returnto
+_returnto:
+#else
.globl returnto
-
returnto:
+#endif /* AFS_DJGPP_ENV */
pushl %ebp
movl %esp, %ebp /* New frame, to get correct pointer */
movl area2(%ebp),%eax /* eax = area2 */
movl (%eax),%esp /* restore esp */
popa
+#ifdef AFS_DJGPP_ENV
+ movl $0,_PRE_Block /* clear it up... */
+#else
movl $0,PRE_Block /* clear it up... */
+#endif /* AFS_DJGPP_ENV */
popl %ebp
ret
/* I see, said the blind man, as he picked up his hammer and saw! */
pushl $1234
+#ifdef AFS_DJGPP_ENV
+ call _abort
+#else
call abort
+#endif /* AFS_DJGPP_ENV */
#endif /* AFS_NCR_ENV */
if [%1]==[/f] shift
if [%1]==[-F] shift
if [%1]==[/F] shift
-if not [%1]==[] del %1 <%AFSROOT%\src\rmbat.rsp
+if not [%1]==[] del %1 <%AFSROOT%\DEST\BIN\rmbat.rsp
if not [%1]==[] shift
-if not [%1]==[] %AFSROOT%\src\rmbat %1 %2 %3 %4 %5 %6 %7 %8
+if not [%1]==[] %AFSROOT%\DEST\BIN\rmbat %1 %2 %3 %4 %5 %6 %7 %8
XDROBJS_djgpp = xdr.o xdr_rec.o xdr_stdio.o \
xdr_float.o xdr_refernce.o xdr_update.o \
- xdr_array.o xdr_mem.o
+ xdr_array.o xdr_mem.o xdr_rx.o xdr_afsuuid.o
RXOBJS_djgpp = rx_clock.o rx_event.o rx_user.o rx_lwp.o rx.o rx_null.o rx_globals.o \
rx_getaddr.o rx_misc.o rx_packet.o rx_rdwr.o rx_trace.o rx_conncache.o \
- $(XMIT)
+ xdr_int64.o $(XMIT)
BASICINCLS = ${SRCDIR}include/lwp.h ${SRCDIR}include/lock.h \
rx_clock.h rx_queue.h rx_event.h
#include <osi.h>
#include <cm.h>
+#include <cm_dir.h>
#include <cm_cell.h>
#include <cm_user.h>
#include <cm_conn.h>
#include <cm_buf.h>
#include <cm_utils.h>
#include <cm_ioctl.h>
-
+\r
#include <smb.h>
-#include <cm.h>
#include <pioctl_nt.h>
static char AFSConfigKeyName[] =
BUTCOBJS = dbentries.obj tcprocs.obj lwps.obj tcmain.obj list.obj recoverDb.obj \
tcudbprocs.obj dump.obj tcstatus.obj butc_xbsa.obj \
$(LWPOBJS) $(BUCOORDOBJS)
-BUTCINCLUDE= -I. -I$(DESTDIR)\include -I$(XBSADIR)\
-BUTCLIBS = $(DESTDIR)\lib\afs\afsbudb.lib \
+BUTCINCLUDE= -I. -I$(DESTDIR)\include -I$(XBSADIR)
+BUTCLIBS=$(DESTDIR)\lib\afs\afsbudb.lib \
$(DESTDIR)\lib\afs\afsbubasics.lib \
$(VOLSERLIBS) \
$(BUTMLIBS) \
# nmake /nologo /f ntmakefile install
#----------------------------------------------- BUTC
-$(BUTCEXE): $(BUTCOBJS) $(BUTCLIBS)
+$(BUTCEXE): $(BUTCOBJS) $(BUTCLIBS)\r
$(EXECONLINK)
$(EXEPREP)