]> arthur.barton.de Git - netatalk.git/commitdiff
Merge master
authorFrank Lahm <franklahm@googlemail.com>
Wed, 2 Mar 2011 09:32:07 +0000 (10:32 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Wed, 2 Mar 2011 09:32:07 +0000 (10:32 +0100)
14 files changed:
config/Makefile.am
etc/afpd/afp_dsi.c
etc/afpd/afp_options.c
etc/afpd/auth.c
etc/afpd/globals.h
etc/afpd/status.c
include/atalk/adouble.h
include/atalk/afp.h
include/atalk/dsi.h
libatalk/dsi/dsi_getsess.c
libatalk/dsi/dsi_stream.c
libatalk/util/server_child.c
libatalk/util/server_ipc.c
libatalk/util/socket.c

index c1d96de7384f0bbf3f920e0e10a93edc0c92d97b..1131fe6c8bc0c82faaaaecc45627ad2e5eb7526c 100644 (file)
@@ -54,9 +54,8 @@ uninstall-local:
                echo rm -f $(DESTDIR)$(pkgconfdir)/$$f; \
                rm -f $(DESTDIR)$(pkgconfdir)/$$f; \
        done
-
 if USE_DEBIAN
-       rm -f $(DESTDIR)/etc/default/netatalk;
+       rm -f $(DESTDIR)/etc/default/netatalk
 endif
 
 install-config-files: $(CONFFILES) $(GENFILES)
@@ -72,21 +71,11 @@ install-config-files: $(CONFFILES) $(GENFILES)
 if USE_DEBIAN
        $(mkinstalldirs) $(DESTDIR)/default
        if test "x$(OVERWRITE_CONFIG)" = "xyes" -o ! -f /etc/default/netatalk; then \
-               echo "$(INSTALL_DATA) netatalk.conf $(DESTDIR)/etc/default/netatalk"; \
-               $(INSTALL_DATA) netatalk.conf $(DESTDIR)/etc/default/netatalk; \
+               echo "$(INSTALL_DATA) $(srcdir)/netatalk.conf $(DESTDIR)/etc/default/netatalk"; \
+               $(INSTALL_DATA) $(srcdir)/netatalk.conf $(DESTDIR)/etc/default/netatalk; \
        else \
                echo "not overwriting /etc/default/netatalk"; \
-       fi;
-endif
-
-if USE_DEBIAN
-       $(mkinstalldirs) $(DESTDIR)/default
-       if test "x$(OVERWRITE_CONFIG)" = "xyes" -o ! -f /etc/default/netatalk; then \
-               echo "$(INSTALL_DATA) netatalk.conf $(DESTDIR)/etc/default/netatalk"; \
-               $(INSTALL_DATA) netatalk.conf $(DESTDIR)/etc/default/netatalk; \
-       else \
-               echo "not overwriting /etc/default/netatalk"; \
-       fi;
+       fi
 endif
 
 install-webmin:
index 7382bbb47d7b1c6958a615d84d302f3bbf583dfc..2766514b96933941820c6836a6ed906dfcd9233e 100644 (file)
@@ -101,16 +101,6 @@ static void afp_dsi_close(AFPObj *obj)
 static void afp_dsi_die(int sig)
 {
     DSI *dsi = (DSI *)AFPobj->handle;
-    static volatile int in_handler;
-    
-    if (in_handler) {
-       return;
-    }
-    /* it's not atomic but we don't care because it's an exit function
-     * ie if a signal is received here, between the test and the affectation,
-     * it will not return.
-    */
-    in_handler = 1;
 
     if (dsi->flags & DSI_RECONINPROG) {
         /* Primary reconnect succeeded, got SIGTERM from afpd parent */
@@ -118,6 +108,11 @@ static void afp_dsi_die(int sig)
         return; /* this returns to afp_disconnect */
     }
 
+    if (dsi->flags & DSI_DISCONNECTED) {
+        LOG(log_note, logtype_afpd, "Disconnected session terminating");
+        exit(0);
+    }
+
     dsi_attention(AFPobj->handle, AFPATTN_SHUTDOWN);
     afp_dsi_close(AFPobj);
     if (sig) /* if no signal, assume dieing because logins are disabled &
@@ -131,6 +126,7 @@ static void afp_dsi_die(int sig)
     }
 }
 
+/* SIGURG handler (primary reconnect) */
 static void afp_dsi_transfer_session(int sig _U_)
 {
     uint16_t dsiID;
@@ -154,9 +150,10 @@ static void afp_dsi_transfer_session(int sig _U_)
     LOG(log_note, logtype_afpd, "afp_dsi_transfer_session: received socket fd: %i", socket);
 
     dsi->socket = socket;
-    dsi->flags |= DSI_RECONSOCKET;
-    dsi->flags &= ~DSI_DISCONNECTED;
+    dsi->flags = DSI_RECONSOCKET;
     dsi->datalen = 0;
+    dsi->eof = dsi->start = dsi->buffer;
+    dsi->in_write = 0;
     dsi->header.dsi_requestID = dsiID;
     dsi->header.dsi_command = DSIFUNC_CMD;
 
@@ -179,12 +176,6 @@ static void afp_dsi_transfer_session(int sig _U_)
     siglongjmp(recon_jmp, 1);
 }
 
-/* */
-static void afp_dsi_sleep(void)
-{
-    dsi_sleep(AFPobj->handle, 1);
-}
-
 /* ------------------- */
 static void afp_dsi_timedown(int sig _U_)
 {
@@ -271,14 +262,24 @@ static void alarm_handler(int sig _U_)
     /* we got some traffic from the client since the previous timer tick. */
     if ((dsi->flags & DSI_DATA)) {
         dsi->flags &= ~DSI_DATA;
-        dsi->flags &= ~DSI_DISCONNECTED;
-       return;
+        return;
     }
 
     dsi->tickle++;
+    LOG(log_maxdebug, logtype_afpd, "alarm: tickles: %u, flags: %s|%s|%s|%s|%s|%s|%s|%s|%s",
+        dsi->tickle,
+        (dsi->flags & DSI_DATA) ?         "DSI_DATA" : "-",
+        (dsi->flags & DSI_RUNNING) ?      "DSI_RUNNING" : "-",
+        (dsi->flags & DSI_SLEEPING) ?     "DSI_SLEEPING" : "-",
+        (dsi->flags & DSI_EXTSLEEP) ?     "DSI_EXTSLEEP" : "-",
+        (dsi->flags & DSI_DISCONNECTED) ? "DSI_DISCONNECTED" : "-",
+        (dsi->flags & DSI_DIE) ?          "DSI_DIE" : "-",
+        (dsi->flags & DSI_NOREPLY) ?      "DSI_NOREPLY" : "-",
+        (dsi->flags & DSI_RECONSOCKET) ?  "DSI_RECONSOCKET" : "-",
+        (dsi->flags & DSI_RECONINPROG) ?  "DSI_RECONINPROG" : "-");
 
     if (dsi->flags & DSI_SLEEPING) {
-        if (dsi->tickle < AFPobj->options.sleep) {
+        if (dsi->tickle > AFPobj->options.sleep) {
             LOG(log_error, logtype_afpd, "afp_alarm: sleep time ended");
             afp_dsi_die(EXITERR_CLNT);
         }
@@ -294,8 +295,9 @@ static void alarm_handler(int sig _U_)
     }
 
     /* if we're in the midst of processing something, don't die. */        
-    if ( !(dsi->flags & DSI_RUNNING) && (dsi->tickle > AFPobj->options.timeout)) {
+    if ( !(dsi->flags & DSI_RUNNING) && (dsi->tickle >= AFPobj->options.timeout)) {
         LOG(log_error, logtype_afpd, "afp_alarm: child timed out, entering disconnected state");
+        dsi->proto_close(dsi);
         dsi->flags |= DSI_DISCONNECTED;
         return;
     }
@@ -347,7 +349,6 @@ void afp_over_dsi(AFPObj *obj)
     obj->exit = afp_dsi_die;
     obj->reply = (int (*)()) dsi_cmdreply;
     obj->attention = (int (*)(void *, AFPUserBytes)) dsi_attention;
-    obj->sleep = afp_dsi_sleep;
     dsi->tickle = 0;
 
     memset(&action, 0, sizeof(action));
@@ -452,15 +453,15 @@ void afp_over_dsi(AFPObj *obj)
 
     /* get stuck here until the end */
     while (1) {
-        if (sigsetjmp(recon_jmp, 1) != 0) {
-            LOG(log_note, logtype_afpd, "Resuming operation after succesfull primary reconnect");
-            dsi->flags &= ~(DSI_RUNNING | DSI_DATA);
-            dsi->eof = dsi->start = dsi->buffer;
-            dsi->in_write = 0;
+        if (sigsetjmp(recon_jmp, 1) != 0)
+            /* returning from SIGALARM handler for a primary reconnect */
             continue;
-        }
+
+        /* Blocking read on the network socket */
         cmd = dsi_receive(dsi);
+
         if (cmd == 0) {
+            /* cmd == 0 is the error condition */
             if (dsi->flags & DSI_RECONSOCKET) {
                 /* we just got a reconnect so we immediately try again to receive on the new fd */
                 dsi->flags &= ~DSI_RECONSOCKET;
@@ -480,8 +481,11 @@ void afp_over_dsi(AFPObj *obj)
             }
         }
 
-        dsi->tickle = 0;
-        dsi_sleep(dsi, 0); /* wake up */
+        if (!(dsi->flags & DSI_EXTSLEEP) && (dsi->flags & DSI_SLEEPING)) {
+            LOG(log_debug, logtype_afpd, "afp_over_dsi: got data, ending normal sleep");
+            dsi->flags &= ~DSI_SLEEPING;
+            dsi->tickle = 0;
+        }
 
         if (reload_request) {
             reload_request = 0;
index 0e44ef009a6dc667745bf5f6f27c5aeab5eeb73b..fac01fdef357c906408c1858012c0e7905a903f9 100644 (file)
@@ -160,8 +160,8 @@ void afp_options_init(struct afp_options *options)
     options->passwdfile = _PATH_AFPDPWFILE;
     options->tickleval = 30;
     options->timeout = 4;       /* 4 tickles = 2 minutes */
-    options->sleep = 10* 120; /* 10 h in 30 seconds tick */
-    options->disconnected = 20; /* 20 * 30 s (default tickleval) = 10 minutes */
+    options->sleep = 10 * 60 * 2; /* 10 h in 30 seconds tick */
+    options->disconnected = 10 * 60 * 2; /* 10 h in 30 seconds tick */
     options->server_notif = 1;
     options->authprintdir = NULL;
     options->signatureopt = "auto";
index 6ff0988459dccd48763ebac847da2fc5a71a2cdf..9245293c80af9a1841a7556cb0026143d341dafb 100644 (file)
@@ -380,25 +380,54 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void), int expi
 }
 
 /* ---------------------- */
-int afp_zzz ( /* Function 122 */
-    AFPObj       *obj,
-    char         *ibuf _U_, size_t ibuflen _U_, 
-    char *rbuf, size_t *rbuflen)
+int afp_zzz(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen)
 {
-    u_int32_t   retdata;
+    uint32_t data;
+    DSI *dsi = (DSI *)AFPobj->handle;
 
     *rbuflen = 0;
 
-    retdata = obj->options.sleep /120;
-    if (!retdata) {
-        retdata = 1;
+    if (ibuflen < 4)
+        return AFPERR_MISC;
+    memcpy(&data, ibuf, 4); /* flag */
+    data = ntohl(data);
+
+    /*
+     * Possible sleeping states:
+     * 1) normal sleep: DSI_SLEEPING (up to 10.3)
+     * 2) extended sleep: DSI_SLEEPING | DSI_EXTSLEEP (starting with 10.4)
+     */
+
+    if (data & AFPZZZ_EXT_WAKEUP) {
+        /* wakeup request from exetended sleep */
+        if (dsi->flags & DSI_EXTSLEEP) {
+            LOG(log_debug, logtype_afpd, "afp_zzz: waking up from extended sleep");
+            dsi->flags &= ~(DSI_SLEEPING | DSI_EXTSLEEP);
+        }
+    } else {
+        /* sleep request */
+        dsi->flags |= DSI_SLEEPING;
+        if (data & AFPZZZ_EXT_SLEEP) {
+            LOG(log_debug, logtype_afpd, "afp_zzz: entering extended sleep");
+            dsi->flags |= DSI_EXTSLEEP;
+        } else {
+            LOG(log_debug, logtype_afpd, "afp_zzz: entering normal sleep");
+        }
+    }
+    /*
+     * According to AFP 3.3 spec we should not return anything,
+     * but eg 10.5.8 server still returns the numbers of hours
+     * the server is keeping the sessino (ie max sleeptime).
+     */
+    data = obj->options.sleep / 120; /* hours */
+    if (!data) {
+        data = 1;
     }
-    *rbuflen = sizeof(retdata);
-    retdata = htonl(retdata);
-    memcpy(rbuf, &retdata, sizeof(retdata));
-    if (obj->sleep)
-        obj->sleep();
-    rbuf += sizeof(retdata);
+    *rbuflen = sizeof(data);
+    data = htonl(data);
+    memcpy(rbuf, &data, sizeof(data));
+    rbuf += sizeof(data);
+
     return AFP_OK;
 }
 
index dc64fb15d40775b4657f5c5f3d55ea94d908b345..3a9c229c4ad077e7d1ee82cce6b8feffed294f99 100644 (file)
@@ -92,7 +92,6 @@ typedef struct _AFPObj {
     void (*logout)(void), (*exit)(int);
     int (*reply)(void *, int);
     int (*attention)(void *, AFPUserBytes);
-    void (*sleep)(void);
     /* to prevent confusion, only use these in afp_* calls */
     char oldtmp[AFPOBJ_TMPSIZ + 1], newtmp[AFPOBJ_TMPSIZ + 1];
     void *uam_cookie; /* cookie for uams */
index d6d3dfd9cda014e90277db822166623c0fc93e66..1037f15a0c591c1d09d33ae062278f46eac58e65 100644 (file)
@@ -44,32 +44,26 @@ static   size_t maxstatuslen = 0;
 static void status_flags(char *data, const int notif, const int ipok,
                          const unsigned char passwdbits, const int dirsrvcs _U_, int flags)
 {
-    u_int16_t           status;
+    uint16_t           status;
+
+    status = AFPSRVRINFO_COPY
+           | AFPSRVRINFO_SRVSIGNATURE
+           | AFPSRVRINFO_SRVMSGS
+           | AFPSRVRINFO_FASTBOZO
+           | AFPSRVRINFO_SRVRDIR
+           | AFPSRVRINFO_SRVUTF8
+           | AFPSRVRINFO_EXTSLEEP;
 
-    status = AFPSRVRINFO_COPY;
     if (passwdbits & PASSWD_SET) /* some uams may not allow this. */
         status |= AFPSRVRINFO_PASSWD;
     if (passwdbits & PASSWD_NOSAVE)
         status |= AFPSRVRINFO_NOSAVEPASSWD;
-    status |= AFPSRVRINFO_SRVSIGNATURE;
-    /* only advertise tcp/ip if we have a valid address */
-    if (ipok)
+    if (ipok) /* only advertise tcp/ip if we have a valid address */        
         status |= AFPSRVRINFO_TCPIP;
-    status |= AFPSRVRINFO_SRVMSGS;
-    /* Allow the user to decide if we should support server notifications.
-     * With this turned off, the clients will poll for directory changes every
-     * 10 seconds.  This might be too costly to network resources, so make
-     * this an optional thing.  Default will be to _not_ support server
-     * notifications. */
-    if (notif) {
+    if (notif) /* Default is yes */        
         status |= AFPSRVRINFO_SRVNOTIFY;
-    }
-    status |= AFPSRVRINFO_FASTBOZO;
-    status |= AFPSRVRINFO_SRVRDIR; /* AFP 3.1 specs says we need to specify this, but may set the count to 0 */
-    /* We don't set the UTF8 name flag here, we don't know whether we have enough space ... */
-
-    if (flags & OPTION_UUID)   /* 05122008 FIXME: can we set AFPSRVRINFO_UUID here ? see AFPSRVRINFO_SRVRDIR*/
-       status |= AFPSRVRINFO_UUID;
+    if (flags & OPTION_UUID)
+        status |= AFPSRVRINFO_UUID;
 
     status = htons(status);
     memcpy(data + AFPSTATUS_FLAGOFF, &status, sizeof(status));
@@ -374,13 +368,6 @@ static size_t status_utf8servername(char *data, int *nameoffset,
        data += len;
        offset = htons(offset);
        memcpy(begin + *nameoffset, &offset, sizeof(u_int16_t));
-        
-        /* Now set the flag ... */
-        memcpy(&status, begin + AFPSTATUS_FLAGOFF, sizeof(status));
-        status = ntohs(status);
-        status |= AFPSRVRINFO_SRVUTF8;
-        status = htons(status);
-        memcpy(begin + AFPSTATUS_FLAGOFF, &status, sizeof(status));
     }
 
     /* return length of buffer */
index 8641aae75135cbc0caa5e5d6086bcde40cc13490..daa0b0ca94febafa2e5212cb5f7cc1efe7aa455b 100644 (file)
 #include <sys/stat.h>
 #include <unistd.h>
 #include <fcntl.h>
+
+#ifdef USE_MMAPPED_HEADERS
 #include <sys/mman.h>
+#endif
+
 #include <sys/time.h>
 
 #include <atalk/bstrlib.h>
index 11a4029dea13da3a780f4e76704fdc866f36977b..ec9238166933325d7bf3a11b0858daf930bcbabf 100644 (file)
@@ -42,20 +42,19 @@ typedef u_int16_t AFPUserBytes;
 #define AFPTRANS_ALL          (AFPTRANS_DDP | AFPTRANS_TCP)
 
 /* server flags */
-#define AFPSRVRINFO_COPY        (1<<0)  /* supports copyfile */
-#define AFPSRVRINFO_PASSWD      (1<<1)  /* supports change password */
+#define AFPSRVRINFO_COPY         (1<<0)  /* supports copyfile */
+#define AFPSRVRINFO_PASSWD       (1<<1)  /* supports change password */
 #define AFPSRVRINFO_NOSAVEPASSWD (1<<2)  /* don't allow save password */
 #define AFPSRVRINFO_SRVMSGS      (1<<3)  /* supports server messages */
 #define AFPSRVRINFO_SRVSIGNATURE (1<<4)  /* supports server signature */
 #define AFPSRVRINFO_TCPIP        (1<<5)  /* supports tcpip */
 #define AFPSRVRINFO_SRVNOTIFY    (1<<6)  /* supports server notifications */ 
-
 #define AFPSRVRINFO_SRVRECONNECT (1<<7)  /* supports server reconnect */ 
 #define AFPSRVRINFO_SRVRDIR      (1<<8)  /* supports directories service */ 
-
 #define AFPSRVRINFO_SRVUTF8      (1<<9)  /* supports UTF8 names AFP 3.1 */ 
 #define AFPSRVRINFO_UUID         (1<<10) /* supports UUIDs */
-#define AFPSRVRINFO_FASTBOZO    (1<<15) /* fast copying */
+#define AFPSRVRINFO_EXTSLEEP     (1<<11) /* supports extended sleep */
+#define AFPSRVRINFO_FASTBOZO     (1<<15) /* fast copying */
 
 #define AFP_OK         0
 #define AFPERR_DID1     -4000   /* not an afp error DID is 1*/
@@ -128,6 +127,11 @@ typedef enum {
   AFPMESG_SERVER = 1
 } afpmessage_t;
 
+/* extended sleep flag */
+#define AFPZZZ_EXT_SLEEP  1
+#define AFPZZZ_EXT_WAKEUP 2
+
+
 /* AFP functions */
 #define AFP_BYTELOCK        1
 #define AFP_CLOSEVOL            2
index 904bbc1250212cda9f8b3a9d2c0bc843f45cfc03..e16681a4eee95bbafc3d376065c2264dac631345 100644 (file)
@@ -145,11 +145,12 @@ typedef struct DSI {
 #define DSI_DATA             (1 << 0) /* we have received a DSI command */
 #define DSI_RUNNING          (1 << 1) /* we have received a AFP command */
 #define DSI_SLEEPING         (1 << 2) /* we're sleeping after FPZzz */
-#define DSI_DISCONNECTED     (1 << 3) /* we're in diconnected state after a socket error */
-#define DSI_DIE              (1 << 4) /* SIGUSR1, going down in 5 minutes */
-#define DSI_NOREPLY          (1 << 5) /* in dsi_write we generate our own replies */
-#define DSI_RECONSOCKET      (1 << 6) /* we have a new socket from primary reconnect */
-#define DSI_RECONINPROG      (1 << 7) /* used in the new session in reconnect */
+#define DSI_EXTSLEEP         (1 << 3) /* we're sleeping after FPZzz */
+#define DSI_DISCONNECTED     (1 << 4) /* we're in diconnected state after a socket error */
+#define DSI_DIE              (1 << 5) /* SIGUSR1, going down in 5 minutes */
+#define DSI_NOREPLY          (1 << 6) /* in dsi_write we generate our own replies */
+#define DSI_RECONSOCKET      (1 << 7) /* we have a new socket from primary reconnect */
+#define DSI_RECONINPROG      (1 << 8) /* used in the new session in reconnect */
 
 /* basic initialization: dsi_init.c */
 extern DSI *dsi_init (const dsi_proto /*protocol*/,
@@ -171,7 +172,6 @@ extern int  dsi_cmdreply (DSI *, const int);
 extern int dsi_tickle (DSI *);
 extern void dsi_getstatus (DSI *);
 extern void dsi_close (DSI *);
-extern void dsi_sleep (DSI *, const int );
 
 #define DSI_NOWAIT 1
 /* low-level stream commands -- in dsi_stream.c */
index b8ff4944467becec4eeb035223024cf92cc71fe4..180049f23fbf07c6fa980bef24e8afa9831e9d61 100644 (file)
@@ -15,6 +15,8 @@
 #include <errno.h>
 #include <unistd.h>
 #include <signal.h>
+#include <sys/types.h>
+#include <sys/socket.h>
 
 #include <sys/types.h>
 #include <sys/wait.h>
index bb1bb1365f903f9635a10d4ab5a9234f32588b11..149bc208edbc40338a85d18cd7c180451741ddd7 100644 (file)
@@ -354,16 +354,6 @@ static size_t dsi_buffered_stream_read(DSI *dsi, u_int8_t *data, const size_t le
   return len;
 }
 
-/* ---------------------------------------
-*/
-void dsi_sleep(DSI *dsi, const int state)
-{
-    if (state)
-        dsi->flags |= DSI_SLEEPING;
-    else
-        dsi->flags &= ~DSI_SLEEPING;
-}
-
 /* ---------------------------------------
 */
 static void block_sig(DSI *dsi)
index 1375a63978f945433d906eeea9abec98e5fee699..e8ed4d4d956382d06330ff02767f0efbf2afe18e 100644 (file)
@@ -320,16 +320,21 @@ void server_child_kill_one_by_id(server_child *children, int forkid, pid_t pid,
             if ( child->pid != pid) {
                 if (child->idlen == idlen && memcmp(child->clientid, id, idlen) == 0) {
                     if ( child->time != boottime ) {
+                        /* Client rebooted */
                         if (uid == child->uid) {
                             kill_child(child);
-                            LOG(log_note, logtype_default, "Disconnected child[%u], client rebooted.", child->pid);
+                            LOG(log_warning, logtype_default,
+                                "Terminated disconnected child[%u], client rebooted.",
+                                child->pid);
                         } else {
-                            LOG(log_note, logtype_default, "Session with different pid[%u]", child->pid);
+                            LOG(log_warning, logtype_default,
+                                "Session with different pid[%u]", child->pid);
                         }
+                    } else {
+                        kill_child(child);
+                        LOG(log_note, logtype_default,
+                            "Terminated disconnected session[%u]", child->pid);
                     }
-                    if (child->killed)
-                        kill_child(child); /* this will send SIGKILL */
-                    LOG(log_note, logtype_default, "", child->pid, pid);
                 }
             } else {
                 /* update childs own slot */
index 60e3c4f322e60a0e16598a6ad06b6aa936b4b8c6..f00f83b39494d9d2be6e67414ba1c69c9feefca4 100644 (file)
@@ -83,8 +83,8 @@ static int ipc_get_session(struct ipc_header *ipc, server_child *children)
         return -1;
     memcpy (clientid, p, idlen);
   
-    LOG (log_debug, logtype_afpd, "ipc_get_session(pid: %u, uid: %u, time %x)",
-         ipc->child_pid, ipc->uid, boottime); 
+    LOG(log_debug, logtype_afpd, "ipc_get_session(pid: %u, uid: %u, time: 0x%08x)",
+        ipc->child_pid, ipc->uid, boottime); 
 
     server_child_kill_one_by_id(children,
                                 CHILD_DSIFORK,
index 0dfe1044249a2b21b07823d37c5d2b5e5ab54938..9edeb6c55c0cf34f380c121b77826a43d7c71972 100644 (file)
 #include "config.h"
 #endif /* HAVE_CONFIG_H */
 
+#ifndef _XOPEN_SOURCE
+# define _XOPEN_SOURCE 600
+#endif
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__
+#endif
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/types.h>
@@ -509,6 +518,11 @@ void fdset_del_fd(struct pollfd **fdsetp,
     }
 }
 
+/* Length of the space taken up by a padded control message of length len */
+#ifndef CMSG_SPACE
+#define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len))
+#endif
+
 /*
  * Receive a fd on a suitable socket
  * @args fd          (r) PF_UNIX socket to receive on