diff --git a/src/server/ChangeLog b/src/server/ChangeLog index 9299e1a3d37be9627ad63a2c4c5b172d7fb25f05..df7b3b9095a02f2657c37bc886ffc962f7d731b7 100644 --- a/src/server/ChangeLog +++ b/src/server/ChangeLog @@ -1,3 +1,8 @@ +Tue Mar 31 23:48:47 1992 Per Cederqvist (ceder@robert) + + * rfc931.[hc]: New file. + * Makefile: (GEN_OBJS, GEN_SRCS): Use it. + Tue Mar 24 18:05:18 1992 Per Cederqvist (ceder@robert) * simple-cache.c (save_one_text): Check that the entire file made diff --git a/src/server/Makefile b/src/server/Makefile index 4ba35502be8a86549ac1ac378be65c20d6aa3b5e..ba8d2c385144ae2c22635c24c2ff7dce071cff7b 100755 --- a/src/server/Makefile +++ b/src/server/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile,v 0.21 1992/02/26 18:45:23 ceder Exp $ +# $Id: Makefile,v 0.22 1992/03/31 21:51:25 ceder Exp $ # Copyright (C) 1991 Lysator Academic Computer Association. # # This file is part of the LysKOM server. @@ -22,7 +22,7 @@ # # Please mail bug reports to bug-lyskom@lysator.liu.se. # -# $Id: Makefile,v 0.21 1992/02/26 18:45:23 ceder Exp $ +# $Id: Makefile,v 0.22 1992/03/31 21:51:25 ceder Exp $ include Topdir.make SCRIPTDIR = $(TOPDIR)/scripts @@ -64,13 +64,13 @@ GENOBJS = connections.o log.o $(ATOMS) \ kom-types.o \ send-async.o server-config.o text-garb.o \ missing-ansi.o isc-parse.o memory.o $(PROTA) $(MUX) \ - internal-connections.o + internal-connections.o rfc931.o GEN_SRCS = connections.c log.c $(ATOMS_SRCS) \ kom-types.c \ send-async.c server-config.c text-garb.c \ missing-ansi.c isc-parse.c memory.c $(PROTA_SRCS) $(MUX_SRCS) \ - internal-connections.c + internal-connections.c rfc931.o # Files for lyskomd. diff --git a/src/server/rfc931.c b/src/server/rfc931.c new file mode 100644 index 0000000000000000000000000000000000000000..e78cbb937fe2d9c4e7b5831890467abe4e407cef --- /dev/null +++ b/src/server/rfc931.c @@ -0,0 +1,60 @@ +/* + * $Id: rfc931.c,v 1.1 1992/03/31 21:51:30 ceder Exp $ + * Copyright (C) 1991 Lysator Academic Computer Association. + * + * This file is part of the LysKOM server. + * + * LysKOM 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 1, or (at your option) + * any later version. + * + * LysKOM is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with LysKOM; see the file COPYING. If not, write to + * Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN, + * or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, + * MA 02139, USA. + * + * Please mail bug reports to bug-lyskom@lysator.liu.se. + */ + +/* + * This function retrieves the real user that owns the TCP/IP link + * that is connecting via the IscSession "scb". The returned string + * points to static data which is overwritten on the next call. + * + * Link with "-lauthuser". + */ + +#include <stddef.h> +#include "isc-interface.h" +#include <m-config.h> +#include "rfc931.h" +#include <authuser.h> + +#ifdef RFC_931 + +char * +get_real_username(IscSession *scb) +{ + extern int auth_fd2(); + extern char *auth_tcpuser2(); + + unsigned long inlocal; + unsigned long inremote; + unsigned short local; + unsigned short remote; + + + if (auth_fd2(scb->fd, &inlocal, &inremote, + &local, &remote) == -1) + return NULL; + + return auth_tcpuser2(inlocal, inremote, local, remote); +} +#endif diff --git a/src/server/rfc931.h b/src/server/rfc931.h new file mode 100644 index 0000000000000000000000000000000000000000..5e1380430f7d73b1971bb3b7dfe99acce2692f58 --- /dev/null +++ b/src/server/rfc931.h @@ -0,0 +1,26 @@ +/* + * $Id: rfc931.h,v 1.1 1992/03/31 21:51:34 ceder Exp $ + * Copyright (C) 1991 Lysator Academic Computer Association. + * + * This file is part of the LysKOM server. + * + * LysKOM 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 1, or (at your option) + * any later version. + * + * LysKOM is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with LysKOM; see the file COPYING. If not, write to + * Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN, + * or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, + * MA 02139, USA. + * + * Please mail bug reports to bug-lyskom@lysator.liu.se. + */ + +char *get_real_username(IscSession *scb);