tsecchk.c - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       tsecchk.c (560B)
       ---
            1 #include <u.h>
            2 #include <libc.h>
            3 #include <bio.h>
            4 #include <ndb.h>
            5 
            6 extern char* secureidcheck(char *user, char *response);
            7 Ndb *db;
            8 
            9 void
           10 main(int argc, char **argv)
           11 {
           12         Ndb *db2;
           13 
           14         if(argc!=2){
           15                 fprint(2,"usage %s pinsecurid\n", argv[0]);
           16                 exits("usage");
           17         }
           18         db = ndbopen("/lib/ndb/auth");
           19         if(db == 0)
           20                 syslog(0, "secstore", "no /lib/ndb/auth");
           21         db2 = ndbopen(0);
           22         if(db2 == 0)
           23                 syslog(0, "secstore", "no /lib/ndb/local");
           24         db = ndbcat(db, db2);
           25         print("user=%s\n", getenv("user"));
           26         print("%s\n", secureidcheck(getenv("user"), argv[1]));
           27         exits(0);
           28 }