* Re: from which hook , I can get the usrname that pppd used?
2008-05-15 8:19 from which hook , I can get the usrname that pppd used? cyx_mail
@ 2008-05-15 13:57 ` James Carlson
2008-05-15 14:53 ` cyx
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: James Carlson @ 2008-05-15 13:57 UTC (permalink / raw)
To: linux-ppp
cyx_mail writes:
> from which hook , I can get the usrname that pppd used? both chap or pap, is that a same hook?
What "user name" do you want? Inside of a script, pppd sets a bunch
of environment variables, which are documented in the "SCRIPTS"
section of the man page. (You've read through the man page, correct?)
If the peer authenticates itself, then PEERNAME will be set. The
variables ORIG_UID and PPPLOGNAME have the invoking user's UID and
name. The local 'name' value in use (the our_name[] array) isn't put
into the environment. Perhaps it could be.
If you're not talking about a script, but are instead talking about a
pppd plugin, then you can just reference the variables you want --
our_name[] or peer_authname[].
It's possible that you may need to provide more details about what
you're attempting to do, what you've already tried to do, and what
doesn't work in order to get more substantial guidance.
--
James Carlson 42.703N 71.076W <carlsonj@workingcode.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Re: from which hook , I can get the usrname that pppd used?
2008-05-15 8:19 from which hook , I can get the usrname that pppd used? cyx_mail
2008-05-15 13:57 ` James Carlson
@ 2008-05-15 14:53 ` cyx
2008-05-15 19:14 ` James Carlson
2008-05-16 0:43 ` cyx_mail
3 siblings, 0 replies; 5+ messages in thread
From: cyx @ 2008-05-15 14:53 UTC (permalink / raw)
To: linux-ppp
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 1788 bytes --]
Thank for your help! username that I want to get is the one pppd read from chap-secret or pap-secret, I think they my be store in an global var?
2008-05-15
cyx
·¢¼þÈË£º James Carlson
·¢ËÍʱ¼ä£º 2008-05-15 21:56:09
ÊÕ¼þÈË£º cyx_mail
³ËÍ£º linux-ppp
Ö÷Ì⣺ Re: from which hook , I can get the usrname that pppd used?
cyx_mail writes:
> from which hook , I can get the usrname that pppd used? both chap or pap, is that a same hook?
What "user name" do you want? Inside of a script, pppd sets a bunch
of environment variables, which are documented in the "SCRIPTS"
section of the man page. (You've read through the man page, correct?)
If the peer authenticates itself, then PEERNAME will be set. The
variables ORIG_UID and PPPLOGNAME have the invoking user's UID and
name. The local 'name' value in use (the our_name[] array) isn't put
into the environment. Perhaps it could be.
If you're not talking about a script, but are instead talking about a
pppd plugin, then you can just reference the variables you want --
our_name[] or peer_authname[].
It's possible that you may need to provide more details about what
you're attempting to do, what you've already tried to do, and what
doesn't work in order to get more substantial guidance.
--
James Carlson 42.703N 71.076W <carlsonj@workingcode.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
__________ NOD32 3040 (20080419) Information __________
This message was checked by NOD32 antivirus system.
http://www.nod32cn.com
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þiþ)í
æèw*\x1fjg¬±¨\x1e¶Ý¢jÿ¾\a«þG«éÿ¢¸\f¢·¦j:+v¨wèjØm¶ÿþø\x1e¯ù\x1e®w¥þàþf£¢·hâúÿÙ¥
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Re: from which hook , I can get the usrname that pppd used?
2008-05-15 8:19 from which hook , I can get the usrname that pppd used? cyx_mail
2008-05-15 13:57 ` James Carlson
2008-05-15 14:53 ` cyx
@ 2008-05-15 19:14 ` James Carlson
2008-05-16 0:43 ` cyx_mail
3 siblings, 0 replies; 5+ messages in thread
From: James Carlson @ 2008-05-15 19:14 UTC (permalink / raw)
To: linux-ppp
cyx writes:
> Thank for your help! username that I want to get is the one pppd read from chap-secret or pap-secret, I think they my be store in an global var?
I'm afraid you're still not being specific enough.
pppd can be configured to behave as an authenticator ("server"), an
authenticatee ("client"), both, or neither.
When configured as an authenticator, pppd will acquire a name from the
peer and will validate that identity. The resulting validated peer
name appears in the peer_authname[] array.
When configured as an authenticatee, the name pppd presents to the
peer for identification is in the our_name[] array.
This is all in the pppd/auth.c module, which is common to all
authentication schemes (including PAP and CHAP). If you're trying to
write code that integrates with pppd, I *strongly* recommend spending
the time to read through the pppd source code. The layout of the code
is fairly logical, so it's not hard to read, and there are substantial
and informative comments in many places.
(Note that it's really not proper to talk about "users" here. PPP is
a layer two technology; there are no "users." There are only peers.)
--
James Carlson 42.703N 71.076W <carlsonj@workingcode.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Re: Re: from which hook , I can get the usrname that pppd used?
2008-05-15 8:19 from which hook , I can get the usrname that pppd used? cyx_mail
` (2 preceding siblings ...)
2008-05-15 19:14 ` James Carlson
@ 2008-05-16 0:43 ` cyx_mail
3 siblings, 0 replies; 5+ messages in thread
From: cyx_mail @ 2008-05-16 0:43 UTC (permalink / raw)
To: linux-ppp
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 2167 bytes --]
ok, Thanks for your patient. I'm going to write a PPPoE Proxy base on the pppoe-server and pppd, the proxy acts both as "server" and "clent". So it acquire the usrname from the peer which connect to the proxy and establish a connection to the real pppoe-server(or BAS),so I have to acquire this two kinds of user names from pppd. any suggestions?
2008-05-16
cyx_mail
·¢¼þÈË£º James Carlson
·¢ËÍʱ¼ä£º 2008-05-16 03:16:16
ÊÕ¼þÈË£º cyx
³ËÍ£º linux-ppp
Ö÷Ì⣺ Re: Re: from which hook , I can get the usrname that pppd used?
cyx writes:
> Thank for your help! username that I want to get is the one pppd read from chap-secret or pap-secret, I think they my be store in an global var?
I'm afraid you're still not being specific enough.
pppd can be configured to behave as an authenticator ("server"), an
authenticatee ("client"), both, or neither.
When configured as an authenticator, pppd will acquire a name from the
peer and will validate that identity. The resulting validated peer
name appears in the peer_authname[] array.
When configured as an authenticatee, the name pppd presents to the
peer for identification is in the our_name[] array.
This is all in the pppd/auth.c module, which is common to all
authentication schemes (including PAP and CHAP). If you're trying to
write code that integrates with pppd, I *strongly* recommend spending
the time to read through the pppd source code. The layout of the code
is fairly logical, so it's not hard to read, and there are substantial
and informative comments in many places.
(Note that it's really not proper to talk about "users" here. PPP is
a layer two technology; there are no "users." There are only peers.)
--
James Carlson 42.703N 71.076W <carlsonj@workingcode.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to majordomo@vger.kernel.org
__________ NOD32 3090 (20080509) Information __________
This message was checked by NOD32 antivirus system.
http://www.nod32cn.com
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þiþ)í
æèw*\x1fjg¬±¨\x1e¶Ý¢jÿ¾\a«þG«éÿ¢¸\f¢·¦j:+v¨wèjØm¶ÿþø\x1e¯ù\x1e®w¥þàþf£¢·hâúÿÙ¥
^ permalink raw reply [flat|nested] 5+ messages in thread