From f70bb544331f35639bf64401ad035e6bcbaa9ae3 Mon Sep 17 00:00:00 2001 From: Garrett Wollman Date: Thu, 30 May 2002 21:26:49 +0000 Subject: [PATCH] Fix conflict with by renaming _PATH_LOGIN to _PATH_SLIP_LOGIN, and likewise LOGOUT for consistency. Fix a few nearby style bugs. --- usr.sbin/sliplogin/pathnames.h | 7 ++++--- usr.sbin/sliplogin/sliplogin.c | 18 +++++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/usr.sbin/sliplogin/pathnames.h b/usr.sbin/sliplogin/pathnames.h index 3bee95154699..3ed5d9879427 100644 --- a/usr.sbin/sliplogin/pathnames.h +++ b/usr.sbin/sliplogin/pathnames.h @@ -30,7 +30,8 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)pathnames.h 8.1 (Berkeley) 6/6/93 + * From: @(#)pathnames.h 8.1 (Berkeley) 6/6/93 + * $FreeBSD$ */ #ifndef COMPAT @@ -41,7 +42,7 @@ #define _PATH_ACCESS "/etc/sliphome/slip.hosts" #define _PATH_SLPARMS "/etc/sliphome/slip.slparms" -#define _PATH_LOGIN "/etc/sliphome/slip.login" -#define _PATH_LOGOUT "/etc/sliphome/slip.logout" +#define _PATH_SLIP_LOGIN "/etc/sliphome/slip.login" +#define _PATH_SLIP_LOGOUT "/etc/sliphome/slip.logout" #define _PATH_DEBUG "/tmp/sliplogin.XXXXXX" diff --git a/usr.sbin/sliplogin/sliplogin.c b/usr.sbin/sliplogin/sliplogin.c index 2d8925ea9828..8a3bc5ee6f6c 100644 --- a/usr.sbin/sliplogin/sliplogin.c +++ b/usr.sbin/sliplogin/sliplogin.c @@ -202,14 +202,16 @@ findid(name) * one specific to this host. If none found, try for * a generic one. */ - (void)snprintf(loginfile, sizeof(loginfile), "%s.%s", _PATH_LOGIN, name); + (void)snprintf(loginfile, sizeof(loginfile), "%s.%s", + _PATH_SLIP_LOGIN, name); if (access(loginfile, R_OK|X_OK) != 0) { - (void)strncpy(loginfile, _PATH_LOGIN, sizeof(loginfile)-1); - loginfile[sizeof(loginfile)-1] = '\0'; + (void)strncpy(loginfile, _PATH_SLIP_LOGIN, + sizeof(loginfile) - 1); + loginfile[sizeof(loginfile) - 1] = '\0'; if (access(loginfile, R_OK|X_OK)) { syslog(LOG_ERR, "access denied for %s - no %s\n", - name, _PATH_LOGIN); + name, _PATH_SLIP_LOGIN); exit(5); } } @@ -307,10 +309,12 @@ hup_handler(s) (void) close(0); seteuid(0); - (void)snprintf(logoutfile, sizeof(logoutfile), "%s.%s", _PATH_LOGOUT, loginname); + (void)snprintf(logoutfile, sizeof(logoutfile), "%s.%s", + _PATH_SLIP_LOGOUT, loginname); if (access(logoutfile, R_OK|X_OK) != 0) { - (void)strncpy(logoutfile, _PATH_LOGOUT, sizeof(logoutfile)-1); - logoutfile[sizeof(logoutfile)-1] = '\0'; + (void)strncpy(logoutfile, _PATH_SLIP_LOGOUT, + sizeof(logoutfile) - 1); + logoutfile[sizeof(logoutfile) - 1] = '\0'; } if (access(logoutfile, R_OK|X_OK) == 0) { char logincmd[2*MAXPATHLEN+32];