throbber
adm.c
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 1
`
`

`
`C:\cfs-1.3.3\adm.c
`
`kO<XJQO\U'|vbUJ[\Ji-'
`
`I-' O
`i-' i-'
`
`i-' l\.)
`
`I-' OJ
`i-' vb
`
`i-' U'|
`i-' ON
`I-' Q
`I-' (D
`i-' KO
`[\J O
`l\.) I-'
`
`[\J [\J
`
`[\J Us)
`l\.) vb
`
`[\.) U'|
`[\J ON
`I\.) Q
`
`[\J (D
`l\.) KO
`Us) O
`(A) I-'
`Us) I\.)
`
`UJ Us)
`(A) vb
`
`UJ U'|
`
`UJ OW
`UJ Q
`Us) (D
`
`(A) KO
`vb O
`41
`
`42
`
`43
`44
`
`45
`
`46
`47
`
`/9:
`* The author of this software is Matt Blaze.
`
`*
`
`Copyright
`
`(c) 1992, 1993,
`
`* Permission to use, copy, and modify this
`
`1994 by AT&T.
`software without fee
`
`* is hereby granted, provided that this entire notice is included in
`
`* all copies of any software which is or includes a copy or
`* modification of this software and in all
`
`copies of the supporting
`
`* documentation for such software.
`
`* This software is subject to United States export controls.
`
`* THIS SOFTWARE IS BEING PROVIDED
`
`HAS Isl! I WITHOUT ANY EXPRESS OR IMPLIED
`IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY
`* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
`
`* WARRANTY.
`
`* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
`
`* support for client adm functions
`*/
`#include <stdio.h>
`
`#include <rpc/rpc.h>
`
`#include "nfsproto.h"
`
`#include "admproto.h"
`#include "cfs.h"
`
`#define MAXADMERR 7
`
`char *admerrs[]
`"no error",
`
`= {
`
`/* O */
`
`"permission denied",
`
`/* 1 */
`
`"too many attached directories",/* 2 */
`"no such attached name",
`/* 3 */
`
`"name already attached",
`
`/* 4 */
`
`"no such encrypted directory",
`
`/* 5 */
`
`"incorrect passphrase".
`
`/* 6 */
`
`"badly formed name"
`
`/* 7 */
`
`};
`
`char *admmsg(e)
`int e;
`
`{
`
`}
`
`(e<O))
`||
`if ((e>MAXADMERR)
`return "unknown error";
`
`return admerrs[e];
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 2
`
`

`
`admproto.x
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 3
`
`

`
`C:\cfs-1.3.3\admproto.x
`
`1
`2
`
`3
`
`4
`
`5
`
`6
`
`7
`8
`9
`
`10
`11
`
`12
`
`13
`14
`
`15
`
`16
`17
`
`18
`
`19
`
`20
`
`21
`22
`23
`
`24
`
`25
`26
`
`27
`
`28
`
`29
`
`30
`
`/*
`* The author of this software is Matt Blaze.
`
`*
`
`Copyright
`
`(c) 1992, 1993, 1994, 1995 by AT&T.
`
`* Permission to use, Copy, and modify this software without fee
`
`* is hereby granted, provided that this entire notice is included in
`
`* all copies of any software which is or includes a copy or
`
`* modification of this software and in all copies of the supporting
`* documentation for such software.
`*
`
`* This software is subject to United States export controls.
`*
`
`* THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
`
`IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY
`* WARRANTY.
`* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
`
`* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
`
`*/
`
`/*
`
`* cfs admin protocol RPC spec
`
`1.3.2 version, supporting multiple crypt modes & new ciphers, plus sflg
`
`and three—key 3des.
`
`*
`
`*
`*/
`
`/* error conditions */
`
`enum cfsstat {
`CFS_OK=O,
`
`/* ok */
`
`CFSERR_PERM=1,
`
`/* permission denied */
`
`CFSERR_IFULL=2,
`
`/* instance table full; */
`
`CFSERR_NOINS=3,
`
`/* no such instance */
`
`CFSERR_EXIST=4,
`
`/* name already in use */
`
`31
`
`32
`
`33
`
`34
`35
`
`36
`37
`
`38
`
`39
`
`40
`
`41
`
`42
`
`43
`
`44
`
`45
`46
`
`47
`
`48
`49
`
`50
`
`51
`
`52
`53
`
`54
`
`CFSERR_NODIR=5,
`
`/* no such directory */
`
`CFSERR_BADKEY=6,
`
`/* invalid key */
`
`CFSERR_BADNAME=7
`
`/* badly formed name */
`
`};
`
`enum ciphers {
`CFS_STD_DES=O,
`
`/* 2 key hybrid single DES */
`
`CFS_THREE_DES=1,
`
`/* 2 key hybrid 3DES */
`
`CFS_IDEA=2,
`
`/* 2 key hybrid IDEA (n/a) */
`
`CFS_BLOWFISH=3,
`
`/* 2 key hybrid BLOWFISH */
`
`CFS_SKIPJACK=4,
`
`/* 2 key hybrid SKIPJACK,
`
`(PCMCIA)
`
`(n/a) */
`
`CFS_MACGUFFIN=5,
`
`/* 1 key hybrid MacGuffin */
`
`CFS_SAFER_SK128=6,
`
`/* 1 key hybrid SAFER-SK128 */
`
`CFS_TRUE_THREE_DES=7
`
`/* 3 key hybrid 3DES */
`
`};
`
`const CFS_MAXCOMP=255;
`
`const CFS_MAXNAME=1024;
`
`struct cfs_adm_deskey {
`long pl;
`/* for the align police */
`
`u_char primary[8];
`
`'1'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 4
`
`

`
`C:\cfs-1.3.3\admproto.x
`
`55
`
`56
`57
`
`58
`59
`
`60
`
`61
`
`62
`
`63
`
`64
`65
`
`66
`67
`
`68
`
`69
`
`70
`
`71
`72
`
`73
`
`74
`75
`
`76
`77
`
`78
`
`79
`
`so
`81
`
`82
`83
`
`84
`
`85
`
`86
`87
`
`88
`
`89
`90
`
`91
`
`92
`
`93
`94
`
`95
`96
`
`97
`
`98
`
`99
`100
`
`101
`
`102
`
`103
`104
`
`105
`
`106
`
`107
`108
`
`u_char secondary[8];
`
`};
`
`struct cfs_adm_3deskey {
`long pl;
`/* for the align police */
`
`u_char primary1[8];
`
`u_char primary2[8];
`
`u_char secondary1[8];
`
`/* same as primaries */
`
`u_char secondary2[8];
`
`};
`
`struct cfs_adm_t3deskey {
`long pl;
`/* for the align police */
`
`u_char primary1[8];
`
`u_char primary2[8];
`
`u_char primary3[8];
`
`u_char secondary1[8];
`u_char secondary2[8];
`
`u_char secondary3[8];
`
`};
`
`/* same as primaries */
`
`struct cfs_adm_blowkey {
`long pl;
`/* for 32 bit police */
`
`u_char primary[16];
`
`u_char secondary[16];
`
`/* same as primary */
`
`};
`
`struct cfs_adm_mcgkey {
`long pl;
`/* for 32 bit align police */
`
`u_char primary[16];
`
`u_char secondary[16];
`
`/* same as primary */
`
`};
`
`struct cfs_adm_saferkey {
`long pl;
`/* for 32 bit align police */
`
`u_char primary[16];
`
`u_char secondary[16];
`
`/* same as primary */
`
`};
`
`union cfs_admkey switch (ciphers cipher)
`case CFS_STD_DES:
`
`{
`
`cfs_adm_deskey deskey;
`
`case CFS_THREE_DES:
`
`cfs_adm_3deskey des3key;
`Case CFS_BLOWFISH:
`
`cfs_adm_blowkey blowkey;
`
`Case CFS_MACGUFFIN:
`
`cfs_adm_mcgkey mcgkey;
`case CFS_SAFER_SK128:
`
`cfs_adm_saferkey saferkey;
`
`case CFS_TRUE_THREE_DES:
`
`cfs_adm_t3deskey tdes3key;
`default:
`
`'2'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 5
`
`

`
`C:\cfs-1.3.3\admproto.x
`
`Void;
`
`};
`
`struct cfs_attachargs {
`string dirname<CFS_MAXNAME>;
`
`/* directory to attach to */
`
`string name<CFS_MAXCOMP>;
`
`/* instance name */
`
`cfs_admkey key;
`int uid;
`
`/* key to use */
`/* uid to apply — need not be
`
`same as in rpc */
`
`int highsec;
`
`/* nonzero for highsec mode */
`
`/* anonymousness */
`bool anon;
`/* for timeouts, zero indicates infinite */
`
`int expire;
`int idle;
`
`int smsize;
`
`};
`
`/* number of minutes to live */
`/* idle timeout */
`
`/* use small memeory option */
`
`struct cfs_detachargs {
`/* instance name */
`string name<CFS_MAXCOMP>;
`int uid;
`/* just has to match */
`
`};
`
`program ADM_PROGRAM {
`
`Version ADM_VERSION {
`Void ADMPROC_NULL(VOid)
`
`= O;
`
`cfsstat ADMPROC_ATTACH(cfs_attachargs)
`
`= 1;
`
`cfsstat ADMPROC_DETACH(cfs_detachargs)
`
`= 2;
`
`} = 2;
`
`} = 0x41234567;
`
`109
`
`110
`111
`
`112
`113
`
`114
`
`115
`116
`
`117
`
`118
`
`119
`120
`
`121
`122
`
`123
`
`124
`125
`
`126
`127
`128
`
`129
`130
`
`131
`
`132
`
`133
`134
`
`135
`
`136
`
`137
`
`138
`139
`
`140
`141
`
`142
`
`'3'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 6
`
`

`
`cattach. 1
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 7
`
`

`
`C:\cfs-1.3.3\cattach.1
`
`1
`
`2
`
`3
`4
`
`5
`
`6
`
`7
`
`8
`
`9
`
`10
`11
`12
`
`13
`
`14
`
`15
`
`16
`
`17
`
`18
`
`19
`
`20
`
`21
`
`22
`
`23
`24
`
`25
`
`26
`27
`
`28
`
`29
`
`30
`
`31
`
`32
`
`33
`
`34
`
`35
`36
`
`37
`38
`39
`
`.TH CATTACH l ""
`
`.SH NAME
`
`cattach — attach encrypted directory to CFS
`.SH SYNOPSIS
`
`.B cattach
`
`[ \-\fBl\fP ]
`
`[ \‘\fB-\fP ]
`
`[ \-\fBt\fP \fIminutes\fP]
`
`[ \-\fBi\fP \fIminutes\fP]
`
`\fIdirectory\fP
`\fIname\fP
`.SH DESCRIPTION
`
`\fBcattach\fP associates the encrypted \fIdirectory\fP (previously
`
`created with \fBcmkdir(1)\fP) with the specified \fIname\fP.
`
`\fBcattach\fP prompts for a passphrase, which is used to generate
`
`cryptographic keys sent to the cfs daemon \fBcfsd\fP(8) and used to
`
`transparently encrypt and decrypt the files as needed.
`
`If the correct
`
`passphrase is given (as verified by a known—plaintext hash file in the
`
`encrypted directory),
`
`the user may thereafter access the cleartext of
`
`the files in a virtual directory called \fIname\fP under the CFS mount
`
`point
`
`(usually /crypt). Otherwise, no virtual directory is created.
`
`The underlying \fIdirectory\fP may be specified either as an absolute
`
`path or relative to the current directory.
`.LP
`
`The smartcard version of the command is similar in operation, but also
`
`requires a CFS smartcard be present in the smartcard reader.
`.LP
`
`If the \fB—l\fP ("lower security mode") option is given, newly created
`
`identical files will encrypt to identical ciphertexts. Otherwise,
`
`the
`
`creation time plus the inode number of the encrypted file is used to
`
`perturb each file, frustrating certain cryptanalytic attacks. Under
`
`highly concurrent operation with multiple instances of the same
`
`encrypted directory, however,
`
`lower security mode may be required to
`
`avoid some race conditions. This mode also makes recovery (from
`
`backups) of individual encrypted files a bit simpler.
`.LP
`
`Note that attached virtual directories may be used only by users whose
`UID is the same as the issuer of the \fBcattach\fP command.
`.LP
`
`40 Ordinarily,
`
`the names of all currently attached directories can be
`
`41
`
`42
`
`obtained by listing the contents of /crypt (e.g., with \fBls\fP(1)).
`
`If the specified \fIname\fP begins with a '.'
`
`(dot), however, cfsd
`
`43 will not
`
`include the name in directory listings.
`
`By using a
`
`44
`
`45
`
`hard—to—guess \fIname\fP,
`
`this mechanism can be used to provide some
`
`protection against attackers who can spoof the UID on the client
`
`46 machine.
`47
`.LP
`
`See the \fBssh\fP(1)
`
`command for an example of this usage.
`
`48
`
`49
`50
`
`51
`
`52
`
`53
`54
`
`The \fB—t\fP option causes the attach to automatically go away after
`
`The \fB—i\fP option deletes the
`the specified number of minutes.
`attach after a specified number of minutes of inactivity. Note that
`
`these options, if used, should be chosen with some care;
`
`too short
`
`timeouts may actually increase the risk of compromise of frequently
`
`re—typed passphrases.
`.LP
`
`'1'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 8
`
`

`
`C:\cfs-1.3.3\cattach.1
`
`55
`
`56
`57
`58
`
`\fBcattach\fP will normally attempt to read the passphrase from the
`
`tty device (/dev/tty) and will not echo.
`\fBcattach\fP to read from stdin.
`.LP
`
`The \fB——\fP options forces
`
`59 Virtual directories should be removed with the \fBcdetach\fP(l)
`
`60
`61
`
`62
`
`63
`
`64
`
`65
`66
`
`67
`
`68
`
`69
`
`70
`71
`
`72
`
`73
`
`command when no longer in use.
`.SH EXAMPLES
`
`.TP
`
`cattach /u/mab/secrets mab
`
`associates encrypted directory "/u/mab/secrets" with the
`
`cleartext name "mab". Creates virtual directory "/crypt/mab".
`.TP
`
`cattach /u/mab/secrets .l23xyzzy
`
`associates encrypted directory "/u/mab/secrets" with the cleartext
`
`name ".l23xyzzy".
`
`The cleartext name will not appear in a listing of
`
`/crypt.
`.TP
`
`cattach —l secrets mab
`
`associates the encrypted directory "secrets" in the current directory
`
`74 with the cleartext name "mab".
`
`Identical files will encrypt to the
`
`75
`76
`
`77
`
`78
`
`79
`80
`
`81
`82
`
`83
`
`84
`
`85
`
`86
`87
`
`88
`
`89
`90
`
`91
`
`92
`
`93
`
`94
`
`95
`96
`
`97
`
`98
`99
`
`same ciphertext.
`.SH FILES
`
`.TP
`
`/crypt/*
`
`currently attached cleartext instances
`.SH SEE ALSO
`
`cfsd(8), cdetach(l), cmkdir(l), ssh(l)
`.SH BUGS
`
`Really, really slow machines can time out on the RPC before cfsd is
`
`finished processing the attach command, especially when 3—DES is used.
`
`Such machines should probably be considered too slow to be running an
`
`encrypted file system anyway.
`.LP
`
`You can't attach an already encrypted directory,
`
`lest the
`
`single—threaded cfsd find itself in a deadlock.
`.LP
`
`There really should be a better security mechanism than the UID to
`
`protect against spoofing currently attached directories.
`
`The .name
`
`hack is an ugly kludge.
`
`In particular, it would be better to limit
`
`access to the process group of the user who issued the cattach
`
`command. Unfortunately,
`.LP
`
`that information is not passed to cfsd.
`
`The timeout isn't perfect, and may occur a minute or two later than
`
`expected.
`.SH AUTHOR
`
`100 Matt Blaze; for information on cfs, email to cfs@research.att.com.
`101
`
`'2'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 9
`
`

`
`cattach.c
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 10
`
`

`
`C:\cfs-1.3.3\cattach.c
`
`1
`2
`
`3
`
`4
`
`5
`
`6
`
`7
`8
`9
`
`10
`11
`
`l2
`
`l3
`l4
`
`15
`
`16
`17
`
`18
`19
`
`20
`21
`
`22
`
`23
`24
`
`25
`26
`
`27
`
`28
`
`29
`
`30
`31
`
`32
`33
`34
`
`35
`
`36
`37
`
`38
`39
`40
`
`41
`
`42
`43
`44
`
`45
`
`46
`
`47
`48
`
`49
`50
`
`51
`52
`
`53
`54
`
`/*
`* The author of this software is Matt Blaze.
`
`*
`
`Copyright
`
`(c) 1992, 1993, 1994, 1995 by AT&T.
`
`* Permission to use, Copy, and modify this software without fee
`
`* is hereby granted, provided that this entire notice is included in
`
`* all copies of any software which is or includes a copy or
`
`* modification of this software and in all copies of the supporting
`* documentation for such software.
`*
`
`* This software is subject to United States export controls.
`*
`
`* THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
`
`IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY
`* WARRANTY.
`* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
`
`* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
`
`*/
`
`/*
`* client side attach — 1.3.2
`
`*/
`#include <stdio.h>
`
`#include <rpc/rpc.h>
`
`#include <sys/time.h>
`#ifdef irix
`
`#include <sys/statfs.h>
`#else
`
`#ifndef BSD44
`
`#ifdef ultrix
`
`#include <sys/param.h>
`
`#include <sys/mount.h>
`#else
`
`#include <sys/vfs.h>
`#endif
`/* ultrix */
`#else
`
`#ifndef MAXHOSTNAMELEN
`
`#include <sys/param.h>
`#endif
`
`#include <sys/mount.h>
`#endif
`/* BSD44 */
`#endif
`
`#include "nfsproto.h"
`
`#include "admproto.h"
`#include "cfs.h"
`
`#ifdef SOLARIS2X
`
`/* NOTE! delete the #define statfs below if this won't compile on
`
`your solaris configuration */
`#define statfs
`statvfs
`
`#endif
`
`#ifndef TMOUT
`#define TMOUT O
`
`#endif
`
`/* default timeout; override in makefile */
`
`'1'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 11
`
`

`
`C:\cfs-1.3.3\cattach.c
`
`#ifndef IDLE
`#define IDLE 0
`
`#endif
`
`55
`56
`
`57
`58
`
`59 main(argc,argV)
`
`/* default idle timer; override in makefile */
`
`60
`
`61
`
`62
`63
`64
`
`65
`66
`
`67
`68
`
`69
`70
`
`71
`72
`
`73
`
`74
`75
`
`76
`
`77
`
`78
`
`79
`80
`
`81
`82
`
`83
`84
`
`85
`
`86
`
`87
`88
`
`89
`
`90
`
`91
`92
`
`93
`94
`
`95
`
`96
`97
`
`98
`99
`
`100
`101
`
`102
`
`103
`
`104
`105
`
`106
`107
`108
`
`int argc;
`
`char **argv;
`
`{
`
`cfs_attachargs ap;
`char *pw;
`
`char pword[256];
`int n;
`
`int status;
`cfsstat ret;
`
`char *getpassword();
`char dir[1024]; char buf[1024];
`
`char ins[1024];
`#ifdef ultrix
`
`struct fs_data sfb;
`
`#define f_b1ocks
`#else
`
`fd_req.btot
`
`struct statfs sfb;
`
`#endif
`
`char *f1g;
`
`int ciph;
`FILE *fp;
`
`unsigned char ekey[128];
`char cname[1024];
`
`/* indirect key file */
`
`char kname[1024];
`char sname[1024];
`
`int smsize;
`
`int cfmt=0;
`
`static struct timeval tout = {60,0};
`CLIENT *Cln;
`
`int timeout=TMOUT;
`
`int id1e=IDLE;
`
`char *dirarg=NULL;
`char *namearg=NULL;
`
`int keycheck=1;
`
`ap.highsec=1;
`
`while (——argc) if (**++argV == '-') {
`for (f1g= ++*argv; *f1g; ++f1g)
`
`switch (*f1g)
`case '1':
`
`{
`
`ap.highsec=0;
`break;
`
`case 't':
`
`/* absolute timeout */
`
`case 'i':
`
`/* idle timer */
`
`enq(*f1g);
`break;
`
`case '—':
`keycheck=0;
`break;
`
`/* read key from stdin */
`
`'2'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 12
`
`

`
`C:\cfs-1.3.3\cattach.c
`
`cattach [-1]
`
`[—t
`
`timeout] -i
`
`[idle] dir name\n");
`
`cattach [-1]
`
`[—t
`
`timeout] -i
`
`[idle] dir name\n");
`
`default:
`
`fprintf(stderr,"usage:
`exit(1);
`
`}
`
`} else {
`
`switch (deq())
`case -1:
`
`{
`
`if (dirarg==NULL)
`
`dirarg = *argV;
`
`else if (namearg==NULL)
`namearg = *argv;
`
`else {
`fprintf(stderr,"usage:
`exit(1);
`
`break;
`case
`ltl:
`
`timeout =
`
`break;
`case 'i':
`
`atoi(*argv);
`
`idle =
`
`atoi(*argv);
`
`break;
`default:
`
`/* should never happen */
`internal error\n");
`
`fprintf(stderr,"cattach:
`eXit(l);
`
`} i
`
`} i
`
`||
`f ((dirarg==NULL)
`(namearg==NULL))
`cattach [-1]
`fprintf(stderr,"usage:
`eXit(l);
`
`{
`
`[—t
`
`timeout]
`
`[—i idle] dir name\n");
`
`f (*dirarg!='/') {
`if (getcwd(buf,lO24) ==
`
`{
`NULL)
`fprintf(stderr,"Can't stat current directory\n");
`eXit(l);
`
`}
`sprintf(dir,"%s/%s",buf,dirarg);
`
`} else
`strcpy(dir,dirarg);
`
`{
`if (chdir(dir)<O)
`perror(dirarg);
`exit(1);
`
`}
`#ifdef irix
`
`/* or
`(I hope) more or less any system with the 4 parameter statfs */
`if ((statfs(".",&sfb,sizeof sfb,O)<O)
`
`{
`(sfb.f_blocks==O))
`can't attach to a crypted directory\n");
`
`fprintf(stderr,"Sorry,
`eXit(l);
`
`}
`#else
`
`||
`if ((statfs(".",&sfb)<O)
`fprintf(stderr,"Sorry,
`eXit(l);
`
`{
`(sfb.f_blocks==O))
`can't attach to a crypted directory\n");
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 13
`
`109
`
`110
`111
`
`112
`
`113
`114
`
`115
`
`116
`117
`
`118
`
`119
`
`120
`121
`
`122
`
`123
`124
`
`125
`
`126
`127
`
`128
`
`129
`
`130
`
`131
`
`132
`
`133
`
`134
`
`135
`
`136
`
`137
`
`138
`
`139
`
`140
`141
`
`142
`
`143
`144
`
`145
`
`146
`147
`
`148
`
`149
`
`150
`
`151
`
`152
`
`153
`
`154
`
`155
`
`156
`
`157
`
`158
`
`159
`
`160
`
`161
`
`162
`
`

`
`C:\cfs-1.3.3\cattach.c
`
`163
`
`164
`
`165
`
`166
`
`167
`
`168
`
`169
`170
`171
`
`172
`
`173
`
`174
`175
`176
`
`177
`178
`
`179
`180
`
`181
`
`182
`
`183
`184
`
`185
`
`186
`
`187
`
`188
`189
`
`190
`191
`
`192
`
`193
`
`194
`195
`
`196
`197
`
`198
`199
`
`200
`
`201
`
`202
`203
`
`204
`205
`206
`
`207
`
`208
`209
`
`210
`211
`
`212
`
`213
`
`214
`215
`
`216
`
`#endif
`
`ap.dirname=dir;
`
`strcpy(ins,namearg);
`
`*namearg='\0';
`
`/* weak attempt to hide .instance in ps output */
`
`ap.name=ins;
`
`if (keycheck)
`
`{
`
`{
`if ((pw=getpassword("Key:"))==NULL)
`fprintf(stderr,"Can't get key\n");
`exit(1) ;
`
`}
`
`} else {
`
`if (fgets(pword,256,stdin) == NULL)
`perror("cmkdir");
`exit(1) ;
`
`{
`
`}
`pw=pword;
`
`pw[255]='\0';
`n=str1en(pw);
`
`if ((n>0) && (pw[n—1] == '\n'))
`
`pw[n—1]
`
`=
`
`'\O';
`
`}
`
`sprintf(cname,"%s/..c",dir);
`
`sprintf(kname,"%s/..k",dir);
`
`sprintf(sname,"%s/..s",dir);
`
`if ((fp=fopen(cname,"r")) == NULL)
`ciph=CFS_STD_DES;
`
`{
`
`} else {
`fscanf(fp,"%d",&ciph);
`
`fc1ose(fp);
`
`}
`
`if ((fp=fopen(kname,"r")) == NULL)
`cfmt=0;
`
`{
`
`} else {
`cfmt=1;
`
`if (fread(ekey,32.1,fp) < 0)
`cfmt=0;
`
`fc1ose(fp);
`
`}
`
`if ((fp=fopen(sname,"r")) == NULL)
`smsize=LARGESMSIZE;
`
`{
`
`} else {
`if (fscanf(fp,"%d",&smsize)
`smsize=LARGESMSIZE;
`
`!= 1)
`
`fc1ose(fp);
`
`if ((smsize < CFSBLOCK)
`smsize=LARGESMSIZE;
`
`}
`ap.smsize = smsize;
`
`ap.id1e = idle;
`
`ap.expire = timeout;
`
`||
`
`(smsize >
`
`(LARGESMSIZE*2)))
`
`ap.key.cipher=ciph;
`if (smsize != LARGESMSIZE)
`
`sprintf(pw,"%s%d",pw.smsize);
`
`'4'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 14
`
`

`
`C:\cfs-1.3.3\cattach.c
`
`217
`
`218
`
`219
`220
`221
`
`222
`223
`
`224
`
`225
`
`226
`227
`228
`
`229
`
`230
`231
`
`232
`
`233
`
`234
`235
`236
`
`237
`238
`
`239
`
`240
`241
`242
`
`243
`244
`245
`246
`
`247
`248
`
`249
`
`250
`251
`252
`
`253
`
`254
`255
`
`256
`257
`
`258
`259
`
`260
`
`261
`262
`263
`
`264
`265
`
`266
`267
`
`268
`
`269
`270
`
`if (cfmt)
`
`{
`
`{
`if (new_pwcrunch(pw,&ap.key)!=O)
`fprintf(stderr,"InVa1id key\n");
`eXit(l);
`
`}
`decrypt_key(&ap.key,ekey);
`
`}
`
`else {
`
`{
`if (o1d_pwcrunch(pw,&ap.key !=O)
`fprintf(stderr,"InVa1id key\n");
`exit(1);
`
`}
`
`}
`ap.anon = ap.name[O]=='.';
`
`ap.uid=getuid();
`
`if ((c1n=c1nt_create("localhost",ADM_PROGRAM,ADM_VERSION,"udp"))
`
`{
`== NULL)
`c1nt_pcreateerror("adm");
`exit(1);
`
`}
`cln->c1_auth = authunix_create_defau1t();
`
`if ((status = c1nt_ca11(c1n,ADMPROC_ATTACH,xdr_cfs_attachargs,&ap,
`
`xdr_cfsstat,&ret,tout))
`c1nt_perrno(status);
`eXit(l);
`
`!= RPC_SUCCESS)
`
`{
`
`}
`if (ret!=CFS_OK)
`fprintf(stderr,"cattach: %s\n",admmsg(ret));
`exit(ret);
`
`}
`
`#define QS 5
`
`struct {
`
`int data[QS];
`int head;
`
`int tail;
`
`} argq = {{O}.0.0};
`
`enq(f)
`char f;
`
`{
`
`}
`
`argq.tai1++;
`
`argq.tai1 %= Q8;
`
`{
`if (argq.head==argq.tai1)
`fprintf(stderr,"Can't deal with this\n");
`exit(-2);
`
`}
`argq.data[argq.tai1]=f;
`
`deq()
`
`{
`
`if (argq.head==argq.tai1)
`
`'5'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 15
`
`

`
`C:\cfs-1.3.3\cattach.c
`
`271
`
`272
`
`273
`
`274
`
`275
`276
`
`}
`
`return -1;
`
`argq.head++;
`
`argq.head %= Q8;
`
`return(argq.data[argq.head]);
`
`'5'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 16
`
`

`
`ccat. 8
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 17
`
`

`
`C:\cfs-1.3.3\ccat.8
`
`1
`
`2
`
`3
`
`4
`
`5
`
`6
`
`7
`8
`9
`
`10
`
`11
`
`12
`13
`
`14
`
`15
`
`16
`17
`
`18
`
`19
`
`20
`21
`
`22
`23
`
`24
`25
`
`26
`
`27
`
`28
`29
`
`.TH CCAT 8 ""
`
`.SH NAME
`
`ccat
`
`.SH SYNOPSIS
`
`.B ccat
`
`[
`
`\-\fB3ms\fP ]
`
`\fIfi1e\fP
`[
`... ]
`.SH DESCRIPTION
`
`\fBccat\fP prompts for a passphrase and decrypts (onto standard
`
`output)
`
`the specified CFS encrypted files.
`
`If a corresponding CFS IV
`
`file (.pvect_*) file exists in the same directory, it is used to
`perturb the file accordingly.
`By default, files are decrypted using
`
`standard 2—key hybrid mode single—DES.
`
`The \—\fB3\fP option specifies
`
`2—key hybrid mode triple DES.
`
`The \-\fBm\fP option specifies 1-key
`
`hybrid mode MacGuffin, and \-\fBs\fP specifies SAFER-SK128.
`.LP
`
`\fBccat\fP is intended to assist in emergency access to CFS
`
`directories when no machine running a CFS daemon is available.
`
`It is
`
`ordinarily used in conjunction with cname(8).
`.SH SEE ALSO
`
`cname(8)
`.SH BUGS
`
`Does not work with new format
`.LP
`
`(1.3 and later) directories.
`
`This program is just blindingly slow. There's no way to tell if an
`
`incorrect passphrase was entered, except that the program will produce
`
`garbage output.
`.SH AUTHOR
`
`30 Matt Blaze; for information on cfs, email to cfs@research.att.com.
`31
`
`32
`
`'1'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 18
`
`

`
`ccat. C
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 19
`
`

`
`C:\cfs-1.3.3\ccat.c
`
`/*
`* The author of this software is Matt Blaze.
`
`*
`
`Copyright
`
`(c) 1992, 1994 by AT&T.
`
`* Permission to use, Copy, and modify this software without fee
`
`* is hereby granted, provided that this entire notice is included in
`
`* all copies of any software which is or includes a copy or
`
`* modification of this software and in all copies of the supporting
`* documentation for such software.
`*
`
`* This software is subject to United States export controls.
`*
`
`* THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
`
`IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY
`* WARRANTY.
`* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
`
`* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
`
`*/
`
`/*
`* cfs ccat
`
`— 1.3
`
`*/
`#include <stdio.h>
`
`#include <rpc/rpc.h>
`
`#include <sys/time.h>
`
`#include <sys/file.h>
`
`#include <sys/stat.h>
`#ifdef SOLARIS2X
`
`#include <string.h>
`#define rindex strrchr
`
`#else
`
`#include <strings.h>
`#endif
`
`#include "nfsproto.h"
`
`#include "admproto.h"
`#include "cfs.h"
`
`/* following are never used — just so i can re—use the library */
`int Validhost;
`
`char zerovect[]={0,0,0,0,0,0,0,0,0};
`int cursecs=O;
`
`1
`2
`
`3
`
`4
`
`5
`
`6
`
`7
`8
`9
`
`10
`11
`
`12
`
`l3
`14
`
`15
`
`16
`17
`
`18
`19
`
`20
`21
`
`22
`
`23
`
`24
`
`25
`26
`
`27
`28
`
`29
`
`30
`31
`
`32
`
`33
`34
`35
`
`36
`37
`
`38
`39
`40
`
`41 main(argc,argv)
`
`42
`
`43
`
`44
`45
`
`46
`
`47
`
`48
`49
`
`50
`
`51
`52
`
`53
`
`54
`
`int argc;
`
`char **argv;
`
`{
`
`char *pw;
`
`char pword[256];
`
`char *getpassword();
`
`cfs_admkey k;
`cfskey kt;
`
`char *flg;
`
`char *p;
`char iVfile[1O24];
`
`char base[1024];
`
`char iV[16];
`
`'1'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 20
`
`

`
`C:\cfs-1.3.3\ccat.c
`
`55
`
`56
`
`57
`
`58
`
`59
`
`60
`
`61
`62
`
`63
`
`64
`65
`
`66
`67
`
`68
`69
`70
`
`71
`72
`
`73
`74
`
`75
`76
`
`77
`78
`
`79
`80
`81
`
`82
`83
`84
`
`85
`86
`
`87
`
`88
`
`89
`90
`91
`
`92
`
`93
`94
`95
`
`96
`97
`
`98
`
`99
`100
`lOl
`
`102
`103
`104
`
`105
`
`106
`107
`108
`
`int fd;
`
`int len;
`
`int siz;
`
`int offset;
`
`int i;
`
`char *buf[8192];
`
`int Ciph=CFS_THREE_DES;
`
`fprintf(stderr,"WARNING: ccat works only on old format CFS fi1es\n");
`
`while (--argc && (**++argv == '—'))
`for (f1g= ++*argv; *f1g; ++f1g)
`
`{
`
`switch (*f1g)
`case '1':
`
`{
`
`#ifdef NOTDEF
`
`#endif
`
`ciph=CFS_STD_DES;
`break;
`case '3':
`
`Ciph=CFS_THREE_DES;
`break;
`
`case 'b':
`
`Ciph=CFS_BLOWFISH;
`break;
`
`case 'm':
`
`Ciph=CFS_MACGUFFIN;
`break;
`case 's':
`
`Ciph=CFS_SAFER_SKl28;
`break;
`default:
`
`fprintf(stderr,"usage: ccat
`exit(1);
`
`[—13bms] fi1e...\n");
`
`}
`
`}
`
`{
`if (argc<1)
`fprintf(stderr,"Usage: ccat
`exit(1);
`
`}
`
`[—3bms] fi1e...\n");
`
`{
`if ((pw=getpassword("Key:"))==NULL)
`fprintf(stderr,"Can't get key\n");
`exit(1);
`
`}
`strcpy(pword,pw);
`
`k.cipher=ciph;
`
`{
`if (o1d_pwcrunch(pw,&k)!=0)
`fprintf(stderr,"InVa1id key\n");
`eXit(l);
`
`}
`copykey(&k.&kt);
`kt.smsize=LARGESMSIZE;
`
`if (((kt.primask=(char*) ma1loc(kt.smsize)) == NULL)
`
`((kt.secmask=(char*) ma11oc(kt.smsize)) == NULL))
`||
`fprintf(stderr,"No memory\n");
`exit(2);
`
`{
`
`'2'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 21
`
`

`
`C:\cfs-1.3.3\ccat.c
`
`109
`110
`
`111
`112
`
`113
`
`114
`
`115
`116
`
`117
`
`118
`
`119
`120
`
`121
`
`122
`
`123
`124
`125
`
`126
`127
`
`128
`
`129
`130
`
`131
`
`132
`
`133
`
`134
`
`135
`
`136
`
`137
`
`138
`139
`
`140
`
`141
`
`142
`143
`144
`
`145
`146
`
`147
`
`148
`149
`
`}
`genmasks(&kt);
`
`{
`i++)
`i<argc;
`for (i=0;
`strcpy(iVfi1e,argV[i]);
`
`if ((p=rindex(iVfi1e.'/'))==NULL)
`
`sprintf(ivfi1e,".pvect_%s",argv[i]);
`
`else {
`*p='\O';
`
`strcpy(base,++p);
`
`sprintf(ivfi1e,"%s/.pvect_%s",ivfi1e,base);
`
`}
`if (read1ink(iVfi1e,iV,8)
`
`!= 8)
`
`bcopy(zerovect,iv,8);
`
`fprintf(stderr,"%s %s\n",ivfi1e,iv);
`
`if ((fd=open(argV[i],O_RDONLY,O))<O)
`perror(argv[i]);
`continue;
`
`{
`
`}
`1en=f1en(fd);
`
`fprintf(stderr,"%s %d\n",argv[i],1en);
`
`for (offset=O; offset<1en;){
`siz=1en—offset;
`
`if (siz>8192)
`
`Siz=8192;
`
`siz=readb1ock(buf,fd,offset,siz,&kt,iv);
`
`write(1,buf,siz);
`
`offset+=siz;
`
`}
`
`}
`
`}
`
`f1en(fd)
`
`int fd;
`
`{
`
`}
`
`struct stat sb;
`
`if (fstat(fd,&sb)<O)
`return -1;
`
`return dtov(sb.st_size);
`
`'3'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 22
`
`

`
`cdetach. 1
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 23
`
`

`
`C:\cfs-1.3.3\cdetach.1
`
`1
`
`2
`
`3
`4
`
`5
`
`6
`7
`
`8
`
`9
`10
`
`11
`12
`
`13
`
`14
`
`15
`16
`
`17
`18
`
`19
`
`20
`21
`
`.TH CDETACH 1 ""
`
`.SH NAME
`
`cdetach — detach encrypted directory from CFS
`.SH SYNOPSIS
`
`.B cdetach
`
`\fIname\fP
`.SH DESCRIPTION
`
`\fBcdettach\fP removes the instance called \fIname\fP of an encrypted
`
`The underlying
`directory (created with \fBcattach\fP(l)) from /crypt.
`encrypted version of the directory remains, of course, and may be
`
`attached again when needed with \fBcattach\fP(1).
`.SH EXAMPLE
`
`.TP
`
`cdetach mab
`
`deletes /crypt/mab
`.SH SEE ALSO
`
`cfsd(8), cattach(1)
`.SH BUGS
`
`Anyone can cdetach anything, even directories attached by other users.
`
`This can lead to irritating denial—of—service attacks.
`.SH AUTHOR
`
`22 Matt Blaze; for information on cfs, email to
`23
`cfs@research.att.com
`24
`
`'1'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 24
`
`

`
`cdetach.c
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 25
`
`

`
`C:\cfs-1.3.3\cdetach.c
`
`/*
`* The author of this software is Matt Blaze.
`
`*
`
`Copyright
`
`(c) 1992, 1993, 1994 by AT&T.
`
`* Permission to use, Copy, and modify this software without fee
`
`* is hereby granted, provided that this entire notice is included in
`
`* all copies of any software which is or includes a copy or
`
`* modification of this software and in all copies of the supporting
`* documentation for such software.
`*
`
`* This software is subject to United States export controls.
`*
`
`* THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
`
`IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY
`* WARRANTY.
`* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
`
`* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
`
`*/
`
`/*
`* client side detach
`
`*/
`#include <stdio.h>
`
`#include <rpc/rpc.h>
`
`#include "nfsproto.h"
`
`#include "admproto.h"
`#include "cfs.h"
`
`1
`2
`
`3
`
`4
`
`5
`
`6
`
`7
`8
`9
`
`10
`11
`
`l2
`
`l3
`14
`
`15
`
`16
`17
`
`18
`19
`
`20
`21
`
`22
`
`23
`
`24
`25
`26
`
`27 main(argc,argv)
`
`int argc;
`
`char **argv;
`
`cfs_detachargs ap;
`char *pw;
`int status;
`cfsstat ret;
`
`{
`if (argc!=2)
`fprintf(stderr,"Usage: cdetach name\n");
`exit(1);
`
`}
`ap.name=argv[1];
`
`ap.uid=getuid();
`
`if ((status = callrpc("localhost",ADM_PROGRAM,ADM_VERSION,
`
`ADMPROC_DETACH,xdr_cfs_detachargs,&ap,
`
`xdr_cfsstat,&ret))
`clnt_perrno(status);
`exit(1);
`
`!=O)
`
`{
`
`}
`if (ret!=CFS_OK)
`fprintf(stderr,"cdetach: %s\n",admmsg(ret));
`exit (ret) ;
`
`28
`
`29
`
`30
`31
`32
`33
`34
`35
`
`36
`37
`38
`
`39
`40
`
`41
`
`42
`
`43
`
`44
`45
`46
`
`47
`48
`49
`50
`
`51
`52
`
`{
`
`}
`
`'1'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 26
`
`

`
`cfs.c
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 27
`
`

`
`C:\cfs-1.3.3\cfs.c
`
`* *
`
`i-'OkOOJQO\U'|LbUJ[\Ji-'
`
`i-' i-'
`
`i-' l\.)
`
`i-' (A)
`i-' Lb
`
`i-' U'|
`i-' ON
`I-' Q
`i-' 03
`i-' KO
`[\J O
`l\.) I-'
`
`[\J [\J
`
`[\J Us)
`l\.) Lb
`
`[\.) U'|
`[\J ON
`I\.) Q
`
`[\J 03
`l\.) KO
`Us) O
`(A) I-'
`Us) I\.)
`
`UJ DJ
`UJ Lb
`
`Lo.) U'|
`
`UJ OW
`UJ Q
`Us) 03
`
`U.) KO
`Lb 0
`Lb i-'
`
`Lb [\.)
`
`Lb UJ
`Lb Lb
`
`Lb U'|
`Lb OW
`Lb Q
`
`Lb 03
`Lb KO
`U'| 0
`L11 i-'
`U'| [\.)
`
`U'| (L3
`L11 Lb
`
`/9:
`* The author of this software is Matt Blaze.
`
`Copyright
`COPY.
`Permission to use,
`
`(c)
`
`1992, 1993, 1994 by AT&T.
`and modify this software without fee
`
`* is hereby granted, provided that this entire notice is included in
`
`* all copies of any software which is or includes a copy or
`
`* modification of this software and in all copies of the supporting
`* documentation for such software.
`
`* This software is subject to United States export controls.
`
`* THIS SOFTWARE IS BEING PROVIDED
`
`HAS Isl! I WITHOUT ANY EXPRESS OR IMPLIED
`IN PARTICULAR, NEITHER THE AUTHORS NOR AT&T MAKE ANY
`* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
`
`* WARRANTY.
`
`* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
`
`* Crypto file system
`1.3
`* main
`
`* mab —
`
`* mab —
`
`* mab —
`
`11/30/92
`
`01/11/94
`
`11/10/94
`
`#include
`
`<stdio.h>
`
`#include
`
`#include
`
`<sys/types.h>
`
`<sys/file.h>
`
`#include
`
`<sys/socket.h>
`/* #include <netinet/in.h> */
`
`/* #include <arpa/inet.h> */
`<netdb.h>
`#include
`
`#include
`
`<rpc/rpc.h>
`
`#include
`
`<sys/time.h>
`#ifndef NORLIMITS
`
`#include
`
`#endif
`
`#include
`
`#include
`
`#include
`
`#include
`
`<sys/resource.h>
`
`<signal.h>
`
`"nfsproto.h"
`
`"admproto.h"
`"cfs.h"
`
`struct in_addr validhost;
`
`#if defined(SOLARIS2X)
`
`|| defined(__NetBSD__)
`
`Void nfs_program_2();
`
`void adm_program_2();
`#include
`<string.h>
`
`#else
`
`int nfs_program_2();
`
`int adm_program_2();
`#endif
`
`#ifdef _NetBsD
`
`int _rpcsvcdirty;
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 28
`
`

`
`C:\cfs-1.3.3\cfs.c
`
`#endif
`
`void grimreap();
`
`char zerovect[]={0,0,0,0,0,0,0,0,0};
`int cursecs;
`
`55
`56
`
`57
`58
`
`59
`60
`61
`
`62 main(argc,argV)
`
`63
`64
`
`65
`66
`67
`
`68
`
`69
`
`70
`71
`
`72
`
`73
`74
`
`75
`
`76
`
`77
`78
`79
`
`80
`
`81
`82
`83
`
`84
`
`85
`
`86
`87
`88
`
`89
`
`90
`
`91
`92
`93
`
`94
`95
`
`96
`
`97
`
`98
`
`99
`
`100
`101
`
`102
`
`103
`104
`105
`
`106
`107
`
`108
`
`int argc;
`char **argv;
`
`{
`
`int port=CFS_PORT;
`
`struct timeval tv;
`
`struct hostent *hp;
`
`struct sockaddr_in sin;
`int svrsock;
`
`SVCXPRT *tp;
`
`int pid;
`#ifdef SOLARISZX
`
`struct netconfig *nc;
`
`struct t_bind tbind, *tres;
`
`struct t_info tinfo;
`#endif
`
`/* create the right kind of socket */
`
`{
`if (argc > 2)
`fprintf(stderr,"Usage: cfsd [port]\n");
`exit(1);
`
`}
`
`if (argc==2)
`
`{
`
`{
`if ((port=atoi(argV[l]))<=O)
`fprintf(stderr,"Usage: cfsd [port]\n");
`exit(1);
`
`}
`
`}
`
`{
`if ((hp=gethostbyname("localhost"))==NULL)
`fprintf(stderr,"Can't deal with 1oca1host\n");
`exit(1);
`
`}
`bzero((char *)&sin,sizeof(sin));
`
`sin.sin_fami1y=AF_INET;
`
`bcopy((char *)hp->h_addr,(char *)&sin.sin_addr,hp->h_1ength);
`
`/* sin.sin_addr = inet_makeaddr(INADDR_ANY,np);*/
`
`validhost.s_addr=sin.sin_addr.s_addr;
`
`sin.sin_port = htons(port);
`
`#ifdef SOLARISZX
`
`if ((nc = getnetconfigent("udp")) == NULL)
`nc_perror("udp");
`exit(1);
`
`{
`
`}
`
`if ((svrsock = t_open(nc->nc_device, O_RDWR, &tinfo))
`
`< O)
`
`{
`
`'2'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 29
`
`

`
`C:\cfs-1.3.3\cfs.c
`
`109
`110
`
`111
`112
`
`113
`114
`115
`
`116
`117
`
`118
`119
`
`120
`121
`
`122
`123
`124
`
`125
`126
`
`127
`
`128
`129
`130
`
`131
`132
`
`133
`134
`
`135
`136
`137
`
`138
`139
`
`140
`
`141
`
`142
`
`143
`
`144
`
`145
`
`146
`147
`
`148
`149
`150
`
`151
`152
`
`153
`
`154
`
`155
`
`156
`157
`158
`
`159
`
`160
`161
`162
`
`t_error("Can't t_open UDP device");
`exit(1);
`
`}
`
`if ((tres = (struct t_bind *)t_alloc(svrsock, T_BIND, T_ADDR)) == NULL){
`t_error("Can't t_alloc buffer");
`exit(1);
`
`}
`
`tbind.qlen = O;
`tbind.addr.buf =
`
`(char *)&sin;
`
`tbind.addr.len = tbind.addr.maxlen = tinfo.addr;
`
`if (t_bind(svrsock, &tbind,
`t_error("t_bind");
`exit(1);
`
`tres)
`
`!= O)
`
`{
`
`}
`
`if (tbind.addr.len != tres->addr.len ||
`
`tres->addr.len)
`tres->addr.buf,
`memcmp(tbind.addr.buf,
`/* bound address does not match requested one */
`fprintf(stderr,
`
`!= 0)
`
`{
`
`"t_bind did not bind to requested address (is another cfsd running?)\n");
`exit(1);
`
`}
`
`{
`if ((tp = svc_dg_create(svrsock, O, 0)) == NULL)
`fprintf(stderr,"Can't create UDP RPC Service\n");
`exit(1);
`
`}
`
`/* Assign the local bind address and type of service */
`
`tp->xp_ltaddr = tres—>addr;
`
`tp->xp_type = tinfo.servtype;
`
`tp->xp_rtaddr.len = O;
`
`tp->xp_rtaddr.maxlen = tres—>addr.maxlen;
`
`tp->xp_netid = strdup(nc—>nc_netid);
`
`tp->xp_tp = strdup(nc—>nc_device);
`
`if ((tp->xp_rtaddr.buf = malloc(tp—>xp_rtaddr.maxlen)) == NULL)
`fprintf(stderr, "Can't malloc buffer space\n");
`exit(1);
`
`{
`
`}
`
`/* now register w/
`
`the local dispatcher */
`
`/* don't register nfs w/ portmaper,
`
`tho */
`
`if (!sVc_reg(tp, NFS_PROGRAM, NFS_VERSION, nfs_program_2,
`
`{
`(port==2049? nc : NULL)))
`fprintf(stderr,"Can't register CFS NFS\n");
`exit(1);
`
`}
`
`{
`if (!rpcb_unset(ADM_PROGRAM. ADM_VERSION, nc))
`fprintf(stderr, "Can't init CFS ADM rpcbind mapping\n");
`exit(1);
`
`'3'
`
`Petitioner Oracle-Apple - Exhibit 1009 - Page 30
`
`

`
`C:\cfs-1.3.3\cfs.c
`
`163
`
`164
`165
`166
`
`167
`168
`
`169
`170
`171
`
`172
`173
`
`174
`175
`176
`
`177
`178
`
`179
`180
`181
`
`182
`183
`
`184
`
`185
`
`186
`
`187
`188
`189
`
`190
`191
`
`192
`
`193
`194
`195
`
`196
`197
`198
`
`199
`
`200
`
`201
`202
`203
`
`204
`205
`206
`
`207
`208
`
`209
`210
`
`211
`
`212
`
`213
`
`214
`215
`
`216
`
`}
`
`if (!sVc_reg(tp, ADM_PROGRAM, ADM_VERSION, adm_program_2, nc))
`fprintf(stderr,"Can't register CFS ADM\n");
`exit(1);
`
`{
`
`}
`#else
`
`if ((sVrsock=socket(AF_INET,SOCK_DGRAM,0))
`perror("socket");
`exit(1);
`
`< 0)
`
`{
`
`}
`
`if (bind(svrsock,(struct sockaddr *)&sin,sizeof(sin))
`perror("bind");
`exit(1);
`
`!= 0)
`
`{
`
`}
`
`{
`if ((tp = svcudp_create(svrsock)) == NULL)
`fprintf(stderr,"Can't create UDP RPC Service\n");
`exit(1);
`
`}
`
`/* now register w/
`
`the local dispatcher */
`
`/* don't register nfs w/ portmaper,
`
`tho */
`
`if (!sVc_register(tp,NFS_PROGRAM,NFS_VERSION,nfs_program_2,
`
`{
`(pOrt==2049?IPPROTO_UDP:O)))
`fprintf(stderr,"Can't register CFS NFS\n");
`exit(1);
`
`}
`pmap_unset(ADM_PROGRAM.ADM_VERSION);
`
`if (!sVc_register(tp,ADM_PROGRAM,ADM_VERSION,adm_program_2,
`
`{
`IPPROTO_UDP))
`fprintf(stderr,"Can't register CFS ADM\n");
`exit(1);
`
`}
`#endif
`
`#ifndef DEBUG
`
`if ((pid=fork()
`
`!=O)
`
`{
`
`{
`if (pid<0)
`perror

This document is available on Docket Alarm but you must sign up to view it.


Or .

Accessing this document will incur an additional charge of $.

After purchase, you can access this document again without charge.

Accept $ Charge
throbber

Still Working On It

This document is taking longer than usual to download. This can happen if we need to contact the court directly to obtain the document and their servers are running slowly.

Give it another minute or two to complete, and then try the refresh button.

throbber

A few More Minutes ... Still Working

It can take up to 5 minutes for us to download a document if the court servers are running slowly.

Thank you for your continued patience.

This document could not be displayed.

We could not find this document within its docket. Please go back to the docket page and check the link. If that does not work, go back to the docket and refresh it to pull the newest information.

Your account does not support viewing this document.

You need a Paid Account to view this document. Click here to change your account type.

Your account does not support viewing this document.

Set your membership status to view this document.

With a Docket Alarm membership, you'll get a whole lot more, including:

  • Up-to-date information for this case.
  • Email alerts whenever there is an update.
  • Full text search for other cases.
  • Get email alerts whenever a new case matches your search.

Become a Member

One Moment Please

The filing “” is large (MB) and is being downloaded.

Please refresh this page in a few minutes to see if the filing has been downloaded. The filing will also be emailed to you when the download completes.

Your document is on its way!

If you do not receive the document in five minutes, contact support at support@docketalarm.com.

Sealed Document

We are unable to display this document, it may be under a court ordered seal.

If you have proper credentials to access the file, you may proceed directly to the court's system using your government issued username and password.


Access Government Site

We are redirecting you
to a mobile optimized page.





Document Unreadable or Corrupt

Refresh this Document
Go to the Docket

We are unable to display this document.

Refresh this Document
Go to the Docket