Changeset 335 for branches/samba-3.2.x/source/smbd
- Timestamp:
- Sep 24, 2009, 9:15:13 AM (16 years ago)
- Location:
- branches/samba-3.2.x/source/smbd
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/smbd/lanman.c
r136 r335 1218 1218 } 1219 1219 fstrcpy(s->comment, p); 1220 string_truncate(s->comment, MAX_SERVER_STRING_LENGTH); 1220 1221 1221 1222 s->domain[0] = '\0'; -
branches/samba-3.2.x/source/smbd/open.c
r235 r335 251 251 if (!CAN_WRITE(conn)) { 252 252 /* It's a read-only share - fail if we wanted to write. */ 253 if(accmode != O_RDONLY ) {253 if(accmode != O_RDONLY || (flags & O_TRUNC) || (flags & O_APPEND)) { 254 254 DEBUG(3,("Permission denied opening %s\n", path)); 255 255 return NT_STATUS_ACCESS_DENIED; … … 259 259 access into the directory. 260 260 */ 261 flags &= ~ O_CREAT;262 local_flags &= ~ O_CREAT;261 flags &= ~(O_CREAT|O_EXCL); 262 local_flags &= ~(O_CREAT|O_EXCL); 263 263 } 264 264 } -
branches/samba-3.2.x/source/smbd/server.c
r233 r335 349 349 unsigned dns_port = 0; 350 350 351 if (!is_daemon) {352 return open_sockets_inetd();353 }354 355 351 #ifdef HAVE_ATEXIT 356 352 { … … 362 358 } 363 359 #endif 360 361 if (!is_daemon) { 362 /* 363 * Stop zombies the old way. 364 * We aren't forking any new 365 * 'normal' connections when 366 * run from [x]inetd. 367 */ 368 CatchChild(); 369 return open_sockets_inetd(); 370 } 364 371 365 372 /* Stop zombies */ … … 1207 1214 BlockSignals(False, SIGTERM); 1208 1215 1216 /* Ensure we leave no zombies until we 1217 * correctly set up child handling below. */ 1218 CatchChild(); 1219 1209 1220 /* we want total control over the permissions on created files, 1210 1221 so set our umask to 0 */ -
branches/samba-3.2.x/source/smbd/trans2.c
r272 r335 4920 4920 if (setting_write_time) { 4921 4921 /* 4922 * This was a setfileinfo on an open file.4922 * This was a Windows setfileinfo on an open file. 4923 4923 * NT does this a lot. We also need to 4924 4924 * set the time here, as it can be read by … … 5997 5997 bool delete_on_fail = False; 5998 5998 enum perm_type ptype; 5999 files_struct *all_fsps = NULL; 6000 bool modify_mtime = true; 6001 struct file_id id; 5999 6002 6000 6003 if (total_data < 100) { … … 6143 6146 6144 6147 /* Deal with any time changes. */ 6145 6146 return smb_set_file_time(conn, 6148 id = vfs_file_id_from_sbuf(conn, psbuf); 6149 for(all_fsps = file_find_di_first(id); all_fsps; 6150 all_fsps = file_find_di_next(all_fsps)) { 6151 /* 6152 * We're setting the time explicitly for UNIX. 6153 * Cancel any pending changes over all handles. 6154 */ 6155 all_fsps->update_write_time_on_close = false; 6156 TALLOC_FREE(all_fsps->update_write_time_event); 6157 } 6158 6159 /* 6160 * Override the "setting_write_time" 6161 * parameter here as it almost does what 6162 * we need. Just remember if we modified 6163 * mtime and send the notify ourselves. 6164 */ 6165 if (null_timespec(ts[1])) { 6166 modify_mtime = false; 6167 } 6168 6169 status = smb_set_file_time(conn, 6147 6170 fsp, 6148 6171 fname, 6149 6172 psbuf, 6150 6173 ts, 6151 true); 6174 false); 6175 6176 if (modify_mtime) { 6177 notify_fname(conn, NOTIFY_ACTION_MODIFIED, 6178 FILE_NOTIFY_CHANGE_LAST_WRITE, fname); 6179 } 6180 return status; 6152 6181 } 6153 6182 … … 6776 6805 } 6777 6806 6778 if (!CAN_WRITE(conn)) {6779 reply_doserror(req, ERRSRV, ERRaccess);6780 return;6781 }6782 6783 6807 if (INFO_LEVEL_IS_UNIX(info_level) && !lp_unix_extensions()) { 6784 6808 reply_nterror(req, NT_STATUS_INVALID_LEVEL); 6785 6809 return; 6810 } 6811 6812 if (!CAN_WRITE(conn)) { 6813 /* Allow POSIX opens. The open path will deny 6814 * any non-readonly opens. */ 6815 if (info_level != SMB_POSIX_PATH_OPEN) { 6816 reply_doserror(req, ERRSRV, ERRaccess); 6817 return; 6818 } 6786 6819 } 6787 6820 … … 7090 7123 7091 7124 DEBUG(3,("call_trans2mkdir : name = %s\n", directory)); 7125 7126 status = resolve_dfspath(ctx, 7127 conn, 7128 req->flags2 & FLAGS2_DFS_PATHNAMES, 7129 directory, 7130 &directory); 7131 if (!NT_STATUS_IS_OK(status)) { 7132 if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { 7133 reply_botherror(req, 7134 NT_STATUS_PATH_NOT_COVERED, 7135 ERRSRV, ERRbadpath); 7136 } 7137 reply_nterror(req, status); 7138 return; 7139 } 7092 7140 7093 7141 status = unix_convert(ctx, conn, directory, False, &directory, NULL, &sbuf);
Note:
See TracChangeset
for help on using the changeset viewer.