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

« back to all changes in this revision

Viewing changes to source/rpc_server/srv_eventlog_lib.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:
39
39
                tdbfilename));
40
40
 
41
41
        tdb = tdb_open_log( tdbfilename, 0, TDB_DEFAULT, 
42
 
                O_RDWR|O_CREAT|O_TRUNC, 0600 );
 
42
                O_RDWR|O_CREAT|O_TRUNC, 0660 );
43
43
 
44
44
        if ( !tdb ) {
45
45
                DEBUG( 0, ( "Can't open tdb for [%s]\n", tdbfilename ) );
163
163
        if ( mem_ctx == NULL )
164
164
                return False;   /* can't allocate memory indicates bigger problems */
165
165
        /* lock */
166
 
        tdb_lock_bystring( the_tdb, EVT_NEXT_RECORD, 1 );
 
166
        tdb_lock_bystring_with_timeout( the_tdb, EVT_NEXT_RECORD, 1 );
167
167
        /* read */
168
168
        end_record = tdb_fetch_int32( the_tdb, EVT_NEXT_RECORD );
169
169
        start_record = tdb_fetch_int32( the_tdb, EVT_OLDEST_ENTRY );
201
201
 
202
202
                len = tdb_unpack( ret.dptr, ret.dsize, "ddddd", &reclen,
203
203
                                  &tresv1, &trecnum, &timegen, &timewr );
 
204
                if (len == -1) {
 
205
                        DEBUG( 10,("make_way_for_eventlogs: tdb_unpack failed.\n"));
 
206
                        tdb_unlock_bystring( the_tdb, EVT_NEXT_RECORD );
 
207
                        return False;
 
208
                }
 
209
 
204
210
                DEBUG( 8,
205
211
                       ( "read record %d, record size is [%d], total so far [%d]\n",
206
212
                         i, reclen, nbytes ) );
489
495
        /* need to read the record number and insert it into the entry here */
490
496
 
491
497
        /* lock */
492
 
        tdb_lock_bystring( the_tdb, EVT_NEXT_RECORD, 1 );
 
498
        tdb_lock_bystring_with_timeout( the_tdb, EVT_NEXT_RECORD, 1 );
493
499
        /* read */
494
500
        next_record = tdb_fetch_int32( the_tdb, EVT_NEXT_RECORD );
495
501
 
707
713
                memset( temp, 0, sizeof( temp ) );
708
714
                strncpy( temp, stop, temp_len );
709
715
                rpcstr_push( ( void * ) ( entry->data_record.strings +
710
 
                                          entry->data_record.strings_len ),
 
716
                                          ( entry->data_record.strings_len / 2 ) ),
711
717
                             temp,
712
718
                             sizeof( entry->data_record.strings ) -
713
 
                             entry->data_record.strings_len, STR_TERMINATE );
714
 
                entry->data_record.strings_len += temp_len + 1;
 
719
                             ( entry->data_record.strings_len / 2 ), STR_TERMINATE );
 
720
                entry->data_record.strings_len += ( temp_len * 2 ) + 2;
715
721
                entry->record.num_strings++;
716
722
        } else if ( 0 == strncmp( start, "DAT", stop - start ) ) {
717
 
                /* Now that we're done processing the STR data, adjust the length to account for
718
 
                   unicode, then proceed with the DAT data. */
719
 
                entry->data_record.strings_len *= 2;
720
723
                /* skip past initial ":" */
721
724
                stop++;
722
725
                /* now skip any other leading whitespace */