1 --- fam-2.6.7/src/Listener.c++.cleanup Mon Dec 17 20:03:37 2001
2 +++ fam-2.6.7/src/Listener.c++ Tue Jan 15 11:44:45 2002
4 // Keep the scheduler from helpfully cleaning this up.
5 Scheduler::remove_onetime_task(cleanup_negotiation, nc);
7 + // Remove the temp file
8 + uid_t preveuid = geteuid();
9 + if (preveuid) seteuid(0);
11 + unlink(nc->sun.sun_path);
12 + if (nc->uid) seteuid(0);
15 Log::debug("client fd %d is local/trusted (socket %s, uid %d).",
16 client_fd, nc->sun.sun_path, nc->uid);
17 Cred cred(nc->uid, client_fd);
18 - new LocalClient(client_fd, &(nc->sun), cred);
19 + new LocalClient(client_fd, cred);
20 // We don't need a reference to this object. The constructor
21 // takes care of registering it with the Scheduler.
23 --- fam-2.6.7/src/LocalClient.c++.cleanup Mon Dec 17 20:03:37 2001
24 +++ fam-2.6.7/src/LocalClient.c++ Tue Jan 15 11:43:04 2002
29 -LocalClient::LocalClient(int fd, const struct sockaddr_un *addr, Cred &cred)
30 +LocalClient::LocalClient(int fd, Cred &cred)
31 : TCP_Client(LOCALHOST(), fd, cred)
33 assert(cred.is_valid());
34 - sun.sun_family = AF_UNIX;
35 - strncpy(sun.sun_path, addr->sun_path, sizeof(sun.sun_path));
36 - sun.sun_path[sizeof(sun.sun_path) - 1] = '\0';
39 LocalClient::~LocalClient()
41 - if (geteuid() != cred.uid()) cred.become_user();
42 - unlink(sun.sun_path);
44 --- fam-2.6.7/src/LocalClient.h.cleanup Mon Dec 17 20:03:37 2001
45 +++ fam-2.6.7/src/LocalClient.h Tue Jan 15 11:43:04 2002
50 - LocalClient(int fd, const struct sockaddr_un *addr, Cred &cred);
51 + LocalClient(int fd, Cred &cred);
56 - struct sockaddr_un sun;
60 #endif /* !RemoteClient_included */