131 #include <sys\types.h>
135 #include <sys\stat.h>
137 #include <sys/stat.h>
141 #include <netinet/in.h>
144 #include <sys/types.h>
147 #include <sys/socket.h>
149 #include <sys/socket.h>
187 char cModule[32]=
"rawAddStrings";
206 iString1 = strlen(pcMsg1);
207 iString2 = strlen(pcMsg2);
208 iString = iString1 + iString2;
212 fprintf(
fLogFile,
"\n-D- begin %s\n", cModule);
213 fprintf(
fLogFile,
" string1 (%d byte, max %d byte):\n %s",
214 iString1, iMaxLength1, pcMsg1);
216 fprintf(
fLogFile,
" add msg for errno=%d\n", errno);
218 fprintf(
fLogFile,
" add string2 (%d byte, max %d byte):\n %s",
219 iString2, iMaxLength2, pcMsg2);
222 if ( (iString1 <= iMaxLength1) &&
223 (iString2 <= iMaxLength2) )
227 if (iMaxLength2 >= iMinLen)
229 sprintf(pcMsg2,
" %s\n", strerror(errno));
230 iString2 = strlen(pcMsg2);
231 iString = iString1 + iString2;
237 "-E- %s: 2nd string (%d byte) possibly too small for system error: requ. %d byte\n",
238 cModule, iMaxLength2, iMinLen);
244 if (iString < iMaxLength1)
246 strcat(pcMsg1, pcMsg2);
248 " returned msg (%d byte):\n %s", iString, pcMsg1);
252 strncat(pcMsg1, pcMsg2, iMaxLength1-iString1-1);
253 strncat(pcMsg1,
"\n", 1);
254 iRC = iString -iMaxLength1;
257 fprintf(
fLogFile,
" returned msg:\n %s", pcMsg1);
259 pcc+= iMaxLength1-iString1-1;
260 fprintf(
fLogFile,
" skipped msg part:\n %s", pcc);
266 if (iMaxLength1 <= 0)
269 sprintf(cMsg,
"-E- %s: 1st string length (%d byte) invalid\n",
270 cModule, iMaxLength1);
272 if (iMaxLength2 <= 0)
275 sprintf(cMsg,
"-E- %s: 2nd string length (%d byte) invalid\n",
276 cModule, iMaxLength2);
278 else if (iString == 0)
281 sprintf(cMsg,
"-E- %s: empty strings provided\n", cModule);
283 else if (iString1 > iMaxLength1)
286 sprintf(cMsg,
"-E- %s: 1st string longer (%d byte) than length provided (%d)\n",
287 cModule, iString1, iMaxLength1);
289 else if ( (iString2 > iMaxLength2) && (iErrno == 0) )
292 sprintf(cMsg,
"-E- %s: 2nd string longer (%d byte) than length provided (%d)\n",
293 cModule, iString2, iMaxLength2);
304 iStringE = strlen(cMsg);
306 " error string (%d byte, max %d byte):\n %s\n",
307 iStringE, iMaxLengthE, cMsg);
309 if (iMaxLengthE < iStringE)
312 fprintf(
fLogFile,
"-E- %s: size error string too small: max %d byte (needed %d)",
313 cModule, iMaxLengthE, iStringE);
314 strncat(pcMsgE, cMsg, iMaxLengthE);
315 fprintf(
fLogFile,
", provided: %s\n", pcMsgE);
321 strcpy(pcMsgE, cMsg);
326 fprintf(
fLogFile,
"-D- end %s: rc=%d\n\n", cModule, iRC);
347 char cModule[32]=
"rawCheckClientFile";
357 char *plocd = NULL, *plocs = NULL;
358 char *pdelim = NULL, *pgen = NULL;
359 const char *pcSemi =
";";
360 char *pcc = NULL, *pBufTape, *pBufFile;
363 "\n-D- begin %s: test file %s\n", cModule, pcFile0);
367 strcpy(cTemp, pcFile0);
373 iRC = strncmp(cTemp,
"/dev", 4);
376 "-E- invalid file name: %s\n path names must not contain '%s'\n",
382 pdelim = strrchr(cTemp, *pcFileDelim);
383 if ( (pdelim == NULL) || (pdelim > plocd) )
386 "-E- invalid disk file name: %s\n path names must not contain '%s'\n",
397 "-E- invalid tape file name: %s\n name too long: max %d byte after dev name\n",
403 iRC = strncmp(++pcc,
"\0", 1);
408 "-E- file name must be specified explicitly\n");
410 fprintf(
fLogFile,
"-E- file name missing in %s\n", pcFile0);
418 plocs = strchr(cTemp, *pcSemi);
422 iRC = isalnum(*plocs);
425 iRC = isalpha(*plocs);
428 "-W- version number in file specification removed\n");
431 "-W- invalid version in file specification removed\n");
435 "-W- semicolon in file specification removed\n");
436 strncpy(--plocs,
"\0", 1);
437 strcpy(pcFile0, cTemp);
440 iDevType = rawCheckDevice(cTemp, pcFile, pcTape);
445 " no device name specified\n");
450 if (strlen(*pcFile) == 0)
451 fprintf(
fLogFile,
" disk device %s\n", *pcTape);
454 " file %s on disk %s\n", *pcFile, *pcTape);
460 if (strlen(*pcFile) == 0)
461 fprintf(
fLogFile,
" tape device %s\n", *pcTape);
463 fprintf(
fLogFile,
" file %s on tape %s\n", *pcFile, *pcTape);
467 fprintf(
fLogFile,
"-E- invalid file name %s\n", pcFile0);
481 "-E- node specification not allowed in file name: %s\n",
487 strncpy(plocd++,
"\0", 1);
488 strcpy(pBufTape, cTemp);
493 pgen = strchr(pBufTape, *
pcStar);
497 "-E- specified device %s has generic path\n", pBufTape);
499 " only the relative file name may be generic\n");
504 strcpy(pBufFile, plocd);
506 " file %s on tape %s\n", pBufFile, pBufTape);
507 strcpy(cText,
"tape");
513 strcpy(pBufFile, cTemp);
514 strcpy(cText,
"disk");
519 " %s file %s\n", cText, pBufFile);
521 pdelim = strrchr(pBufFile, *pcFileDelim);
528 "-E- path in tape file name not allowed: %s\n", pBufFile);
534 pgen = strchr(pBufFile, *
pcStar);
536 pgen = strchr(pBufFile, *
pcQM);
537 if ( (pgen != NULL) && (pgen < pdelim) )
540 "-E- specified %s file %s has wildcard chars in path name\n",
543 " only the relative file name may contain wildcard chars\n");
550 else pdelim = pBufFile;
553 if (strlen(pdelim) > ii)
556 "-E- rel file name %s too long:\n has %d chars, max allowed %d\n",
557 pdelim, strlen(pdelim), ii);
568 iloc = isupper(*pcc);
572 "-W- upper case in (relative) file name not supported: %s\n",
575 *pcc = tolower(*pcc);
582 fprintf(
fLogFile,
" instead assumed: %s\n", pdelim);
586 "\n end %s: file name %s okay\n", cModule, pcFile0);
601 char cModule[32]=
"rawGetFSpName";
607 fprintf(
fLogFile,
"\n-D- begin %s\n", cModule);
610 if ( (strchr(pcUser, *
pcStar) != NULL) ||
611 (strchr(pcUser, *
pcQM) != NULL) )
614 "-E- %s: generic archive name '%s' not allowed\n",
621 fprintf(
fLogFile,
"-D- %s: FS %s, in %s-%s, delim %s\n",
622 cModule,
cNamefs, pcUser, pc, pcObjDelim);
623 if (strncmp(pc, pcObjDelim, 1) == 0)
631 if (isalpha(*pc) == 0)
634 "-E- archive name '%s' must start with a letter\n", pc);
640 "-D- end %s: FS %s\n",
cNamefs, cModule);
658 char cModule[32]=
"rawGetHLName";
667 "\n-D- begin %s\n path specified: %s\n", cModule, pcPath);
669 pdelim = strchr(pcPath, *pcObjDelim);
670 if (pdelim != pcPath)
674 " delimiter '%s' inserted at begin of archive path\n",
680 pdelim = strstr(
cNamehl,
"/./");
684 pdelim = strstr(cNameTemp,
"/./");
686 while (pdelim != NULL)
689 strncpy(pdelim,
"\0", 1);
696 pdelim = strstr(cNameTemp,
"/./");
699 " %d unnecessary './' removed\n", ii);
702 pdelim = strstr(
cNamehl,
"/.");
712 strncpy(pdelim,
"\0", 1);
714 " trailing '/.' removed\n");
719 " hl name: %s\n-D- end %s\n\n",
cNamehl, cModule);
738 char cModule[32] =
"rawGetLLName";
745 "\n-D- begin %s\n file %s, object delimiter %s\n",
746 cModule, pcFile, pcDelimiter);
748 strcpy(cNamell, pcDelimiter);
750 ploc = strrchr(pcFile, *pcFileDelim);
752 strcat(cNamell, ++ploc);
755 ploc = strrchr(pcFile, *pcObjDelimAlt);
757 strcat(cNamell, ++ploc);
763 strcat(cNamell, ++ploc);
767 strcat(cNamell, pcFile);
770 strcpy(pcObject, cNamell);
773 " ll name %s\n-D- end %s\n\n", pcObject, cModule);
787 unsigned long *piSize,
788 unsigned int *piRecl)
790 char cModule[32] =
"rawGetFileSize";
795 unsigned long iSize = 0;
798 struct _stat sFileStatus, *pFileStatus;
800 struct stat sFileStatus, *pFileStatus;
804 "\n-D- begin %s: file %s\n", cModule, pcFile);
806 pFileStatus = &sFileStatus;
809 iRC = _stat(pcFile, pFileStatus);
811 iRC = stat(pcFile, pFileStatus);
816 "-E- %s: file %s unavailable (stat)\n", cModule, pcFile);
819 fprintf(
fLogFile,
" %s\n", strerror(errno));
822 if (strcmp(strerror(errno),
823 "Value too large for defined data type") == 0)
826 "-E- %s: file size of %s > 2 GByte: use 64 bit gStore client\n",
839 iRecl = pFileStatus->st_fab_mrs;
844 iRecl = pFileStatus->st_blksize;
847 iSize = pFileStatus->st_size;
848 if (pFileStatus->st_mode & S_IFREG)
852 " file %s: size %u, recl %d (byte)\n",
853 pcFile, iSize, iRecl);
857 if (pFileStatus->st_mode & S_IFDIR)
861 "-W- %s is a directory, size %u\n", pcFile, iSize);
865 else if (pFileStatus->st_mode & S_IFLNK)
869 "-W- %s is a symbolic link, size %u\n", pcFile, iSize);
877 "-W- unexpected item %s, size %u\n", pcFile, iSize);
884 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
902 char cModule[32] =
"rawGetPathName";
905 char *ploc = NULL, *ploc1 = NULL;
909 fprintf(
fLogFile,
"-D- begin %s: hl: %s\n", cModule, pcNamehl);
911 if (strlen(pcNamehl) == 0)
913 fprintf(
fLogFile,
"-E- %s: high level name empty\n", cModule);
918 ploc = strchr(pcNamehl, *pcObjDelim);
919 ploc1 = strchr(pcNamehl, *pcObjDelimAlt);
920 if ( (ploc != pcc) && (ploc1 != pcc) )
923 "-E- %s: invalid prefix in high level name %s\n",
930 "-D- end %s: path %s\n\n", cModule,
cPath);
951 char cModule[32] =
"rawQueryFile";
958 int iIdent, iQuery = -1, iAttrLen;
960 int iStatus, iStatusLen;
965 int iVersionObjAttr = 0;
979 iAction = ntohl(pComm->
iAction);
985 "\n-D- begin %s: query file %s in ATL Server %d (action %d)\n",
986 cModule, pComm->
cNamell, iATLServer, iAction);
1004 "-E- %s: invalid action %d\n", cModule, iAction);
1009 pcc = (
char *) pComm;
1010 iRC = send(iSocket, pcc, (
unsigned) iBufComm, 0);
1014 "-E- %s: sending command buffer for query file %s\n",
1017 "-E- %s: query command buffer incompletely sent (%d of %d byte)\n",
1018 cModule, iRC, iBufComm);
1022 fprintf(
fLogFile,
" %s\n", strerror(errno));
1031 " query command sent to entry server (%d bytes), look for reply\n",
1037 pcc = (
char *) pQuery;
1042 "-E- %s: receiving buffer header with query information\n",
1049 iIdent = ntohl(pQuery->
iIdent);
1051 iAttrLen = ntohl(pQuery->
iAttrLen);
1054 " %d bytes received: iIdent %d, iQuery %d, iAttrLen %d\n",
1055 iRC, iIdent, iQuery, iAttrLen);
1065 iStatusLen = iAttrLen;
1072 "-E- %s: error status from entry server instead of query data:\n",
1079 "-E- receiving error msg from server, rc = %d\n",
1081 else if ( (iDebug) || (iStatus ==
STA_ERROR) ||
1086 fprintf(
fLogFile,
" no error message available\n");
1096 "-E- %s: unexpected status (type %d) received from server\n",
1101 "-E- %s: unexpected header (type %d) received from server\n",
1110 iQueryAll += iQuery;
1117 for (ii=1; ii<=iQuery; ii++)
1122 if ( (iRC = recv( iSocket, pcc, (
unsigned) iBuf, 0 )) <= 0 )
1127 "-E- %s: receiving buffer %d with query results\n",
1131 iQueryAll -= iQuery;
1135 jj = iAttrLen - iBuf;
1137 "-E- %s: connection to server broken, only %d bytes of query object %d (%d byte) received\n",
1138 cModule, jj, ii, iAttrLen);
1143 iQueryAll -= iQuery;
1148 "-E- %s: only %d of %d objects received\n",
1149 cModule, --ii, iQuery);
1150 iQueryAll -= iQuery - ii;
1157 fprintf(
fLogFile,
" %s\n", strerror(errno));
1169 iVersionObjAttr = ntohl(pObjAttr->
iVersion);
1174 "-E- %s: invalid cacheDB entry version %d\n",
1175 cModule, iVersionObjAttr);
1181 iPoolId = ntohl(pObjAttr->
iPoolId);
1185 " query buffer received (%d bytes, objAttr data V%d)\n",
1186 iAttrLen, iVersionObjAttr);
1188 " query buffer overlaid (%d bytes)\n", iAttrLen);
1190 fprintf(
fLogFile,
" %s%s%s: poolId %d",
1194 fprintf(
fLogFile,
" (RetrievePool)\n");
1195 else if (iPoolId == 2)
1196 fprintf(
fLogFile,
" (StagePool)\n");
1197 else if (iPoolId == 3)
1198 fprintf(
fLogFile,
" (ArchivePool)\n");
1199 else if (iPoolId == 4)
1206 else if ( (iQuery == 0) && (iDebug) )
1208 " no more objects found in ATL server %d\n", iATLServer);
1221 if ( (iNameWC == 0) && (iQuery > 0) )
1232 " no matching object %s in gStore found\n",
1237 " file %s available in gStore\n", pComm->
cNamell);
1241 "-E- %s: query in gStore could not be executed\n",
1247 " requested archive %s not existing in gStore\n",
1252 " requested access to file %s not allowed\n",
1258 if (strcmp(pComm->
cOwner,
"goeri") == 0)
1259 fprintf(
fLogFile,
"-W- %d versions of %s exist!\n",
1265 "-E- %s: invalid number %d of objects %s found\n",
1266 cModule, iQuery, pComm->
cNamell);
1272 "-D- end %s\n\n", cModule);
1287 char cModule[32]=
"rawRecvError";
1295 fprintf(
fLogFile,
"\n-D- begin %s\n", cModule);
1304 if ( (iRC = recv(iSocket, pcc, (
unsigned) iBuf, 0 )) <= 0 )
1309 "-E- %s: receiving error message\n", cModule);
1313 fprintf(
fLogFile,
" %s\n", strerror(errno));
1330 "-E- incomplete error message received:\n %s", pcMsg);
1333 "-E- %s: connection to sender broken, %d byte of error message (%d byte) received\n",
1338 fprintf(
fLogFile,
" %s\n", strerror(errno));
1355 "-E- %s: more error data received than expected:\n %s",
1363 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
1379 " error message received (%d bytes):\n %s",
1381 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
1399 char cModule[32]=
"rawRecvHead";
1411 fprintf(
fLogFile,
"\n-D- begin %s\n", cModule);
1421 iRC = recv(iSocket, pcc, (
unsigned) iBuf, 0);
1425 "-E- %s: receiving buffer header\n", cModule);
1430 "-E- %s: connection to sender broken, %d byte of buffer header (%d byte) received\n",
1431 cModule, ii, iBufs);
1436 fprintf(
fLogFile,
" %s\n", strerror(errno));
1448 iIdent = ntohl(*pint);
1450 iStatus = ntohl(*pint);
1452 iDataLen = ntohl(*pint);
1454 " ident %d, status %d, datalen %d\n",
1455 iIdent, iStatus, iDataLen);
1462 "-W- %s: error message available for receive (%d byte)\n",
1468 "-D- end %s: buffer header received (%d bytes)\n\n",
1500 char cModule[32] =
"rawRecvHeadC";
1517 fprintf(
fLogFile,
"\n-D- begin %s\n", cModule);
1519 if (iIdentReq < 0) fprintf(
fLogFile,
1520 " check Ident, expect %d\n", iIdentReq);
1522 fprintf(
fLogFile,
" no check of Ident\n");
1523 if (iStatusReq >= 0) fprintf(
fLogFile,
1524 " check Status, expect %d\n", iStatusReq);
1526 fprintf(
fLogFile,
" no check of Status\n");
1537 if ( (iRC = recv( iSocket, pcc, (
unsigned) iBuf, 0 )) <= 0 )
1541 sprintf(pcMsg,
"-E- %s: receiving buffer header\n",
1549 "-E- %s: connection to sender broken, %d byte of buffer header (%d byte) received\n",
1550 cModule, ii, iBufs);
1556 sprintf(cMsg1,
" %s\n", strerror(errno));
1557 strcat(pcMsg, cMsg1);
1573 " buffer header received (%d bytes)\n", iBufs);
1575 pint = (
int *) pcBuf;
1576 iIdent = ntohl(*pint);
1578 iStatus = ntohl(*pint);
1580 iDataLen = ntohl(*pint);
1583 " ident %d, status %d, datalen %d\n",
1584 iIdent, iStatus, iDataLen);
1590 fprintf(
fLogFile,
" status received");
1593 fprintf(
fLogFile,
" with error message\n");
1606 sprintf(pcMsg,
"-E- %s: receiving error msg, rc=%d\n",
1616 " msg (%d byte): %s\n", iDataLen, pcc);
1618 iRC = strlen(pcMsg);
1622 if ( (iDataLen == 0) &&
1626 "-W- error status received, but no error message\n");
1635 fprintf(
fLogFile,
" check identifier\n");
1637 if (iIdent != iIdentReq)
1640 "-E- %s: unexpected header (ident %d) received\n",
1651 if (iStatusReq >= 0)
1654 fprintf(
fLogFile,
" check status\n");
1656 if (iStatusReq != iStatus)
1659 "-E- %s: unexpected header (status %d) received\n",
1675 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
1699 char cModule[32]=
"rawRecvRequest";
1713 "\n-D- begin %s: receive request buffer\n", cModule);
1715 pRequest = &sRequest;
1716 pcc = (
char *) pRequest;
1721 if ( (iRC = recv( iSocket, pcc, (
unsigned) iBuf, 0 )) <= 0 )
1726 "-E- %s: receiving buffer header\n", cModule);
1733 "-W- %s: connection to sender broken, %d byte of buffer header (%d byte) received\n",
1734 cModule, ii, iimax);
1738 goto gErrorRecvRequest;
1749 "-E- %s: more buffer header data received than expected\n",
1753 goto gErrorRecvRequest;
1758 " buffer header received (%d bytes, id %d)\n",
1759 iimax, pRequest->
iIdent);
1764 fprintf(
fLogFile,
"-E- %s: invalid buffer received (id %d)\n",
1765 cModule, pRequest->
iIdent);
1767 goto gErrorRecvRequest;
1779 if ( (iRC = recv( iSocket, pcc, (
unsigned) iBuf, 0 )) <= 0 )
1784 "-E- %s: receiving buffer data\n", cModule);
1791 "-W- %s: connection to sender broken, %d byte of data (%d byte) received\n",
1792 cModule, ii, iBuf0);
1798 fprintf(
fLogFile,
" %s\n", strerror(errno));
1802 goto gErrorRecvRequest;
1812 fprintf(
fLogFile,
"-E- %s: more data received than expected\n",
1815 goto gErrorRecvRequest;
1821 " %s: request data received (%d bytes)\n", cModule, iBuf0);
1826 "-E- %s: invalid data size (%d) in request buffer (expected %d byte)\n",
1827 cModule, iBuf0, iRequSize-
HEAD_LEN);
1829 goto gErrorRecvRequest;
1832 *piSeekMode = ntohl(pRequest->
iSeekMode);
1833 *piOffset = ntohl(pRequest->
iOffset);
1837 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
1848 " %s: status info received: end session\n", cModule);
1855 "-W- %s: error status received: end session\n", cModule);
1857 "-W- %s: error message from client:\n %s\n",
1860 goto gErrorRecvRequest;
1865 "-E- %s: invalid status buffer received (id %d)\n",
1868 goto gErrorRecvRequest;
1872 goto gErrorRecvRequest;
1877 fprintf(
fLogFile,
"-E- %s: invalid buffer received (ident %d)\n",
1878 cModule, pRequest->
iIdent);
1880 goto gErrorRecvRequest;
1885 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
1905 char cModule[32]=
"rawRecvStatus";
1915 fprintf(
fLogFile,
"\n-D- begin %s\n", cModule);
1919 memset(pcc, 0x00,
sizeof(
HEAD_LEN));
1925 if ( (iRC = recv( iSocket, pcc, (
unsigned) iBuf, 0 )) <= 0 )
1928 "-E- %s: receiving status header\n", cModule);
1933 "-E- %s: connection to sender broken, %d byte of status header (%d byte) received\n",
1934 cModule, ii, iBufs);
1939 fprintf(
fLogFile,
" %s\n", strerror(errno));
1954 "-E- %s: more status header data received than expected\n",
1965 fprintf(
fLogFile,
" status header received (%d bytes)\n",
1967 fprintf(
fLogFile,
" ident %d, status %d, status len %d\n",
1973 fprintf(
fLogFile,
"-E- %s: invalid status header received (%d)\n",
1974 cModule, pStatus->
iIdent);
1981 memset(pcc, 0x00, (
unsigned) iLen);
1986 if ( (iRC = recv( iSocket, pcc, (
unsigned) iBuf, 0 )) <= 0 )
1989 "-E- %s: receiving status message\n", cModule);
1994 "-E- %s: connection to sender broken, %d byte of status message (%d byte) received\n",
2000 fprintf(
fLogFile,
" %s\n", strerror(errno));
2015 "-E- %s: more status data received than expected\n",
2021 " status message received (%d bytes):\n%s\n",
2027 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
2047 char cModule[32]=
"rawSendRequest";
2057 "\n-D- begin %s: send request buffer\n", cModule);
2067 sRequest.
iOffset = htonl(iOffset);
2068 if (iBufferSize < 0)
2071 "-E- %s: invalid buffer size %d\n", cModule, iBufferSize);
2077 pcc = (
char *) &sRequest;
2078 iRC = send(iSocket, pcc, (
unsigned) iBuf, 0);
2082 "-E- %s: sending request buffer\n", cModule);
2084 "-E- %s: request buffer incompletely sent (%d of %d byte)\n",
2085 cModule, iRC, iBuf);
2089 fprintf(
fLogFile,
" %s\n", strerror(errno));
2097 "-D- end %s: request buffer sent\n\n", cModule);
2114 char cModule[32]=
"rawSendStatus";
2123 "\n-D- begin %s: send status buffer (%d) to socket %d\n",
2124 cModule, iStatus, iSocket);
2127 sStatus.
iStatus = htonl(iStatus);
2133 iMsgLen = strlen(pcMsg);
2138 strcpy(sStatus.
cStatus, pcMsg);
2140 " %s: error message (%d bytes):\n %s\n",
2141 cModule, iMsgLen, pcMsg);
2144 pcc = (
char *) &sStatus;
2148 " now send (iIdent %d, iStatus %d, iStatusLen %d), %d byte:\n",
2154 iRC = send(iSocket, pcc, (
unsigned) iBuf, 0);
2158 "-E- %s: sending status buffer\n", cModule);
2160 "-E- %s: status buffer incompletely sent (%d of %d byte)\n",
2161 cModule, iRC, iBuf);
2165 fprintf(
fLogFile,
" %s\n", strerror(errno));
2173 "-D- end %s: status buffer sent (%d byte)\n\n", cModule, iBuf);
2189 char cModule[32] =
"rawTestFileName";
2195 unsigned long lFileSize = 0;
2200 "-D- begin %s: input file name %s\n", cModule, pcFile);
2202 if ( (pdir = strrchr(pcFile,
'*')) != NULL)
2205 "-E- invalid file name '%s': '*' not allowed as part of file name\n",
2211 if ( (pdir = strrchr(pcFile,
'?')) != NULL)
2214 "-E- invalid file name '%s': '?' not allowed as part of file name\n",
2220 if ( (pdir = strrchr(pcFile,
'/')) == NULL)
2223 fprintf(
fLogFile,
" name %s okay\n", pcFile);
2227 ilen = strlen(pdir);
2229 " trailor %s (len %d)\n", pdir, ilen);
2232 strncpy(pdir,
"\0", 1);
2234 fprintf(
fLogFile,
" %s is a directory\n", pcFile);
2239 fprintf(
fLogFile,
" rel name %s okay\n", pcFile);
2244 " after rawGetFileSize, rc = %d\n", iRC);
2250 fprintf(
fLogFile,
"-W- %s NOT archived", pcFile);
2252 fprintf(
fLogFile,
" - is a directory\n");
2254 fprintf(
fLogFile,
" - is a symbolic link\n");
2256 fprintf(
fLogFile,
" - is not a regular file\n");
2266 " %s is a regular file\n", pcFile);
2270 fprintf(
fLogFile,
"-D- end %s\n\n", cModule);
int rawRecvStatus(int iSocket, char *pcBuf)
#define VERSION_SRAWOBJATTR
int rawCheckClientFile(char *pcFile0, char **pcFile, char **pcTape)
int rawTestFileName(char *pcFile)
int rawRecvError(int iSocket, int iLen, char *pcMsg)
static const char * pcStar
char * rawGetHLName(char *pcPath)
int rawAddStrings(char *pcMsg1, int iMaxLength1, char *pcMsg2, int iMaxLength2, int iErrno, char *pcMsgE, int iMaxLengthE)
static char cPath[MAX_FULL_FILE]
int rawSendStatus(int iSocket, int iStatus, char *pcMsg)
int rawQueryFile(int iSocket, int iAltMaster, srawComm *pCommBuf, void **pQueryBuf)
int rawGetLLName(char *pcFile, const char *pcDelimiter, char *pcObject)
#define IDENT_QUERY_ARCHDB
int rawRecvHeadC(int iSocket, char *pcBuf, int iIdentReq, int iStatusReq, char *pcMsg)
int rawSendRequest(int iSocket, int iSeekMode, int iOffset, int iBufferSize)
static const char * pcPerc
int rawRecvHead(int iSocket, char *pcBuf)
static char cNamefs[MAX_OBJ_FS]
char * rawGetPathName(char *pcNamehl)
static char cNamehl[MAX_OBJ_HL]
int rawRecvRequest(int iSocket, int *piSeekMode, int *piOffset, int *piBufferSize)
int rawGetFileSize(char *pcFile, unsigned long *piSize, unsigned int *piRecl)
#define IDENT_NEXT_BUFFER
char * rawGetFSpName(char *pcUser)
static const char * pcDevDelim