Deleted Added
sdiff udiff text old ( 98243 ) new ( 202192 )
full compact
1/*-
2 * Copyright (c) 1997 Brian Somers <brian@Awfulhak.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/usr.sbin/ppp/id.c 202192 2010-01-13 17:54:32Z ed $
27 */
28
29#include <sys/param.h>
30#include <sys/socket.h>
31#include <sys/un.h>
32
33#include <sys/ioctl.h>
34#include <fcntl.h>

--- 9 unchanged lines hidden (view full) ---

44#include <sys/linker.h>
45#endif
46#include <unistd.h>
47#ifdef __OpenBSD__
48#include <util.h>
49#else
50#include <libutil.h>
51#endif
52#include <utmpx.h>
53
54#include "log.h"
55#include "main.h"
56#include "id.h"
57
58static int uid;
59static int euid;
60

--- 136 unchanged lines hidden (view full) ---

197 ID0set0();
198 ret = uu_unlock(basettyname);
199 log_Printf(LogID0, "%d = uu_unlock(\"%s\")\n", ret, basettyname);
200 ID0setuser();
201 return ret;
202}
203
204void
205ID0login(const struct utmpx *ut)
206{
207 ID0set0();
208 pututxline(ut);
209 log_Printf(LogID0, "pututxline(\"%.*s\", \"%.*s\", \"%.*s\", \"%.*s\")\n",
210 (int)sizeof ut->ut_id, ut->ut_id,
211 (int)sizeof ut->ut_user, ut->ut_user,
212 (int)sizeof ut->ut_line, ut->ut_line,
213 (int)sizeof ut->ut_host, ut->ut_host);
214 ID0setuser();
215}
216
217void
218ID0logout(const struct utmpx *ut)
219{
220 ID0set0();
221 pututxline(ut);
222 log_Printf(LogID0, "pututxline(\"%.*s\")\n",
223 (int)sizeof ut->ut_id, ut->ut_id);
224 ID0setuser();
225}
226
227int
228ID0bind_un(int s, const struct sockaddr_un *name)
229{
230 int result;
231

--- 61 unchanged lines hidden ---