Linux server.nvwebsoft.co.in 3.10.0-1160.114.2.el7.x86_64 #1 SMP Wed Mar 20 15:54:52 UTC 2024 x86_64
Apache
: 162.240.12.249 | : 3.146.176.112
202 Domain
8.1.31
nbspublicschool
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
pam-devel-1.1.8 /
html /
[ HOME SHELL ]
Name
Size
Permission
Action
Linux-PAM_ADG.html
8.41
KB
-rw-r--r--
Linux-PAM_MWG.html
8.59
KB
-rw-r--r--
adg-author.html
3.02
KB
-rw-r--r--
adg-copyright.html
3.54
KB
-rw-r--r--
adg-example.html
3.59
KB
-rw-r--r--
adg-files.html
2.18
KB
-rw-r--r--
adg-glossary.html
3.21
KB
-rw-r--r--
adg-interface-by-app-expected....
61.01
KB
-rw-r--r--
adg-interface-of-app-expected....
8.26
KB
-rw-r--r--
adg-interface-programming-note...
2.55
KB
-rw-r--r--
adg-interface.html
4.9
KB
-rw-r--r--
adg-introduction-description.h...
3.29
KB
-rw-r--r--
adg-introduction-synopsis.html
2.62
KB
-rw-r--r--
adg-introduction.html
2.01
KB
-rw-r--r--
adg-libpam-functions.html
13.13
KB
-rw-r--r--
adg-libpam_misc.html
3.34
KB
-rw-r--r--
adg-overview.html
8.16
KB
-rw-r--r--
adg-porting.html
4.2
KB
-rw-r--r--
adg-security-conv-function.htm...
2.29
KB
-rw-r--r--
adg-security-library-calls.htm...
3.13
KB
-rw-r--r--
adg-security-resources.html
2.83
KB
-rw-r--r--
adg-security-service-name.html
4.43
KB
-rw-r--r--
adg-security-user-identity.htm...
5.38
KB
-rw-r--r--
adg-security.html
3.73
KB
-rw-r--r--
adg-see-also.html
2.16
KB
-rw-r--r--
mwg-author.html
3
KB
-rw-r--r--
mwg-copyright.html
3.52
KB
-rw-r--r--
mwg-example.html
1.96
KB
-rw-r--r--
mwg-expected-by-module-item.ht...
45.36
KB
-rw-r--r--
mwg-expected-by-module-other.h...
8.15
KB
-rw-r--r--
mwg-expected-by-module.html
4.02
KB
-rw-r--r--
mwg-expected-of-module-acct.ht...
6.05
KB
-rw-r--r--
mwg-expected-of-module-auth.ht...
10.73
KB
-rw-r--r--
mwg-expected-of-module-chautht...
7.8
KB
-rw-r--r--
mwg-expected-of-module-overvie...
6.28
KB
-rw-r--r--
mwg-expected-of-module-session...
6.98
KB
-rw-r--r--
mwg-expected-of-module.html
4.27
KB
-rw-r--r--
mwg-introduction-description.h...
3.88
KB
-rw-r--r--
mwg-introduction-synopsis.html
1.98
KB
-rw-r--r--
mwg-introduction.html
1.98
KB
-rw-r--r--
mwg-see-also.html
2.18
KB
-rw-r--r--
mwg-see-options.html
2.92
KB
-rw-r--r--
mwg-see-programming-libs.html
2.94
KB
-rw-r--r--
mwg-see-programming-sec.html
8.92
KB
-rw-r--r--
mwg-see-programming-syslog.htm...
4.63
KB
-rw-r--r--
mwg-see-programming.html
3
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : adg-example.html
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 8. An example application</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="Linux-PAM_ADG.html" title="The Linux-PAM Application Developers' Guide"><link rel="up" href="Linux-PAM_ADG.html" title="The Linux-PAM Application Developers' Guide"><link rel="prev" href="adg-glossary.html" title="Chapter 7. Glossary of PAM related terms"><link rel="next" href="adg-files.html" title="Chapter 9. Files"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 8. An example application</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="adg-glossary.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="adg-files.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="adg-example"></a>Chapter 8. An example application</h1></div></div></div><p> To get a flavor of the way a <span class="emphasis"><em>Linux-PAM</em></span> application is written we include the following example. It prompts the user for their password and indicates whether their account is valid on the standard output, its return code also indicates the success (<span class="returnvalue">0</span> for success; <span class="returnvalue">1</span> for failure). </p><pre class="programlisting"> /* This program was contributed by Shane Watts [modifications by AGM and kukuk] You need to add the following (or equivalent) to the /etc/pam.d/check_user file: # check authorization auth required pam_unix.so account required pam_unix.so */ #include <security/pam_appl.h> #include <security/pam_misc.h> #include <stdio.h> static struct pam_conv conv = { misc_conv, NULL }; int main(int argc, char *argv[]) { pam_handle_t *pamh=NULL; int retval; const char *user="nobody"; if(argc == 2) { user = argv[1]; } if(argc > 2) { fprintf(stderr, "Usage: check_user [username]\n"); exit(1); } retval = pam_start("check_user", user, &conv, &pamh); if (retval == PAM_SUCCESS) retval = pam_authenticate(pamh, 0); /* is user really user? */ if (retval == PAM_SUCCESS) retval = pam_acct_mgmt(pamh, 0); /* permitted access? */ /* This is where we have been authorized or not. */ if (retval == PAM_SUCCESS) { fprintf(stdout, "Authenticated\n"); } else { fprintf(stdout, "Not Authenticated\n"); } if (pam_end(pamh,retval) != PAM_SUCCESS) { /* close Linux-PAM */ pamh = NULL; fprintf(stderr, "check_user: failed to release authenticator\n"); exit(1); } return ( retval == PAM_SUCCESS ? 0:1 ); /* indicate success */ } </pre></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="adg-glossary.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="adg-files.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 7. Glossary of PAM related terms </td><td width="20%" align="center"><a accesskey="h" href="Linux-PAM_ADG.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 9. Files</td></tr></table></div></body></html>
Close