Kirk Wolf wrote:

/*
 Check password for a userid.
 Note: requires program-controlled environment
 To build:
     c99 -o checkpass checkpass.c  i
     extattr +p checkpass
*/
#define _POSIX_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pwd.h>
#include <errno.h>
#include <env.h>

int main(int argc, char** argv) {

 if (argc != 3) {
   fprintf(stderr, "Syntax: checkpass <userid> <pass>\n");
   return 1;
 }
 setenv("_EDC_ADD_ERRNO2", "1", 1);
 if (__passwd(argv[1], argv[2], NULL)) {
   if (errno == EACCES) {
     fprintf(stderr, "password not authorized\n");
     return 2;
   } else {
     fprintf(stderr, "__passwd() - %s\n", strerror(errno));
     return 3;
   }
 }
 return 0;  /* no message - password valid */
}

On Fri, Jan 8, 2021 at 11:19 AM Sam Golob <[email protected]> wrote:

I took a moment to dig into the BPX interface for this, I found BPX1PWD,
which documents __passwd().  It also documents __passwd_applid(),
but provides no interface information for it (although it discusses it
as if it were a different interface) and provides alternatives to using
the __passwd_applid BPX interface if you wanted to set fields in the BPX
thread info yourself.

Seems like there is some doc confusion there...

I didn't find a separate BPX offset definition for __passwd_applid().

Is the _only_ way to specify the APPLID via directly setting fields in the BPXYTHLI
thread-info  or is there an actual BPX-level interface for this?

  - Dave R. -



--
[email protected]                        Work: (919) 676-0847
Get your mainframe programming tools at http://www.dignus.com

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to