Ignore:
Timestamp:
Aug 4, 2009, 8:51:22 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.3 to 3.3.7

Location:
branches/samba-3.3.x/source/smbd
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/smbd/lanman.c

    r206 r309  
    12151215                }
    12161216                fstrcpy(s->comment, p);
     1217                string_truncate(s->comment, MAX_SERVER_STRING_LENGTH);
    12171218
    12181219                s->domain[0] = '\0';
  • branches/samba-3.3.x/source/smbd/open.c

    r224 r309  
    318318        if (!CAN_WRITE(conn)) {
    319319                /* It's a read-only share - fail if we wanted to write. */
    320                 if(accmode != O_RDONLY) {
     320                if(accmode != O_RDONLY || (flags & O_TRUNC) || (flags & O_APPEND)) {
    321321                        DEBUG(3,("Permission denied opening %s\n", path));
    322322                        return NT_STATUS_ACCESS_DENIED;
     
    326326                           access into the directory.
    327327                        */
    328                         flags &= ~O_CREAT;
    329                         local_flags &= ~O_CREAT;
     328                        flags &= ~(O_CREAT|O_EXCL);
     329                        local_flags &= ~(O_CREAT|O_EXCL);
    330330                }
    331331        }
  • branches/samba-3.3.x/source/smbd/server.c

    r274 r309  
    356356        unsigned dns_port = 0;
    357357
    358         if (!is_daemon) {
    359                 return open_sockets_inetd();
    360         }
    361 
    362358#ifdef HAVE_ATEXIT
    363359        {
     
    369365        }
    370366#endif
     367
     368        if (!is_daemon) {
     369                /*
     370                 * Stop zombies the old way.
     371                 * We aren't forking any new
     372                 * 'normal' connections when
     373                 * run from [x]inetd.
     374                 */
     375                CatchChild();
     376                return open_sockets_inetd();
     377        }
    371378
    372379        /* Stop zombies */
     
    12601267        BlockSignals(False, SIGTERM);
    12611268
     1269        /* Ensure we leave no zombies until we
     1270         * correctly set up child handling below. */
     1271        CatchChild();
     1272
    12621273        /* we want total control over the permissions on created files,
    12631274           so set our umask to 0 */
  • branches/samba-3.3.x/source/smbd/trans2.c

    r222 r309  
    49384938        if (setting_write_time) {
    49394939                /*
    4940                  * This was a setfileinfo on an open file.
     4940                 * This was a Windows setfileinfo on an open file.
    49414941                 * NT does this a lot. We also need to
    49424942                 * set the time here, as it can be read by
     
    60166016        bool delete_on_fail = False;
    60176017        enum perm_type ptype;
     6018        files_struct *all_fsps = NULL;
     6019        bool modify_mtime = true;
     6020        struct file_id id;
    60186021
    60196022        if (total_data < 100) {
     
    61626165
    61636166        /* Deal with any time changes. */
    6164 
    6165         return smb_set_file_time(conn,
     6167        id = vfs_file_id_from_sbuf(conn, psbuf);
     6168        for(all_fsps = file_find_di_first(id); all_fsps;
     6169                        all_fsps = file_find_di_next(all_fsps)) {
     6170                /*
     6171                 * We're setting the time explicitly for UNIX.
     6172                 * Cancel any pending changes over all handles.
     6173                 */
     6174                all_fsps->update_write_time_on_close = false;
     6175                TALLOC_FREE(all_fsps->update_write_time_event);
     6176        }
     6177
     6178        /*
     6179         * Override the "setting_write_time"
     6180         * parameter here as it almost does what
     6181         * we need. Just remember if we modified
     6182         * mtime and send the notify ourselves.
     6183         */
     6184        if (null_timespec(ts[1])) {
     6185                modify_mtime = false;
     6186        }
     6187
     6188        status = smb_set_file_time(conn,
    61666189                                fsp,
    61676190                                fname,
    61686191                                psbuf,
    61696192                                ts,
    6170                                 true);
     6193                                false);
     6194
     6195        if (modify_mtime) {
     6196                notify_fname(conn, NOTIFY_ACTION_MODIFIED,
     6197                        FILE_NOTIFY_CHANGE_LAST_WRITE, fname);
     6198        }
     6199        return status;
    61716200}
    61726201
     
    67956824        }
    67966825
    6797         if (!CAN_WRITE(conn)) {
    6798                 reply_doserror(req, ERRSRV, ERRaccess);
    6799                 return;
    6800         }
    6801 
    68026826        if (INFO_LEVEL_IS_UNIX(info_level) && !lp_unix_extensions()) {
    68036827                reply_nterror(req, NT_STATUS_INVALID_LEVEL);
    68046828                return;
     6829        }
     6830
     6831        if (!CAN_WRITE(conn)) {
     6832                /* Allow POSIX opens. The open path will deny
     6833                 * any non-readonly opens. */
     6834                if (info_level != SMB_POSIX_PATH_OPEN) {
     6835                        reply_doserror(req, ERRSRV, ERRaccess);
     6836                        return;
     6837                }
    68056838        }
    68066839
     
    71097142
    71107143        DEBUG(3,("call_trans2mkdir : name = %s\n", directory));
     7144
     7145        status = resolve_dfspath(ctx,
     7146                                conn,
     7147                                req->flags2 & FLAGS2_DFS_PATHNAMES,
     7148                                directory,
     7149                                &directory);
     7150        if (!NT_STATUS_IS_OK(status)) {
     7151                if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
     7152                        reply_botherror(req,
     7153                                        NT_STATUS_PATH_NOT_COVERED,
     7154                                        ERRSRV, ERRbadpath);
     7155                }
     7156                reply_nterror(req, status);
     7157                return;
     7158        }
    71117159
    71127160        status = unix_convert(ctx, conn, directory, False, &directory, NULL, &sbuf);
Note: See TracChangeset for help on using the changeset viewer.