From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078613510423.tru64-unix-managers.marc@archive.invalid> From: "Paul N. Youngblood" Date: Thu, 12 Jun 1997 22:25:34 +0000 To: tru64-unix-managers Subject: SUMMARY: C program won't run on DU 4.0B X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078613510423 Hello Managers, This list is terrific as usual! Fast answers to my problem came from: Randy M. Hayman Marco Campani Both said that I should change this line in my program: set_auth_parameters(); to this: set_auth_parameters(argc, argv); This solved my problem. Thanks, Randy and Marco! Now when I compile it on DU 4.0B it runs fine. Also, very helpful were: Pam Woods, Systems Manager John P. Speno Jo Knox #include #include #include #include #include void error( why ) char *why; { printf( "Error: %s\n", why ); exit(1); } struct pr_passwd *temp; struct pr_passwd ent; main(int argc, char *argv[]) { struct tm timp={0,0,0,0,0,0,}; time_t tp; int i,j; int month,day,year; char instr[200]; set_auth_parameters(); /* This must be done first! */ if (argc == 1) error( "Usage: expire \n" ); temp = getprpwnam(argv[1]); if ( temp==NULL ) error( "Can't find user\n" ); ent=*temp; /*printf("Username: %s\n",ent.ufld.fd_name);*/ /*printf("Date to expire %s? (mm/dd/yy)> ",argv[1]);*/ /*gets( instr );*/ /*if( !instr[0] ) exit( 0 );*/ /*sscanf( instr, "%d/%d/%d", &month, &day, &year );*/ month = 6; day = 30; year = 97; if (month<1 || month>12) error( "Invalid month.\n" ); if (day<1 || day>31) error( "Invalid day.\n" ); if (year<70) error( "Invalid year.\n" ); month--; timp.tm_mon = month; timp.tm_mday = day; timp.tm_year = year; tp=mktime(&timp); ent.ufld.fd_expdate=tp; ent.uflg.fg_expdate=1; printf("%s will expire on %s\n",argv[1],asctime(localtime(&tp))); putprpwnam(argv[1],&ent); }