common_prolog(as, &state);
common_volop_prolog(as, &state);
+ if (state.vop->partName==0 || *(state.vop->partName)==0) {
+ fprintf(stderr, "required argument -partition not given\n");
+ return -1;
+ }
do_volop(&state, FSYNC_VOL_ON, NULL);
return 0;
Volume * vp;
Error error;
+ /* Verify the partition name is null terminated. */
if (SYNC_verifyProtocolString(vcom->vop->partName, sizeof(vcom->vop->partName))) {
res->hdr.reason = SYNC_REASON_MALFORMED_PACKET;
code = SYNC_FAILED;
/* so, we need to attach the volume */
#ifdef AFS_DEMAND_ATTACH_FS
+ /* Verify the partition name is not empty. */
+ if (*vcom->vop->partName == 0) {
+ res->hdr.reason = FSYNC_BAD_PART;
+ code = SYNC_FAILED;
+ goto done;
+ }
+
/* check DAFS permissions */
vp = VLookupVolume_r(&error, vcom->vop->volume, NULL);
if (vp &&
V_VOLUPD);
if (vp)
VPutVolume_r(vp);
+#endif /* !AFS_DEMAND_ATTACH_FS */
if (error) {
code = SYNC_DENIED;
res->hdr.reason = error;
}
-#endif /* !AFS_DEMAND_ATTACH_FS */
done:
return code;