diff options
author | rsc <devnull@localhost> | 2005-02-11 19:39:51 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-02-11 19:39:51 +0000 |
commit | 096ff3e14a188992d2dfe59c7fd3f5d6da791331 (patch) | |
tree | 7d570f58a3e398c7f04c04a34bd330aaf077ee45 /src/cmd/secstore/secchk.c | |
parent | d93fca6a7ab52f518d3e8aca1fc94139313b97ad (diff) | |
download | plan9port-096ff3e14a188992d2dfe59c7fd3f5d6da791331.tar.gz plan9port-096ff3e14a188992d2dfe59c7fd3f5d6da791331.tar.bz2 plan9port-096ff3e14a188992d2dfe59c7fd3f5d6da791331.zip |
add secstored; use readcons
Diffstat (limited to 'src/cmd/secstore/secchk.c')
-rw-r--r-- | src/cmd/secstore/secchk.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/cmd/secstore/secchk.c b/src/cmd/secstore/secchk.c new file mode 100644 index 00000000..59e26d51 --- /dev/null +++ b/src/cmd/secstore/secchk.c @@ -0,0 +1,28 @@ +#include <u.h> +#include <libc.h> +#include <bio.h> +#include <ndb.h> + +extern char* secureidcheck(char *user, char *response); +Ndb *db; + +void +main(int argc, char **argv) +{ + Ndb *db2; + + if(argc!=2){ + fprint(2,"usage %s pinsecurid\n", argv[0]); + exits("usage"); + } + db = ndbopen("/lib/ndb/auth"); + if(db == 0) + syslog(0, "secstore", "no /lib/ndb/auth"); + db2 = ndbopen(0); + if(db2 == 0) + syslog(0, "secstore", "no /lib/ndb/local"); + db = ndbcat(db, db2); + print("user=%s\n", getenv("user")); + print("%s\n", secureidcheck(getenv("user"), argv[1])); + exits(0); +} |