~ubuntu-branches/ubuntu/gutsy/samba/gutsy-updates

« back to all changes in this revision

Viewing changes to source/lib/messages.c

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Mitchell
  • Date: 2006-11-28 20:14:37 UTC
  • mfrom: (0.10.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061128201437-a6x4lzlhempazocp
Tags: 3.0.23d-1ubuntu1
* Merge from debian unstable.
* Drop python2.4-samba, replace with python-samba. Added Conflicts/Replaces
  on python2.4-samba
* Drop track-connection-dos.patch, ubuntu-winbind-panic.patch, 
  ubuntu-fix-ldap.patch, ubuntu-setlocale.patch, ubuntu-setlocale-fixes.patch
* Remaining Ubuntu changes:
  - Revert Debian's installation of mount.cifs and umount.cifs as suid
  - Comment out the default [homes] shares and add more verbose comments to
    explain what they do and how they work (closes: launchpad.net/27608)
  - Add a "valid users = %S" stanza to the commented-out [homes] section, to
    show users how to restrict access to \\server\username to only username.
  - Change the (commented-out) "printer admin" example to use "@lpadmin"
    instead of "@ntadmin", since the lpadmin group is used for spool admin.
  - Alter the panic-action script to encourage users to report their
    bugs in Ubuntu packages to Ubuntu, rather than reporting to Debian.
    Modify text to more closely match the Debian script
  - Munge our init script to deal with the fact that our implementation
    (or lack thereof) of log_daemon_msg and log_progress_msg differs
    from Debian's implementation of the same (Ubuntu #19691)
  - Kept ubuntu-auxsrc.patch: some auxilliary sources (undocumented in 
    previous changelogs)
  - Set default workgroup to MSHOME

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
} *dispatch_fns;
71
71
 
72
72
/****************************************************************************
 
73
 Free global objects.
 
74
****************************************************************************/
 
75
 
 
76
void gfree_messsges(void)
 
77
{
 
78
        struct dispatch_fns *dfn, *next;
 
79
 
 
80
        /* delete the dispatch_fns list */
 
81
        dfn = dispatch_fns;
 
82
        while( dfn ) {
 
83
                next = dfn->next;
 
84
                DLIST_REMOVE(dispatch_fns, dfn);
 
85
                SAFE_FREE(dfn);
 
86
                dfn = next;
 
87
        }
 
88
}
 
89
 
 
90
/****************************************************************************
73
91
 Notifications come in as signals.
74
92
****************************************************************************/
75
93
 
87
105
                         void *buf, size_t len)
88
106
{
89
107
        const char *msg = buf ? buf : "none";
 
108
 
90
109
        DEBUG(1,("INFO: Received PING message from PID %s [%s]\n",
91
110
                 procid_str_static(&src), msg));
92
111
        message_send_pid(src, MSG_PONG, buf, len, True);
180
199
        char *ptr;
181
200
        struct message_rec prec;
182
201
 
 
202
        /* NULL pointer means implicit length zero. */
 
203
        if (!buf) {
 
204
                SMB_ASSERT(len == 0);
 
205
        }
 
206
 
183
207
        /*
184
208
         * Doing kill with a non-positive pid causes messages to be
185
209
         * sent to places we don't want.
191
215
        rec.msg_type = msg_type;
192
216
        rec.dest = pid;
193
217
        rec.src = procid_self();
194
 
        rec.len = len;
 
218
        rec.len = buf ? len : 0;
195
219
 
196
220
        kbuf = message_key_pid(pid);
197
221
 
200
224
                return False;
201
225
 
202
226
        memcpy(dbuf.dptr, &rec, sizeof(rec));
203
 
        if (len > 0)
 
227
        if (len > 0 && buf)
204
228
                memcpy((void *)((char*)dbuf.dptr+sizeof(rec)), buf, len);
205
229
 
206
230
        dbuf.dsize = len + sizeof(rec);
604
628
                *n_sent = msg_all.n_sent;
605
629
        return True;
606
630
}
 
631
 
 
632
/*
 
633
 * Block and unblock receiving of messages. Allows removal of race conditions
 
634
 * when doing a fork and changing message disposition.
 
635
 */
 
636
 
 
637
void message_block(void)
 
638
{
 
639
        BlockSignals(True, SIGUSR1);
 
640
}
 
641
 
 
642
void message_unblock(void)
 
643
{
 
644
        BlockSignals(False, SIGUSR1);
 
645
}
607
646
/** @} **/