]> git.pld-linux.org Git - packages/fam.git/blob - fam-cleanup.patch
- include example in -devel
[packages/fam.git] / fam-cleanup.patch
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
3 @@ -287,10 +287,18 @@
4      //  Keep the scheduler from helpfully cleaning this up.
5      Scheduler::remove_onetime_task(cleanup_negotiation, nc);
6  
7 +    //  Remove the temp file
8 +    uid_t preveuid = geteuid();
9 +    if (preveuid) seteuid(0);
10 +    seteuid(nc->uid);
11 +    unlink(nc->sun.sun_path);
12 +    if (nc->uid) seteuid(0);
13 +    seteuid(preveuid);
14 +
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.
22  
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
25 @@ -29,17 +29,12 @@
26  #include "Log.h"
27  #include "Cred.h"
28  
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)
32  {
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';
37  }
38  
39  LocalClient::~LocalClient()
40  {
41 -    if (geteuid() != cred.uid()) cred.become_user();
42 -    unlink(sun.sun_path);
43  }
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
46 @@ -33,13 +33,8 @@
47  
48  public:
49  
50 -    LocalClient(int fd, const struct sockaddr_un *addr, Cred &cred);
51 +    LocalClient(int fd, Cred &cred);
52      ~LocalClient();
53 -
54 -private:
55 -
56 -    struct sockaddr_un sun;
57 -
58  };
59  
60  #endif /* !RemoteClient_included */
This page took 0.062053 seconds and 3 git commands to generate.