D7net Mini Sh3LL v1

 
OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /libx32/../share/snapd/../locale/ia/../../doc/info/../libroken18-heimdal/../usbmuxd/../liberror-perl/../grub2-common/../libjpeg8/../php7.4-mysql/../gnupg/../python3-apt/../netplan.io/../wget/../libcurl3-gnutls/../libthai-data/../python3-six/../screen/../maria/../libxaw7/../libmnl0/../netplan/../gdisk/../systemd-sysv/../grep/../udisks2/../libacl1/../libxmlb1/../libperl5.30/../automake/../libdrm2/../xauth/../libcurl4/../util-linux/../fakeroot/../gettext/../php7.4/../liblvm2cmd2.03/../libelf1/../lbt/../iptables/../libtiff5/../python3-hamcrest/../libonig5/../libedit2/../lvm2/../pciutils/../iw/../bind9-dnsutils/../libmm-glib0/../libsodium23/../libwrap0/../make/../ubuntu-standard/../python3-problem-report/../systemd/../libpam-modules/examples/

 Home   ☍ Command   ☍ Upload File   ☍Info Server   ☍ Buat File   ☍ Mass deface   ☍ Jumping   ☍ Config   ☍ Symlink   ☍ About 

Current File : //libx32/../share/snapd/../locale/ia/../../doc/info/../libroken18-heimdal/../usbmuxd/../liberror-perl/../grub2-common/../libjpeg8/../php7.4-mysql/../gnupg/../python3-apt/../netplan.io/../wget/../libcurl3-gnutls/../libthai-data/../python3-six/../screen/../maria/../libxaw7/../libmnl0/../netplan/../gdisk/../systemd-sysv/../grep/../udisks2/../libacl1/../libxmlb1/../libperl5.30/../automake/../libdrm2/../xauth/../libcurl4/../util-linux/../fakeroot/../gettext/../php7.4/../liblvm2cmd2.03/../libelf1/../lbt/../iptables/../libtiff5/../python3-hamcrest/../libonig5/../libedit2/../lvm2/../pciutils/../iw/../bind9-dnsutils/../libmm-glib0/../libsodium23/../libwrap0/../make/../ubuntu-standard/../python3-problem-report/../systemd/../libpam-modules/examples/upperLOWER.c
/*
 * This is a sample filter program, for use with pam_filter (a module
 * provided with Linux-PAM). This filter simply transposes upper and
 * lower case letters, it is intended for demonstration purposes and
 * it serves no purpose other than to annoy the user...
 */

#include "config.h"

#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>

#include "pam_filter.h"
#include <security/pam_modutil.h>

/* ---------------------------------------------------------------- */

static void do_transpose(char *buffer,int len)
{
     int i;
     for (i=0; i<len; ++i) {
	  if (islower(buffer[i])) {
	       buffer[i] = toupper(buffer[i]);
	  } else {
	       buffer[i] = tolower(buffer[i]);
	  }
     }
}

extern char **environ;

int main(int argc, char **argv UNUSED)
{
     char buffer[BUFSIZ];
     fd_set readers;
     void (*before_user)(char *,int);
     void (*before_app)(char *,int);

     openlog("upperLOWER", LOG_CONS|LOG_PID, LOG_AUTHPRIV);

#ifdef DEBUG
     {
	  int i;

	  fprintf(stderr,"environment :[\r\n");
	  for (i=0; environ[i]; ++i) {
	       fprintf(stderr,"-> %s\r\n",environ[i]);
	  }
	  fprintf(stderr,"]: end\r\n");
     }
#endif

     if (argc != 1) {
#ifdef DEBUG
	  fprintf(stderr,"filter invoked as conventional executable\n");
#else
	  syslog(LOG_ERR, "filter invoked as conventional executable");
#endif
	  exit(1);
     }

     before_user = before_app = do_transpose;   /* assign filter functions */

     /* enter a loop that deals with the input and output of the
        user.. passing it to and from the application */

     FD_ZERO(&readers);                    /* initialize reading mask */

     for (;;) {

	  FD_SET(APPOUT_FILENO, &readers);              /* wake for output */
	  FD_SET(APPERR_FILENO, &readers);               /* wake for error */
	  FD_SET(STDIN_FILENO, &readers);                /* wake for input */

	  if ( select(APPTOP_FILE,&readers,NULL,NULL,NULL) < 0 ) {
#ifdef DEBUG
	       fprintf(stderr,"select failed\n");
#else
	       syslog(LOG_WARNING,"select failed");
#endif
	       break;
	  }

	  /* application errors */

	  if ( FD_ISSET(APPERR_FILENO,&readers) ) {
	       int got = read(APPERR_FILENO, buffer, BUFSIZ);
	       if (got <= 0) {
		    break;
	       } else {
		    /* translate to give to real terminal */
		    if (before_user != NULL)
			 before_user(buffer, got);
		    if (pam_modutil_write(STDERR_FILENO, buffer, got) != got ) {
			 syslog(LOG_WARNING,"couldn't write %d bytes?!",got);
			 break;
		    }
	       }
	  } else if ( FD_ISSET(APPOUT_FILENO,&readers) ) {    /* app output */
	       int got = read(APPOUT_FILENO, buffer, BUFSIZ);
	       if (got <= 0) {
		    break;
	       } else {
		    /* translate to give to real terminal */
		    if (before_user != NULL)
			 before_user(buffer, got);
		    if (pam_modutil_write(STDOUT_FILENO, buffer, got) != got ) {
			 syslog(LOG_WARNING,"couldn't write %d bytes!?",got);
			 break;
		    }
	       }
	  }

	  if ( FD_ISSET(STDIN_FILENO, &readers) ) {  /* user input */
	       int got = read(STDIN_FILENO, buffer, BUFSIZ);
	       if (got < 0) {
		    syslog(LOG_WARNING,"user input junked");
		    break;
	       } else if (got) {
		    /* translate to give to application */
		    if (before_app != NULL)
			 before_app(buffer, got);
		    if (pam_modutil_write(APPIN_FILENO, buffer, got) != got ) {
			 syslog(LOG_WARNING,"couldn't pass %d bytes!?",got);
			 break;
		    }
	       } else {
		    /* nothing received -- an error? */
		    syslog(LOG_WARNING,"user input null?");
		    break;
	       }
	  }
     }

     exit(0);
}

AnonSec - 2021 | Recode By D7net