~dannf/ubuntu/saucy/screen/lp1213278-from-debian

« back to all changes in this revision

Viewing changes to attacher.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2007-10-23 17:36:30 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20071023173630-6q4agogsxuzujhwd
Tags: 4.0.3-7ubuntu1
* Merge with Debian; remaining Ubuntu changes:
  - 07_norootpassword.dpatch: When locking a root-owned screen, check that
    root has a password set. If not, ask for an unlocking key. (LP#6760)
  - debian/preinst: Remove obsolete init script 'screen' on
    upgrades. The script is called 'screen-cleanup' in Debian and thus
    should be called the same in Ubuntu to avoid a permanent and pointless
    delta. This needs to be kept until after the next LTS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
806
806
#ifdef USE_PAM
807
807
  pam_handle_t *pamh = 0;
808
808
  int pam_error;
809
 
#endif
 
809
#else
810
810
  char *pass, mypass[16 + 1], salt[3];
811
 
  int using_pam = 1;
 
811
#endif
812
812
 
813
 
#ifdef USE_PAM
814
 
  if (!ppp->pw_uid)
815
 
    {
816
 
#endif
817
 
  using_pam = 0;
 
813
#ifndef USE_PAM
818
814
  pass = ppp->pw_passwd;
819
815
  if (pass == 0 || *pass == 0)
820
816
    {
847
843
      pass = crypt(mypass, salt);
848
844
      pass = ppp->pw_passwd = SaveStr(pass);
849
845
    }
850
 
#ifdef USE_PAM
851
 
    }
852
846
#endif
853
847
 
854
848
  debug("screen_builtin_lck looking in gcos field\n");
878
872
          AttacherFinit(SIGARG);
879
873
          /* NOTREACHED */
880
874
        }
881
 
      if (using_pam)
882
 
        {
883
875
#ifdef USE_PAM
884
876
      PAM_conversation.appdata_ptr = cp1;
885
877
      pam_error = pam_start("screen", ppp->pw_name, &PAM_conversation, &pamh);
890
882
      PAM_conversation.appdata_ptr = 0;
891
883
      if (pam_error == PAM_SUCCESS)
892
884
        break;
 
885
#else
 
886
      if (!strncmp(crypt(cp1, pass), pass, strlen(pass)))
 
887
        break;
893
888
#endif
894
 
        }
895
 
      else
896
 
        {
897
 
          if (!strncmp(crypt(cp1, pass), pass, strlen(pass)))
898
 
            break;
899
 
        }
900
889
      debug("screen_builtin_lck: NO!!!!!\n");
901
890
      bzero(cp1, strlen(cp1));
902
891
    }