Article 158628 of comp.os.vms:
Wayne Sewell wrote:
> 
> In article <32809AC3.6D6AEBC2@iue.tuwien.ac.at>, Christian Troger <troger@iue.tuwien.ac.at> writes:
> > As it seems the Volume Owner UIC of
> > a Disk must be set to [SYSTEM] for an
> > incremental backup to work
> > (i.e.  BACKUP/RECORD and BACKUP/SINCE=BACKUP)
> >
> $ help set vol /own
> SET
> 
>   VOLUME
> 
>     /OWNER_UIC
> 
>           /OWNER_UIC[=uic]
> 
>        Sets the owner user identification code (UIC) of the volume
[snip]

This works, but it is incomplete.  I had this problem some time ago and
got the following from Carl.  [See, he is still able to make useful
contributions to this group!]

:However, you can use the SET VOLUME/OWNER_UIC to change the ownership of the
:volume.  When you do that, don't forget to use SET FILE/OWNER to change the
:ownership of the files in [000000].  Well, almost all the files in [000000]. 
:Y'see, there's a catch-22 here:  In order to use SET FILE/OWNER, you've got
:to have the disk mounted.  When you mount the disk, you automatically open
:[000000]INDEXF.SYS.  And you can't change the ownership with the SET FILE/OWNER
:command while the file's open.  If you want to change the ownership of
:INDEXF.SYS, you MAY be able to do so via calls to the ACP/QIO interface.  If
:that doesn't work, then you'll have to manually modify the file header and the
:alternate file header for INDEXF.SYS to reflect the desired owner of that file. 
:Doing that is undocumented and unsupported, but not terribly difficult.

He then sent me this to change the ownership of INDEXF.SYS:

:Well, as I said, it's not difficult to do.  Here are two ways to do it.  One in
:DCL, the other, considerably faster, in FORTRAN.  You'll have to change the
:places where I've hard-wired in the name of the device in the index file name.

Here are the two programs he sent me:

$       OPEN/READ/WRITE/SHARE=WRITE FILE PDA0:[000000]INDEXF.SYS
$       READ FILE HOMEBLOCK
$       READ FILE HOMEBLOCK
$       CLUSTER = F$CVUI(0,16,F$EXTRACT(14,2,HOMEBLOCK))
$       ALTIDXVBN = F$CVUI(0,16,F$EXTRACT(20,2,HOMEBLOCK))
$       IBMAPVBN = F$CVUI(0,16,F$EXTRACT(22,2,HOMEBLOCK))
$       MAXFILES = F$CVUI(0,32,F$EXTRACT(28,4,HOMEBLOCK))
$       BMAPLEN = (MAXFILES + 4095)/4096
$       IDXVBN $ LBL0: READ FILE HEADER
$       N = N + 1
$       IF N .LT. ALTIDXVBN THEN GOTO LBL0
$       CALL FXHD "alternate index file header."
$ LBL1: READ FILE HEADER
$       N = N + 1
$       IF N .LT. IDXVBN THEN GOTO LBL1
$       CALL FXHD "index file header."
$       CLOSE FILE
$       EXIT
$ FXHD: SUBROUTINE
$       HEADER = F$EXTRACT(0,60,HEADER) + WORDONE + WORDONE + -
                F$EXTRACT(64,446,HEADER)
$       WRITE SYS$OUTPUT F$LENGTH(HEADER)
$       CKSM = 0$       CKSM = CKSM .AND. %X0000FFFF
$       CHECKSUM[0,16] = CKSM
$       HEADER = HEADER + CHECKSUM
$       WRITE SYS$OUTPUT F$LENGTH(HEADER)
$       WRITE SYS$OUTPUT "Updating ", P1
$       WRITE/SYMBOL/UPDATE FILE HEADER
$       EXIT

        BYTE HOMEBLOCK(512)
        INTEGER*2 CLUSTER, ALTIDXVBN, IBMAPVBN, BMAPLEN, IDXVBN, CHECKSUM,
        1       HEADER(256)
        INTEGER*4 MAXFILES, CKSM
        EQUIVALENCE (CLUSTER, HOMEBLOCK(15)), (ALTIDXVBN, HOMEBLOCK(21)),
        1       (IBMAPVBN, HOMEBLOCK(23)), (MAXFILES, HOMEBLOCK(29)),
        2       (CKSM, CHECKSUM)

        OPEN(UNIT=1, FILE='PDA0:[000000]INDEXF.SYS', ACCESS='DIRECT',
        1       SHARED, FORM='UNFORMATTED', STATUS='OLD')
C  Read the volume home block and figure out where to find the headers we want
        READ(1'2) HOMEBLOCK
        BMAPLEN = (MAXFILES + 4095)/4096
        IDXVBN = IBMAPVBN + BMAPLEN
        TYPE *, ' Index file header is VBN ', IDXVBN
        TYPE *, ' Alternate index file header is VBN ', ALTIDXVBN
C  Get the alternate index file header
        READ(1'ALTIDXVBN) HEADER
C  Here we set the member and group fields in the fil's owner UIC
        HEADER(31) = 1
        HEADER(32) = 1
        CKSM = 0
C Now recompute the file header checksum
        DO 10 I = 1, 255
10      CKSM = CKSM + HEADER(I)
        HEADER(256) = CHECKSUM
C And update the alternate index file header
        WRITE(1'ALTIDXVBN) HEADER
C Now do the same for th index file header
        READ(1'IDXVBN) HEADER
        HEADER(31) = 1
        HEADER(32) = 1
        CKSM = 0
        DO 20 I = 1, 255
20      CKSM = CKSM + HEADER(I)
        HEADER(256) = CHECKSUM
        WRITE(1'IDXVBN) HEADER
        END



--
-------------------------------------------------------------------------------
Stan Schwarz                |     "I just want to live like Yogi Bear
stan@bombay.gps.caltech.edu |        He kicks ass on the average bear."
---------------------------------------------------- -Stukas Over Bedrock -----


