Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 121887 Details for
Bug 180180
net-dialup/ppp patch for /etc/ppp/auth-fail
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
ppp-2.4.4-LOCALNAME-auth_fail.patch
ppp-2.4.4-LOCALNAME-auth_fail.patch (text/plain), 4.95 KB, created by
Jaco Kroon
on 2007-06-13 06:38:23 UTC
(
hide
)
Description:
ppp-2.4.4-LOCALNAME-auth_fail.patch
Filename:
MIME Type:
Creator:
Jaco Kroon
Created:
2007-06-13 06:38:23 UTC
Size:
4.95 KB
patch
obsolete
>diff -ru ppp-2.4.4.orig/pppd/auth.c ppp-2.4.4/pppd/auth.c >--- ppp-2.4.4.orig/pppd/auth.c 2006-06-18 13:26:00.000000000 +0200 >+++ ppp-2.4.4/pppd/auth.c 2007-06-13 08:28:55.000000000 +0200 >@@ -260,7 +260,7 @@ > struct wordlist **, struct wordlist **, > char *, int)); > static void free_wordlist __P((struct wordlist *)); >-static void auth_script __P((char *)); >+static void auth_script __P((char *, int)); > static void auth_script_done __P((void *)); > static void set_allowed_addrs __P((int, struct wordlist *, struct wordlist *)); > static int some_ip_ok __P((struct wordlist *)); >@@ -683,7 +683,7 @@ > if (auth_script_state == s_up && auth_script_pid == 0) { > update_link_stats(unit); > auth_script_state = s_down; >- auth_script(_PATH_AUTHDOWN); >+ auth_script(_PATH_AUTHDOWN, 0); > } > } > if (!doing_multilink) { >@@ -814,7 +814,7 @@ > auth_state = s_up; > if (auth_script_state == s_down && auth_script_pid == 0) { > auth_script_state = s_up; >- auth_script(_PATH_AUTHUP); >+ auth_script(_PATH_AUTHUP, 0); > } > } > >@@ -913,6 +913,7 @@ > * Authentication failure: take the link down > */ > status = EXIT_PEER_AUTH_FAILED; >+ auth_script(_PATH_AUTHFAIL, 1); > lcp_close(unit, "Authentication failed"); > } > >@@ -991,6 +992,7 @@ > * authentication secrets. > */ > status = EXIT_AUTH_TOPEER_FAILED; >+ auth_script(_PATH_AUTHFAIL, 1); > lcp_close(unit, "Failed to authenticate ourselves to peer"); > } > >@@ -1223,6 +1225,8 @@ > if (user[0] == 0) > strlcpy(user, our_name, sizeof(user)); > >+ script_setenv("LOCALNAME", user, 0); >+ > /* > * If we have a default route, require the peer to authenticate > * unless the noauth option was given or the real user is root. >@@ -2524,13 +2528,13 @@ > case s_up: > if (auth_state == s_down) { > auth_script_state = s_down; >- auth_script(_PATH_AUTHDOWN); >+ auth_script(_PATH_AUTHDOWN, 0); > } > break; > case s_down: > if (auth_state == s_up) { > auth_script_state = s_up; >- auth_script(_PATH_AUTHUP); >+ auth_script(_PATH_AUTHUP, 0); > } > break; > } >@@ -2541,8 +2545,9 @@ > * interface-name peer-name real-user tty speed > */ > static void >-auth_script(script) >+auth_script(script, wait) > char *script; >+ int wait; > { > char strspeed[32]; > struct passwd *pw; >@@ -2566,5 +2571,8 @@ > argv[5] = strspeed; > argv[6] = NULL; > >- auth_script_pid = run_program(script, argv, 0, auth_script_done, NULL, 0); >+ if (wait) >+ run_program(script, argv, 0, NULL, NULL, 1); >+ else >+ auth_script_pid = run_program(script, argv, 0, auth_script_done, NULL, 0); > } >Only in ppp-2.4.4/pppd: auth.c.orig >diff -ru ppp-2.4.4.orig/pppd/pathnames.h ppp-2.4.4/pppd/pathnames.h >--- ppp-2.4.4.orig/pppd/pathnames.h 2005-08-26 01:59:34.000000000 +0200 >+++ ppp-2.4.4/pppd/pathnames.h 2007-06-13 08:28:55.000000000 +0200 >@@ -27,6 +27,7 @@ > #define _PATH_IPPREUP _ROOT_PATH "/etc/ppp/ip-pre-up" > #define _PATH_AUTHUP _ROOT_PATH "/etc/ppp/auth-up" > #define _PATH_AUTHDOWN _ROOT_PATH "/etc/ppp/auth-down" >+#define _PATH_AUTHFAIL _ROOT_PATH "/etc/ppp/auth-fail" > #define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options." > #define _PATH_CONNERRS _ROOT_PATH "/etc/ppp/connect-errors" > #define _PATH_PEERFILES _ROOT_PATH "/etc/ppp/peers/" >diff -ru ppp-2.4.4.orig/pppd/pppd.8 ppp-2.4.4/pppd/pppd.8 >--- ppp-2.4.4.orig/pppd/pppd.8 2006-06-16 02:01:23.000000000 +0200 >+++ ppp-2.4.4/pppd/pppd.8 2007-06-13 08:28:55.000000000 +0200 >@@ -1531,8 +1531,8 @@ > Pppd invokes scripts at various stages in its processing which can be > used to perform site-specific ancillary processing. These scripts are > usually shell scripts, but could be executable code files instead. >-Pppd does not wait for the scripts to finish (except for the ip-pre-up >-script). The scripts are >+Pppd does not wait for the scripts to finish (except for the ip-pre-up, >+and auth-fail scripts). The scripts are > executed as root (with the real and effective user-id set to 0), so > that they can do things such as update routing tables or run > privileged daemons. Be careful that the contents of these scripts do >@@ -1560,6 +1560,11 @@ > The authenticated name of the peer. This is only set if the peer > authenticates itself. > .TP >+.B LOCALNAME >+The username passed to the user option of the pppd daemon. This is >+handy to identify which account was used for authentication purposes >+when multiple accounts is available. >+.TP > .B SPEED > The baud rate of the tty device. > .TP >@@ -1612,6 +1617,11 @@ > /etc/ppp/auth\-up was previously executed. It is executed in the same > manner with the same parameters as /etc/ppp/auth\-up. > .TP >+.B /etc/ppp/auth\-fail >+A program or script which is executed should authentication fail. pppd >+waits for this script to finish. It is executed in the same manner, with >+the same parameters as /etc/ppp/auth\-up. >+.TP > .B /etc/ppp/ip\-pre\-up > A program or script which is executed just before the ppp network > interface is brought up. It is executed with the same parameters as >Only in ppp-2.4.4/pppd: pppd.8.orig
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 180180
:
120582
|
120663
|
121807
|
121809
| 121887