Get the repository a bit closer to what will be released

* Remove .cvsignore files and create .gitignore files where needed
* Add files that were in the last release but not in CVS

Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Paul Mackerras 2008-07-27 17:28:29 +10:00
parent 7a7ed0a1a2
commit 3e451dfe42
21 changed files with 462 additions and 36 deletions

View File

@ -1,7 +0,0 @@
Makefile
ppp.info
pppd-bsd
pppd-sunos4
pppd-ultrix
pppd-linux
pppd-sol2

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
*.orig
*~
*.o
*.so
*.a
*.cat8
Makefile

View File

@ -1,3 +0,0 @@
Makefile
chat
chat.cat8

1
chat/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
chat

View File

@ -0,0 +1,16 @@
all: pppgetpass.vt pppgetpass.gtk
pppgetpass.vt: pppgetpass.vt.o
pppgetpass.gtk: pppgetpass.gtk.o
$(CC) $(LDFLAGS) pppgetpass.gtk.o `gtk-config --libs` -o pppgetpass.gtk
pppgetpass.gtk.o: pppgetpass.gtk.c
$(CC) $(CFLAGS) -c pppgetpass.gtk.c `gtk-config --cflags`
install: all
install -m 755 pppgetpass.sh /usr/bin/pppgetpass
install -m 4755 -o root -g root pppgetpass.vt /usr/bin/
install -m 755 -o root -g root pppgetpass.gtk /usr/X11/bin/
clean:
rm -f *.o pppgetpass.gtk pppgetpass.vt core

View File

@ -0,0 +1,18 @@
.TH PPPGETPASS 8 "26 Sep 1999"
.SH NAME
pppgetpass \- prompt for PAP password
.SH SYNOPSIS
.B pppgetpass
.I client server fd
.SH DESCRIPTION
.B pppgetpass
the outer half of a plugin for PAP password prompting in pppd.
If the peer requires PAP, and the
.B passprompt.so
plugin is loaded into pppd, it will run
.B /usr/sbin/pppgetpass
(or another program specified by the
.B promptprog
option) to prompt the user for the password.
.SH SEE ALSO
pppd(8)

View File

@ -0,0 +1,92 @@
#include <glib.h>
#include <gdk/gdk.h>
#include <gtk/gtkwindow.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkbutton.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkentry.h>
#include <gtk/gtksignal.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <syslog.h>
int outfd;
int err;
static void okpressed(void *widget, void *clientdata)
{
GtkWidget *answer=clientdata;
gchar *pass;
int passlen;
ssize_t wrote;
(void)widget;
pass=gtk_entry_get_text(GTK_ENTRY(answer));
passlen=strlen(pass);
if(!passlen)
return;
if((wrote=write(outfd, pass, passlen))!=passlen) {
if(wrote<0)
syslog(LOG_ERR, "write error on outpipe: %m");
else
syslog(LOG_ERR, "short write on outpipe");
err=1;
}
gtk_main_quit();
}
int main(int argc, char **argv)
{
GtkWidget *mainwindow, *vbox, *question, *answer, *ok;
char buf[1024];
gtk_init(&argc, &argv);
openlog(argv[0], LOG_PID, LOG_DAEMON);
if(argc!=4) {
syslog(LOG_WARNING, "Usage error");
return 1;
}
outfd=atoi(argv[3]);
mainwindow=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(mainwindow), "pppgetpass");
gtk_signal_connect(GTK_OBJECT(mainwindow), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit), 0);
vbox=gtk_vbox_new(FALSE, 5);
gtk_container_add(GTK_CONTAINER(mainwindow), vbox);
gtk_widget_show(vbox);
if(argv[1][0] && argv[2][0])
snprintf(buf, sizeof buf, "Password for PPP client %s on server %s: ", argv[1], argv[2]);
else if(argv[1][0] && !argv[2][0])
snprintf(buf, sizeof buf, "Password for PPP client %s: ", argv[1]);
else if(!argv[1][0] && argv[2][0])
snprintf(buf, sizeof buf, "Password for PPP on server %s: ", argv[2]);
else
snprintf(buf, sizeof buf, "Enter PPP password: ");
question=gtk_label_new(buf);
gtk_box_pack_start(GTK_BOX(vbox), question, FALSE, TRUE, 0);
gtk_widget_show(question);
answer=gtk_entry_new();
gtk_entry_set_visibility(GTK_ENTRY(answer), 0);
gtk_box_pack_start(GTK_BOX(vbox), answer, FALSE, TRUE, 0);
gtk_widget_show(answer);
ok=gtk_button_new_with_label("OK");
gtk_box_pack_start(GTK_BOX(vbox), ok, FALSE, TRUE, 0);
gtk_signal_connect(GTK_OBJECT(ok), "clicked",
GTK_SIGNAL_FUNC(okpressed), answer);
gtk_widget_show(ok);
gtk_widget_show(mainwindow);
gtk_main();
return err;
}

View File

@ -0,0 +1,7 @@
#!/bin/sh
if [ -z "$DISPLAY" ]; then
exec pppgetpass.vt "$@"
else
exec pppgetpass.gtk "$@"
fi

View File

@ -0,0 +1,218 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <syslog.h>
#include <termios.h>
#include <sys/vt.h>
static int console_owner(uid_t, int);
int main(int argc, char **argv)
{
int console;
uid_t uid;
struct vt_stat origstate;
int openvtnum;
char openvtname[256];
int openvt;
gid_t gid;
int chowned;
FILE *fp;
struct termios t;
char pass[256], *nl;
int outfd, passlen;
ssize_t wrote;
console=open("/dev/console", O_RDWR);
uid=getuid();
gid=getgid();
seteuid(uid);
openlog(argv[0], LOG_PID, LOG_DAEMON);
if(argc!=4) {
syslog(LOG_WARNING, "Usage error");
return 1;
}
if(console<0) {
syslog(LOG_ERR, "open(/dev/console): %m");
return 1;
}
if(ioctl(console, VT_GETSTATE, &origstate)<0) {
syslog(LOG_ERR, "VT_GETSTATE: %m");
return 1;
}
if(uid) {
if(!console_owner(uid, origstate.v_active)) {
int i;
for(i=0;i<64;++i) {
if(i!=origstate.v_active && console_owner(uid, i))
break;
}
if(i==64) {
syslog(LOG_WARNING, "run by uid %lu not at console", (unsigned long)uid);
return 1;
}
}
}
if(ioctl(console, VT_OPENQRY, &openvtnum)<0) {
syslog(LOG_ERR, "VT_OPENQRY: %m");
return 1;
}
if(openvtnum==-1) {
syslog(LOG_ERR, "No free VTs");
return 1;
}
snprintf(openvtname, sizeof openvtname, "/dev/tty%d", openvtnum);
seteuid(0);
openvt=open(openvtname, O_RDWR);
if(openvt<0) {
seteuid(uid);
syslog(LOG_ERR, "open(%s): %m", openvtname);
return 1;
}
chowned=fchown(openvt, uid, gid);
if(chowned<0) {
seteuid(uid);
syslog(LOG_ERR, "fchown(%s): %m", openvtname);
return 1;
}
close(console);
if(ioctl(openvt, VT_ACTIVATE, openvtnum)<0) {
seteuid(uid);
syslog(LOG_ERR, "VT_ACTIVATE(%d): %m", openvtnum);
return 1;
}
while(ioctl(openvt, VT_WAITACTIVE, openvtnum)<0) {
if(errno!=EINTR) {
ioctl(openvt, VT_ACTIVATE, origstate.v_active);
seteuid(uid);
syslog(LOG_ERR, "VT_WAITACTIVE(%d): %m", openvtnum);
return 1;
}
}
seteuid(uid);
fp=fdopen(openvt, "r+");
if(!fp) {
seteuid(0);
ioctl(openvt, VT_ACTIVATE, origstate.v_active);
seteuid(uid);
syslog(LOG_ERR, "fdopen(%s): %m", openvtname);
return 1;
}
if(tcgetattr(openvt, &t)<0) {
seteuid(0);
ioctl(openvt, VT_ACTIVATE, origstate.v_active);
seteuid(uid);
syslog(LOG_ERR, "tcgetattr(%s): %m", openvtname);
return 1;
}
t.c_lflag &= ~ECHO;
if(tcsetattr(openvt, TCSANOW, &t)<0) {
seteuid(0);
ioctl(openvt, VT_ACTIVATE, origstate.v_active);
seteuid(uid);
syslog(LOG_ERR, "tcsetattr(%s): %m", openvtname);
return 1;
}
if(fprintf(fp, "\033[2J\033[H")<0) {
seteuid(0);
ioctl(openvt, VT_ACTIVATE, origstate.v_active);
seteuid(uid);
syslog(LOG_ERR, "write error on %s: %m", openvtname);
return 1;
}
if(argv[1][0] && argv[2][0]) {
if(fprintf(fp, "Password for PPP client %s on server %s: ", argv[1], argv[2])<0) {
seteuid(0);
ioctl(openvt, VT_ACTIVATE, origstate.v_active);
seteuid(uid);
syslog(LOG_ERR, "write error on %s: %m", openvtname);
return 1;
}
} else if(argv[1][0] && !argv[2][0]) {
if(fprintf(fp, "Password for PPP client %s: ", argv[1])<0) {
syslog(LOG_ERR, "write error on %s: %m", openvtname);
seteuid(0);
ioctl(openvt, VT_ACTIVATE, origstate.v_active);
seteuid(uid);
return 1;
}
} else if(!argv[1][0] && argv[2][0]) {
if(fprintf(fp, "Password for PPP on server %s: ", argv[2])<0) {
seteuid(0);
ioctl(openvt, VT_ACTIVATE, origstate.v_active);
seteuid(uid);
syslog(LOG_ERR, "write error on %s: %m", openvtname);
return 1;
}
} else {
if(fprintf(fp, "Enter PPP password: ")<0) {
seteuid(0);
ioctl(openvt, VT_ACTIVATE, origstate.v_active);
seteuid(uid);
syslog(LOG_ERR, "write error on %s: %m", openvtname);
return 1;
}
}
if(!fgets(pass, sizeof pass, fp)) {
seteuid(0);
ioctl(openvt, VT_ACTIVATE, origstate.v_active);
seteuid(uid);
if(ferror(fp)) {
syslog(LOG_ERR, "read error on %s: %m", openvtname);
}
return 1;
}
if((nl=strchr(pass, '\n')))
*nl=0;
passlen=strlen(pass);
outfd=atoi(argv[3]);
if((wrote=write(outfd, pass, passlen))!=passlen) {
seteuid(0);
ioctl(openvt, VT_ACTIVATE, origstate.v_active);
seteuid(uid);
if(wrote<0)
syslog(LOG_ERR, "write error on outpipe: %m");
else
syslog(LOG_ERR, "short write on outpipe");
return 1;
}
seteuid(0);
ioctl(openvt, VT_ACTIVATE, origstate.v_active);
seteuid(uid);
return 0;
}
static int console_owner(uid_t uid, int cons)
{
char name[256];
struct stat st;
snprintf(name, sizeof name, "/dev/tty%d", cons);
if(stat(name, &st)<0) {
if(errno!=ENOENT)
syslog(LOG_ERR, "stat(%s): %m", name);
return 0;
}
return uid==st.st_uid;
}

99
include/linux/if_ether.h Normal file
View File

@ -0,0 +1,99 @@
/*
* INET An implementation of the TCP/IP protocol suite for the LINUX
* operating system. INET is implemented using the BSD Socket
* interface as the means of communication with the user level.
*
* Global definitions for the Ethernet IEEE 802.3 interface.
*
* Version: @(#)if_ether.h 1.0.1a 02/08/94
*
* Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
* Donald Becker, <becker@super.org>
* Alan Cox, <alan@redhat.com>
* Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
#ifndef _LINUX_IF_ETHER_H
#define _LINUX_IF_ETHER_H
/*
* IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
* and FCS/CRC (frame check sequence).
*/
#define ETH_ALEN 6 /* Octets in one ethernet addr */
#define ETH_HLEN 14 /* Total octets in header. */
#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
#define ETH_DATA_LEN 1500 /* Max. octets in payload */
#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
/*
* These are the defined Ethernet Protocol ID's.
*/
#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
#define ETH_P_PUP 0x0200 /* Xerox PUP packet */
#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
#define ETH_P_IP 0x0800 /* Internet Protocol packet */
#define ETH_P_X25 0x0805 /* CCITT X.25 */
#define ETH_P_ARP 0x0806 /* Address Resolution packet */
#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
#define ETH_P_LAT 0x6004 /* DEC LAT */
#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
#define ETH_P_CUST 0x6006 /* DEC Customer use */
#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
#define ETH_P_ATALK 0x809B /* Appletalk DDP */
#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
#define ETH_P_IPX 0x8137 /* IPX over DIX */
#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport
* over Ethernet
*/
/*
* Non DIX types. Won't clash for 1500 types.
*/
#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
#define ETH_P_802_2 0x0004 /* 802.2 frames */
#define ETH_P_SNAP 0x0005 /* Internal only */
#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
#define ETH_P_ECONET 0x0018 /* Acorn Econet */
/*
* This is an Ethernet frame header.
*/
struct ethhdr
{
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
unsigned char h_source[ETH_ALEN]; /* source ether addr */
unsigned short h_proto; /* packet type ID field */
};
#endif /* _LINUX_IF_ETHER_H */

View File

@ -1 +0,0 @@
debug

View File

@ -1 +0,0 @@
keep

View File

@ -1,9 +0,0 @@
Makefile
pppd
pppd.0
pppd.cat8
y.tab.h
y.tab.c
scanner.c
grammar.c
lex.yy.c

1
pppd/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
pppd

1
pppd/plugins/rp-pppoe/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
pppoe-discovery

View File

@ -1,2 +0,0 @@
pppdump
Makefile

1
pppdump/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
pppdump

View File

@ -1,3 +0,0 @@
Makefile
pppstats
pppstats.cat8

1
pppstats/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
pppstats

View File

@ -1,5 +0,0 @@
ppp
ppp_ahdl
ppp_comp
Makefile
sparcv9

View File

@ -1,5 +0,0 @@
ppp
ppp_ahdl
ppp_comp
Makefile
sparcv9