Changeset 309 for branches/samba-3.3.x/source/smbd
- Timestamp:
- Aug 4, 2009, 8:51:22 AM (16 years ago)
- 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 1215 1215 } 1216 1216 fstrcpy(s->comment, p); 1217 string_truncate(s->comment, MAX_SERVER_STRING_LENGTH); 1217 1218 1218 1219 s->domain[0] = '\0'; -
branches/samba-3.3.x/source/smbd/open.c
r224 r309 318 318 if (!CAN_WRITE(conn)) { 319 319 /* 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)) { 321 321 DEBUG(3,("Permission denied opening %s\n", path)); 322 322 return NT_STATUS_ACCESS_DENIED; … … 326 326 access into the directory. 327 327 */ 328 flags &= ~ O_CREAT;329 local_flags &= ~ O_CREAT;328 flags &= ~(O_CREAT|O_EXCL); 329 local_flags &= ~(O_CREAT|O_EXCL); 330 330 } 331 331 } -
branches/samba-3.3.x/source/smbd/server.c
r274 r309 356 356 unsigned dns_port = 0; 357 357 358 if (!is_daemon) {359 return open_sockets_inetd();360 }361 362 358 #ifdef HAVE_ATEXIT 363 359 { … … 369 365 } 370 366 #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 } 371 378 372 379 /* Stop zombies */ … … 1260 1267 BlockSignals(False, SIGTERM); 1261 1268 1269 /* Ensure we leave no zombies until we 1270 * correctly set up child handling below. */ 1271 CatchChild(); 1272 1262 1273 /* we want total control over the permissions on created files, 1263 1274 so set our umask to 0 */ -
branches/samba-3.3.x/source/smbd/trans2.c
r222 r309 4938 4938 if (setting_write_time) { 4939 4939 /* 4940 * This was a setfileinfo on an open file.4940 * This was a Windows setfileinfo on an open file. 4941 4941 * NT does this a lot. We also need to 4942 4942 * set the time here, as it can be read by … … 6016 6016 bool delete_on_fail = False; 6017 6017 enum perm_type ptype; 6018 files_struct *all_fsps = NULL; 6019 bool modify_mtime = true; 6020 struct file_id id; 6018 6021 6019 6022 if (total_data < 100) { … … 6162 6165 6163 6166 /* 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, 6166 6189 fsp, 6167 6190 fname, 6168 6191 psbuf, 6169 6192 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; 6171 6200 } 6172 6201 … … 6795 6824 } 6796 6825 6797 if (!CAN_WRITE(conn)) {6798 reply_doserror(req, ERRSRV, ERRaccess);6799 return;6800 }6801 6802 6826 if (INFO_LEVEL_IS_UNIX(info_level) && !lp_unix_extensions()) { 6803 6827 reply_nterror(req, NT_STATUS_INVALID_LEVEL); 6804 6828 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 } 6805 6838 } 6806 6839 … … 7109 7142 7110 7143 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 } 7111 7159 7112 7160 status = unix_convert(ctx, conn, directory, False, &directory, NULL, &sbuf);
Note:
See TracChangeset
for help on using the changeset viewer.