Skip to content
Snippets Groups Projects
Commit a496d81c authored by Steven Murray's avatar Steven Murray Committed by Steven Murray
Browse files

Skeleton version of castor-tape-mount no compiles

parent c9157709
No related branches found
No related tags found
No related merge requests found
......@@ -61,7 +61,7 @@ int rmc_mnt(
case RMC_LOADER_TYPE_SMC:
return rmc_smc_mnt(server, vid, drive);
default:
errno = ERMCUNREC;
errno = ERMCUKNLDRTYPE; /* Unknown loader type */
serrno = errno;
return -1;
}
......@@ -88,25 +88,29 @@ static int rmc_acs_mnt(
char rmc_host[CA_MAXHOSTNAMELEN+1];
struct rmc_acs_drive_id drive_id = {0, 0, 0, 0};
/* Consider the function arguments invalid if the total size of the */
/* request message would be greater than RMC_REQBUFSZ */
if(msglen > RMC_REQBUFSZ) {
errno = ERMCUNREC;
if(CA_MAXVIDLEN < strlen(vid)) {
errno = ERMCVIDTOOLONG; /* VID is too long */
serrno = errno;
return -1;
}
if(CA_MAXVIDLEN < strlen(vid)) {
errno = ERMCUNREC;
if(rmc_get_rmc_host_of_drive(drive, rmc_host, sizeof(rmc_host))) {
errno = ERMCPARSERMCHOST; /* Failed to parse RMC host */
serrno = errno;
return -1;
}
if(rmc_get_rmc_host_of_drive(drive, rmc_host, sizeof(rmc_host))) {
if(rmc_get_acs_drive_id(drive, &drive_id)) {
errno = ERMCPARSEACSDRV; /* Failed to parse ACS drive id */
serrno = errno;
return -1;
}
if(rmc_get_acs_drive_id(drive, &drive_id)) {
/* It is an internal error if the total size of the request message */
/* would be greater than RMC_REQBUFSZ */
if(msglen > RMC_REQBUFSZ) {
errno = SEINTERNAL;
serrno = errno;
return -1;
}
......
......@@ -48,12 +48,12 @@ mount, or -1 if the operation failed. In the latter case,
.B serrno
is set appropriately.
.SH ERRORS
.TP 1.2i
.TP 1.8i
.B SECOMERR
Communication error.
.TP
.B ERMCUNREC
Unknown host or invalid drive or vid too long or requester does not have
Unknown host or invalid drive or requester does not have
TP_SYSTEM privilege in the Cupv database.
.TP
.B ERMCFASTR
......@@ -61,6 +61,21 @@ Unit attention.
.TP
.B ERMCOMSGR
Hardware error or Medium Removal Prevented.
.TP
.B ERMCUKNLDRTYPE
Unknown loader type.
.TP
.B ERMCVIDTOOLONG
VID is too long.
.TP
.B ERMCPARSERMCHOST
Failed to parse RMC host.
.TP
.B ERMCPARSEACSDRV
Failed to parse ACS drive id.
.TP
.B SEINTERNAL
Internal error.
.SH SEE ALSO
.BR Cupvlist(1) ,
.SH AUTHOR
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment