]> git.pld-linux.org Git - packages/fam.git/commitdiff
- Remove the temp file
authorMarcin Krzyżanowski <marcin.krzyzanowski@hakore.com>
Thu, 25 Sep 2003 01:32:39 +0000 (01:32 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    fam-cleanup.patch -> 1.1

fam-cleanup.patch [new file with mode: 0644]

diff --git a/fam-cleanup.patch b/fam-cleanup.patch
new file mode 100644 (file)
index 0000000..711ccd8
--- /dev/null
@@ -0,0 +1,60 @@
+--- fam-2.6.7/fam/Listener.c++.cleanup Mon Dec 17 20:03:37 2001
++++ fam-2.6.7/fam/Listener.c++ Tue Jan 15 11:44:45 2002
+@@ -287,10 +287,18 @@
+     //  Keep the scheduler from helpfully cleaning this up.
+     Scheduler::remove_onetime_task(cleanup_negotiation, nc);
++    //  Remove the temp file
++    uid_t preveuid = geteuid();
++    if (preveuid) seteuid(0);
++    seteuid(nc->uid);
++    unlink(nc->sun.sun_path);
++    if (nc->uid) seteuid(0);
++    seteuid(preveuid);
++
+     Log::debug("client fd %d is local/trusted (socket %s, uid %d).",
+                client_fd, nc->sun.sun_path, nc->uid);
+     Cred cred(nc->uid, client_fd);
+-    new LocalClient(client_fd, &(nc->sun), cred);
++    new LocalClient(client_fd, cred);
+     // We don't need a reference to this object.  The constructor
+     // takes care of registering it with the Scheduler.
+--- fam-2.6.7/fam/LocalClient.c++.cleanup      Mon Dec 17 20:03:37 2001
++++ fam-2.6.7/fam/LocalClient.c++      Tue Jan 15 11:43:04 2002
+@@ -29,17 +29,12 @@
+ #include "Log.h"
+ #include "Cred.h"
+-LocalClient::LocalClient(int fd, const struct sockaddr_un *addr, Cred &cred)
++LocalClient::LocalClient(int fd, Cred &cred)
+ : TCP_Client(LOCALHOST(), fd, cred)
+ {
+     assert(cred.is_valid());
+-    sun.sun_family = AF_UNIX;
+-    strncpy(sun.sun_path, addr->sun_path, sizeof(sun.sun_path));
+-    sun.sun_path[sizeof(sun.sun_path) - 1] = '\0';
+ }
+ LocalClient::~LocalClient()
+ {
+-    if (geteuid() != cred.uid()) cred.become_user();
+-    unlink(sun.sun_path);
+ }
+--- fam-2.6.7/fam/LocalClient.h.cleanup        Mon Dec 17 20:03:37 2001
++++ fam-2.6.7/fam/LocalClient.h        Tue Jan 15 11:43:04 2002
+@@ -33,13 +33,8 @@
+ public:
+-    LocalClient(int fd, const struct sockaddr_un *addr, Cred &cred);
++    LocalClient(int fd, Cred &cred);
+     ~LocalClient();
+-
+-private:
+-
+-    struct sockaddr_un sun;
+-
+ };
+ #endif /* !RemoteClient_included */
This page took 0.069721 seconds and 4 git commands to generate.