ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] Не работает perl-Authen-PAM
@ 2011-02-03 20:03 Slava Dubrovskiy
  2011-02-03 20:33 ` Slava Dubrovskiy
  0 siblings, 1 reply; 7+ messages in thread
From: Slava Dubrovskiy @ 2011-02-03 20:03 UTC (permalink / raw)
  To: Devel

[-- Attachment #1: Type: text/plain, Size: 1411 bytes --]

Здравствуйте.

Пытаюсь допилить proxmox. Там используется авторизация через системных
пользователей.
Но она не работает. Также не работает пример из FAQ (пункт 1 из
/usr/lib/perl5/Authen/PAM/FAQ.pod)

Подскажите кто силен в перле в чем может быть проблема?

Вот testcase из их исходного кода:

#!/usr/bin/perl

use Authen::PAM;

sub pam_is_valid_user {
    my ($username, $password) = @_;
    my $pamh = new Authen::PAM ('login', $username, sub {
        my @res;
        while(@_) {
            my $msg_type = shift;
            my $msg = shift;
            push @res, (0, $password);
        }
        push @res, 0;
        return @res;
    });

    if (!ref ($pamh)) {
        my $err = $pamh->pam_strerror($pamh);
        die "Error during PAM init: $err";
    }

    my $res;
    $res = $pamh->pam_authenticate(0);
    if ( $res!= PAM_SUCCESS) {
        my $err = $pamh->pam_strerror($res);
        die "PAM1 auth failed: $err\n";
    }
    $res = $pamh->pam_acct_mgmt (0);
    if ( $res != PAM_SUCCESS) {
        my $err = $pamh->pam_strerror($res);
        die "PAM2 auth failed: $err\n";
    }
    $pamh = 0; # call destructor
    return 1;
}

pam_is_valid_user('slava', '123');


-- 
WBR,
Dubrovskiy Vyacheslav


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5525 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-02-04 12:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-03 20:03 [devel] Не работает perl-Authen-PAM Slava Dubrovskiy
2011-02-03 20:33 ` Slava Dubrovskiy
2011-02-03 20:42   ` Vladimir Lettiev
2011-02-03 20:52     ` Slava Dubrovskiy
2011-02-03 21:01     ` Dmitry V. Levin
2011-02-04  6:39     ` Afanasov Dmitry
2011-02-04 12:39       ` Slava Dubrovskiy

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git