Patch #: 64 Type: operational change Priority: none Modification: link README file into top level AUFS folder for new user Submitted: Edward Moy Archived: munnari.OZ.AU mac/cap.patches/cap60.patch064 Application: 'cd cap60; patch -p < cap60.patches/cap60.patch064' Summary: add '-r readme_path' option to aufs File: cap60/Configure File: cap60/applications/aufs/aufs.c File: cap60/applications/aufs/afpdt.c *** Configure.orig Sun Sep 22 01:42:03 1991 --- Configure Sun Nov 17 16:24:54 1991 *************** *** 1,7 **** #!/bin/sh ! # $Author: djh $ $Date: 1991/09/21 15:41:52 $ ! # $Header: /mac/src/cap60/RCS/Configure,v 2.28 1991/09/21 15:41:52 djh Rel djh $ ! # $Revision: 2.28 $ # CAP configuration shell script. This ain't perfect, but it's a start. # Execute with /bin/sh Configure if your system won't run it (ksh is okay too) # --- 1,7 ---- #!/bin/sh ! # $Author: djh $ $Date: 1991/11/17 05:24:41 $ ! # $Header: /mac/src/cap60/RCS/Configure,v 2.29 1991/11/17 05:24:41 djh Rel djh $ ! # $Revision: 2.29 $ # CAP configuration shell script. This ain't perfect, but it's a start. # Execute with /bin/sh Configure if your system won't run it (ksh is okay too) # *************** *** 554,559 **** --- 554,562 ---- # # + APPLICATION_MANAGER control the use of designated applications # define(`specialcflags',concat(specialcflags,` -DAPPLICATION_MANAGER')) + # + # + AUFS_README links readme file into new user's top level + # define(`specialcflags',concat(specialcflags,` -DAUFS_README')) # EOT0 result=0 *** applications/aufs/aufs.c.orig Sun Sep 22 01:44:51 1991 --- applications/aufs/aufs.c Sun Nov 17 16:47:01 1991 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 1991/09/21 15:44:39 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/aufs.c,v 2.6 1991/09/21 15:44:39 djh Rel djh $ ! * $Revision: 2.6 $ */ /* --- 1,7 ---- /* ! * $Author: djh $ $Date: 1991/11/17 05:46:54 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/aufs.c,v 2.7 1991/11/17 05:46:54 djh Rel djh $ ! * $Revision: 2.7 $ */ /* *************** *** 91,96 **** --- 91,100 ---- export int sqs = atpMaxNum; /* maximum send quantum */ export int n_rrpkts = atpMaxNum; /* maximum send quantum to allow remote */ /* (used in spwrtcontinue) */ + #ifdef AUFS_README + export char *aufsreadme; /* path of readme file */ + export char *aufsreadmename; /* pointer into aufsreadme with just name */ + #endif AUFS_README private int maxsess = 10; private EntityName srvr_entity_name; /* our entity name */ *************** *** 169,177 **** fprintf(stderr,"[-n name] [-t packets] [-s] [-V afpvols]\n"); #endif LWSRV_AUFS_SECURITY #ifdef APPLICATION_MANAGER ! fprintf(stderr,"[-A applistfile]\n"); #endif APPLICATION_MANAGER ! fprintf(stderr,"\t-d for CAP debugging flags:\n"); fprintf(stderr,"\t l = lap, d = ddp, a = atp, n = nbp, p = pap,"); fprintf(stderr,"i = ini, s = asp\n"); fprintf(stderr,"\t-Ds[shct] for ASP debug limiting flags:\n"); --- 173,184 ---- fprintf(stderr,"[-n name] [-t packets] [-s] [-V afpvols]\n"); #endif LWSRV_AUFS_SECURITY #ifdef APPLICATION_MANAGER ! fprintf(stderr,"[-A applistfile]"); #endif APPLICATION_MANAGER ! #ifdef AUFS_README ! fprintf(stderr,"[-r readme_path]"); ! #endif AUFS_README ! fprintf(stderr,"\n\t-d for CAP debugging flags:\n"); fprintf(stderr,"\t l = lap, d = ddp, a = atp, n = nbp, p = pap,"); fprintf(stderr,"i = ini, s = asp\n"); fprintf(stderr,"\t-Ds[shct] for ASP debug limiting flags:\n"); *************** *** 198,203 **** --- 205,213 ---- #ifdef APPLICATION_MANAGER fprintf(stderr,"\t-A application run manager\n"); #endif APPLICATION_MANAGER + #ifdef AUFS_README + fprintf(stderr,"\t-r readme file for new users\n"); + #endif AUFS_README fprintf(stderr,"\nExample: %s -t 'bdelete irename' -a 'file fork dir' -s\n", name); exit(1); *************** *** 228,239 **** int c; extern char *optarg; extern int optind; #ifdef LWSRV_AUFS_SECURITY ! while ((c = getopt(argc,argv,"a:d:D:n:N:t:sV:U:G:P:c:l:z:S:R:X:A:")) != EOF) { ! #else LWSRV_AUFS_SECURITY ! while ((c = getopt(argc,argv,"a:d:D:n:N:t:sV:U:G:P:c:l:z:S:R:A:")) != EOF) { #endif LWSRV_AUFS_SECURITY switch (c) { case 'z': strncpy(zonetorun, optarg, 32); --- 238,255 ---- int c; extern char *optarg; extern int optind; + static char optlist[64] = "a:d:D:n:N:t:sV:U:G:P:c:l:z:S:R:"; #ifdef LWSRV_AUFS_SECURITY ! strcat(optlist, "X:"); #endif LWSRV_AUFS_SECURITY + #ifdef APPLICATION_MANAGER + strcat(optlist, "A:"); + #endif APPLICATION_MANAGER + #ifdef AUFS_README + strcat(optlist, "r:"); + #endif AUFS_README + while ((c = getopt(argc,argv,optlist)) != EOF) { switch (c) { case 'z': strncpy(zonetorun, optarg, 32); *************** *** 308,320 **** userlogindir = optarg; break; /* ...budd */ #endif LWSRV_AUFS_SECURITY - case 'A': #ifdef APPLICATION_MANAGER enforcelist = optarg; ! #else APPLICATION_MANAGER ! usage(argv[0]); #endif APPLICATION_MANAGER break; default: usage(argv[0]); break; --- 324,344 ---- userlogindir = optarg; break; /* ...budd */ #endif LWSRV_AUFS_SECURITY #ifdef APPLICATION_MANAGER + case 'A': enforcelist = optarg; ! break; #endif APPLICATION_MANAGER + #ifdef AUFS_README + case 'r': + aufsreadme = optarg; + if (*aufsreadme != '/') { + fprintf(stderr, "The -r parameter must be a full path name\n"); + exit(1); + } + aufsreadmename = (char *)rindex(aufsreadme, '/') + 1; break; + #endif AUFS_README default: usage(argv[0]); break; *** applications/aufs/afpdt.c.orig Thu Jun 13 20:45:38 1991 --- applications/aufs/afpdt.c Sun Nov 17 17:05:42 1991 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 1991/06/13 10:45:20 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afpdt.c,v 2.3 1991/06/13 10:45:20 djh Rel djh $ ! * $Revision: 2.3 $ */ /* --- 1,7 ---- /* ! * $Author: djh $ $Date: 1991/11/17 06:05:31 $ ! * $Header: /mac/src/cap60/applications/aufs/RCS/afpdt.c,v 2.4 1991/11/17 06:05:31 djh Rel djh $ ! * $Revision: 2.4 $ */ /* *************** *** 86,91 **** --- 86,96 ---- private ReadIDesk(), ReadADesk(); + #ifdef AUFS_README + import char *aufsreadme; + import char *aufsreadmename; + #endif AUFS_README + /* * PrintINode(AVLUData *node) * *************** *** 164,172 **** --- 169,182 ---- int dtfd; char path[MAXPATHLEN]; int fmode; + #ifdef AUFS_README + register char *fp, *tp; + #endif AUFS_README *wrtok = TRUE; /* assume we can write */ OSfname(path,dt->dt_rootd,dtfn,F_DATA); /* create file name */ + if (DBDSK) + printf("OpenDesk: opening %s\n",path); fmode = O_RDWR; #ifdef O_TRUNC *************** *** 190,195 **** --- 200,227 ---- dtfd = open(path,O_RDWR|O_CREAT, mode); /* try creating*/ if (dtfd < 0) /* did we open anything? */ *wrtok = FALSE; /* if not then can't write */ + #ifdef AUFS_README + else if (aufsreadme && strcmp(dtfn, DESKTOP_APPL) == 0 + && access (aufsreadme, R_OK) == 0) { + if (DBDSK) + printf("OpenDesk: linking %s\n",aufsreadme); + OSfname(path,dt->dt_rootd,aufsreadmename,F_DATA); + tp = path + strlen(path); + tp[1] = '\0'; + fp = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + for ( ; ; ) { + if (access(path, F_OK) != 0) { + symlink(aufsreadme, path); + if (DBDSK) + printf("OpenDesk: symbolic link %s\n",path); + break; + } + if (*fp == '\0') + break; + *tp = *fp++; + } + } + #endif AUFS_README return(dtfd); } *** README.orig Sun Nov 17 17:07:32 1991 --- README Sun Nov 17 17:08:15 1991 *************** *** 3,9 **** (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 63, November 1991 Introduction ------------ --- 3,9 ---- (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 64, November 1991 Introduction ------------