glassmann@ccavax.camb.com (12/29/89)
+-+-+-+ Beginning of part 2 +-+-+-+ X short cmp; X X prev = NULL; X userp = top_user; X while (userp && !past) X`009`123 X`009cmp = strcmp (userp->devdir, devdir); X`009if (cmp == 0) X`009 `123 X`009 printf ("duplicated by %s\n", userp->name); X`009 return (TRUE); X`009 `125 X`009if (cmp > 0) X`009 past = TRUE; X`009else X`009 `123 X`009 prev = userp; X`009 userp = userp->next; X`009 `125 X`009`125 X X new = malloc (sizeof (USER_STRUCT)); X new->devdir = malloc (strlen (devdir) + 1); X strcpy (new->devdir, devdir); X X new->name = malloc (strlen (name) + 1); X strcpy (new->name, name); X X if (top_user == NULL) X`009`123 X`009new->next = NULL; X`009top_user = new; X`009`125 X else if (prev == NULL) X`009`123 X`009new->next = top_user; X`009top_user = new; X`009`125 X else X`009`123 X`009new->next = prev->next; X`009prev->next = new; X`009`125 X X return (FALSE); X`125 X X Xopen_uaf () X`123 Xint sts; Xstatic char filename[] = "sysuaf"; Xstatic char dfltname[] = "sys$system:.dat"; X X uaffab = cc$rms_fab; X uafrab = cc$rms_rab; X uaffab.fab$b_fns = sizeof(filename) - 1; X uaffab.fab$l_fna = filename; X uaffab.fab$b_dns = sizeof(dfltname) - 1; X uaffab.fab$l_dna = dfltname; X uaffab.fab$b_fac = FAB$M_GET; V uaffab.fab$b_shr = FAB$M_SHRGET `124 FAB$M_SHRPUT `124 FAB$M_SHRDEL `124 FA XB$M_SHRUPD; X uafrab.rab$l_rop = RAB$M_NLK; X uafrab.rab$w_usz = sizeof(record); X uafrab.rab$l_ubf = (char *) &record; X uafrab.rab$l_fab = &uaffab; X X sts = SYS$OPEN(&uaffab); X if (!(sts & 1)) lib$stop (sts, uaffab.fab$l_stv); X X sts = SYS$CONNECT(&uafrab); X if (!(sts & 1)) lib$stop (sts, uafrab.rab$l_stv); X`125 X X Xopen_outfiles () X`123 X if ((outfile = fopen ("arbitron.out", "w")) == NULL) X`009`123 X`009printf ("arbitron: unable to open arbitron.out\n"); X`009exit (0); X`009`125 X`125 $ GOSUB UNPACK_FILE $ FILE_IS = "ARBITRON.COM" $ CHECKSUM_IS = 523836491 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY V$! run the arbitron program and send the output to netsurvey@decwrl.dec.com,` X032 X$! with a copy to the local news manager. This should be run in time to X$! get to decwrl by the first day of the month. X$! X$ run arbitron X$ mail arbitron.out uucp%"""netsurvey@decwrl.dec.com""",usenet X$ purge arbitron.out $ GOSUB UNPACK_FILE $ FILE_IS = "NEWSRC.PATCH" $ CHECKSUM_IS = 956767850 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X/* This function clears the profile_flags variable. It is used by arbitron X in between reading NEWSRC files of different users. It must be included X in newsrc.c because profile_flags is static to that module. X*/ X Xclear_profile_flags () X`123 X profile_flags = 0; X`125 $ GOSUB UNPACK_FILE $ FILE_IS = "UAF.H" $ CHECKSUM_IS = 558394689 $ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY X/* add the following for the second longword */ X#define PRV$M_UPGRADE 0x00000001 X#define PRV$M_DOWNGRADE 0x00000002 X#define PRV$M_GRPPRV 0x00000004 X#define PRV$M_READALL 0x00000008 X#define PRV$M_SECURITY 0x00000040 X X X/* *** MODULE $UAFDEF *** */ X/* ++ */ X/* User authorization file format */ X/* Note: With the exception of the username and account name, */ X/* all strings are blank padded counted strings. Username and */ X/* account name are uncounted, blank padded. */ X/* -- */ X#define UAF$C_USER_ID 1 /* main user ID record */ X#define UAF$C_VERSION1 1 /* this version */ X#define UAF$C_KEYED_PART 52 /* ISAM keys come this far */ X#define UAF$C_AD_II 0 /* AUTODIN-II 32 bit crc code */ X#define UAF$C_PURDY 1 /* Purdy polynomial over salted input */ X#define UAF$C_PURDY_V 2 /* Purdy polynomial + variable length username */ X#define UAF$K_FIXED 644 /* length of fixed portion */ X#define UAF$C_FIXED 644 /* length of fixed portion */ X#define UAF$K_LENGTH 1412 X#define UAF$C_LENGTH 1412 X#define UAF$S_UAFDEF 1412 X X#define UAF$S_USERNAME 32 X#define UAF$S_PARENT_ID 8 X#define UAF$S_ACCOUNT 32 X#define UAF$S_OWNER 32 X#define UAF$S_DEFDEV 32 X#define UAF$S_DEFDIR 64 X#define UAF$S_LGICMD 64 X#define UAF$S_DEFCLI 32 X#define UAF$S_CLITABLES 32 X#define UAF$S_PWD 8 X#define UAF$S_PWD2 8 X#define UAF$S_EXPIRATION 8 X#define UAF$S_PWD_LIFETIME 8 X#define UAF$S_PWD_DATE 8 X#define UAF$S_PWD2_DATE 8 X#define UAF$S_LASTLOGIN_I 8 X#define UAF$S_LASTLOGIN_N 8 X#define UAF$S_PRIV 8 X#define UAF$S_DEF_PRIV 8 X#define UAF$S_MIN_CLASS 20 X#define UAF$S_MAX_CLASS 20 X#define UAF$S_NETWORK_ACCESS_P 3 X#define UAF$S_NETWORK_ACCESS_S 3 X#define UAF$S_BATCH_ACCESS_P 3 X#define UAF$S_BATCH_ACCESS_S 3 X#define UAF$S_LOCAL_ACCESS_P 3 X#define UAF$S_LOCAL_ACCESS_S 3 X#define UAF$S_DIALUP_ACCESS_P 3 X#define UAF$S_DIALUP_ACCESS_S 3 X#define UAF$S_REMOTE_ACCESS_P 3 X#define UAF$S_REMOTE_ACCESS_S 3 X Xstruct uaf$r_flags_bits `123 X unsigned uaf$v_disctly:1; /* no user control-y */ X unsigned uaf$v_defcli:1; /* only allow user default CLI */ X unsigned uaf$v_lockpwd:1; /* disable SET PASSWORD command */ X unsigned uaf$v_captive:1; /* captive account (no overrides) */ X unsigned uaf$v_disacnt:1; /* no interactive login */ X unsigned uaf$v_diswelcom:1; /* skip welcome message */ X unsigned uaf$v_dismail:1; /* skip new mail message */ X unsigned uaf$v_nomail:1; /* disable mail delivery */ X unsigned uaf$v_genpwd:1; /* passwords must be generated */ X unsigned uaf$v_pwd_expired:1; /* password has expired */ X unsigned uaf$v_pwd2_expired:1; /* 2nd password has expired */ X unsigned uaf$v_audit:1; /* audit all actions */ X unsigned uaf$v_disreport:1; /* skip last login messages */ X unsigned uaf$v_disreconnect:1; /* inhibit reconnections */ X unsigned uaf$v_autologin:1; /* auto-login only */ X unsigned uaf$v_disforce_pwd_change:1; /* disable forced password change */ X`125; X Xstruct uaf$r_primedays_bits `123 X unsigned uaf$v_monday:1; /* bit clear means this is a primary day */ X unsigned uaf$v_tuesday:1; /* bit set means this is an off day */ X unsigned uaf$v_wednesday:1;`032 X unsigned uaf$v_thursday:1;`032 X unsigned uaf$v_friday:1;`032 X unsigned uaf$v_saturday:1;`032 X unsigned uaf$v_sunday:1;`032 X`125; X Xstruct UAFDEF X`123 X char uaf$b_rtype; /* UAF record type */ X char uaf$b_version; /* UAF format version */ X short int uaf$w_usrdatoff; /* offset of counted string of user data */ X char uaf$t_username[UAF$S_USERNAME]; /* username */ X union `123 X long int uaf$l_uic; /* user ID code */ X struct `123 X short int uaf$w_mem; /* member subfield */ X short int uaf$w_grp; /* group subfield */ X `125 uaf$r_uic_fields; X `125 uaf$r_uic_overlay; X long int uaf$l_sub_id; /* user sub-identifier */ X long int uaf$q_parent_id[2]; /* identifier of owner of this account */ X char uaf$t_account[UAF$S_ACCOUNT]; /* account name */ X char uaf$t_owner[UAF$S_OWNER]; /* owner's name */ X char uaf$t_defdev[UAF$S_DEFDEV]; /* default device */ X char uaf$t_defdir[UAF$S_DEFDIR]; /* default directory */ X char uaf$t_lgicmd[UAF$S_LGICMD]; /* login command file */ X char uaf$t_defcli[UAF$S_DEFCLI]; /* default command interpreter */ X char uaf$t_clitables[UAF$S_CLITABLES]; /* user CLI tables */ X union `123 X long int uaf$q_pwd[2]; /* hashed password */ X long int uaf$l_pwd; /* 32 bit subfield */ X `125 uaf$r_pwd_overlay; X long int uaf$q_pwd2[2]; /* second password */ X short int uaf$w_logfails; /* count of login failures */ X short int uaf$w_salt; /* random password salt */ X char uaf$b_encrypt; /* encryption algorithm */ X/* encryption codes */ X char uaf$b_encrypt2; /* encryption algorithm for 2nd pwd */ X char uaf$b_pwd_length; /* minimum password length */ X char uaf$fill_1; X long int uaf$q_expiration[2]; /* expiration date for account */ X long int uaf$q_pwd_lifetime[2]; /* password lifetime */ X long int uaf$q_pwd_date[2]; /* date of password change */ X long int uaf$q_pwd2_date[2]; /* date of 2nd password change */ X long int uaf$q_lastlogin_i[2]; /* date of last interactive login */ X long int uaf$q_lastlogin_n[2]; /* date of last non-interactive login */ X union `123 X long int uaf$q_priv[2]; /* process privilege vector */ X union prvdef uaf$r_priv; X `125 uaf$r_priv_overlay; X union `123 X long int uaf$q_def_priv[2]; /* default process privileges */ X union prvdef uaf$r_def_priv; X `125 uaf$r_def_priv_overlay; X char uaf$r_min_class[UAF$S_MIN_CLASS]; /* minimum security class */ X char uaf$r_max_class[UAF$S_MAX_CLASS]; /* maximum security class */ X union `123 X long int uaf$l_flags; /* user flags longword */ X struct uaf$r_flags_bits uaf$r_flags_bits; X `125 uaf$r_flags_overlay; V char uaf$b_network_access_p[UAF$S_NETWORK_ACCESS_P]; /* hourly network acce Xss, primary */ V char uaf$b_network_access_s[UAF$S_NETWORK_ACCESS_S]; /* hourly network acce Xss, secondary */ V char uaf$b_batch_access_p[UAF$S_BATCH_ACCESS_P]; /* hourly batch access, pr Ximary */ V char uaf$b_batch_access_s[UAF$S_BATCH_ACCESS_S]; /* hourly batch access, se Xcondary */ V char uaf$b_local_access_p[UAF$S_LOCAL_ACCESS_P]; /* hourly local access, pr Ximary */ V char uaf$b_local_access_s[UAF$S_LOCAL_ACCESS_S]; /* hourly local access, se Xcondary */ V char uaf$b_dialup_access_p[UAF$S_DIALUP_ACCESS_P]; /* hourly dialup access, X primary */ V char uaf$b_dialup_access_s[UAF$S_DIALUP_ACCESS_S]; /* hourly dialup access, X secondary */ V char uaf$b_remote_access_p[UAF$S_REMOTE_ACCESS_P]; /* hourly remote access, X primary */ V char uaf$b_remote_access_s[UAF$S_REMOTE_ACCESS_S]; /* hourly remote access, X secondary */ X char uaf$fill_2[514 - 502]; X union `123 X char uaf$b_primedays; /* bits representing primary days */ X struct uaf$r_primedays_bits uaf$r_primedays_bits; X `125 uaf$r_primedays_overlay; X char uaf$fill_3[516 - 515]; X char uaf$b_pri; /* base process priority */ X char uaf$b_quepri; /* maximum job queuing priority */ X short int uaf$w_maxjobs; /* maximum jobs for UIC allowed */ X/* 0 means no limit */ X short int uaf$w_maxacctjobs; /* maximum jobs for account allowed */ X/* 0 means no limit */ X short int uaf$w_maxdetach; /* maximum detached processes for UIC */ X/* 0 means no limit */ X short int uaf$w_prccnt; /* subprocess creation limit */ X short int uaf$w_biolm; /* buffered I/O limit */ X short int uaf$w_diolm; /* direct I/O limit */ X short int uaf$w_tqcnt; /* timer queue entry limit */ X short int uaf$w_astlm; /* AST queue limit */ X short int uaf$w_enqlm; /* enqueue limit */ X short int uaf$w_fillm; /* open file limit */ X short int uaf$w_shrfillm; /* shared file limit */ X long int uaf$l_wsquota; /* working set size quota */ X long int uaf$l_dfwscnt; /* default working set size */ X long int uaf$l_wsextent; /* working set size limit */ X long int uaf$l_pgflquota; /* page file quota */ X long int uaf$l_cputim; /* CPU time quota */ X long int uaf$l_bytlm; /* buffered I/O byte count limit */ X long int uaf$l_pbytlm; /* paged buffer I/O byte count limit */ X long int uaf$l_jtquota; /* job-wide logical name table creation quota */ X short int uaf$w_proxy_lim; /* number of proxies user can grant */ X short int uaf$w_proxies; /* number of proxies granted */ X short int uaf$w_account_lim; /* number of sub-accounts allowed */ X short int uaf$w_accounts; /* number of sub-accounts in use */ X char uaf$fill_4[UAF$K_LENGTH - 580]; X`125; X `032 $ GOSUB UNPACK_FILE $ EXIT -+-+-+-+-+ End of part 2 +-+-+-+-+- -- Lenny Glassmann glassmann@ccavax.camb.com