- /* Ensure the data_len is correct for the sd and ea values given. */
- if ((ea_len + sd_len > data_count) ||
- (ea_len > data_count) || (sd_len > data_count) ||
- (ea_len + sd_len < ea_len) || (ea_len + sd_len < sd_len)) {
- DEBUG(10,("call_nt_transact_create - ea_len = %u, sd_len = %u, data_count = %u\n",
- (unsigned int)ea_len, (unsigned int)sd_len, (unsigned int)data_count ));
- return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
- }
-
- if (ea_len) {
- if (!lp_ea_support(SNUM(conn))) {
- DEBUG(10,("call_nt_transact_create - ea_len = %u but EA's not supported.\n",
- (unsigned int)ea_len ));
- return ERROR_NT(NT_STATUS_EAS_NOT_SUPPORTED);
- }
-
- if (ea_len < 10) {
- DEBUG(10,("call_nt_transact_create - ea_len = %u - too small (should be more than 10)\n",
- (unsigned int)ea_len ));
- return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
- }
- }
-
- if (create_options & FILE_OPEN_BY_FILE_ID) {
- return ERROR_NT(NT_STATUS_NOT_SUPPORTED);
- }
-
- /*
- * Get the file name.
- */
-
- if(root_dir_fid != 0) {
- /*
- * This filename is relative to a directory fid.
- */
- files_struct *dir_fsp = file_fsp(params,4);
- size_t dir_name_len;
-
- if(!dir_fsp) {
- return ERROR_DOS(ERRDOS,ERRbadfid);
- }
-
- if(!dir_fsp->is_directory) {
- srvstr_get_path(inbuf, fname, params+53, sizeof(fname), parameter_count-53, STR_TERMINATE, &status);
- if (!NT_STATUS_IS_OK(status)) {
- return ERROR_NT(status);
- }
-
- /*
- * Check to see if this is a mac fork of some kind.
- */
-
- if( is_ntfs_stream_name(fname)) {
- return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND);
- }
-
- return ERROR_DOS(ERRDOS,ERRbadfid);
- }
-
- /*
- * Copy in the base directory name.
- */
-
- pstrcpy( fname, dir_fsp->fsp_name );
- dir_name_len = strlen(fname);
-
- /*
- * Ensure it ends in a '\'.
- */
-
- if((fname[dir_name_len-1] != '\\') && (fname[dir_name_len-1] != '/')) {
- pstrcat(fname, "/");
- dir_name_len++;
- }
-
- {
- pstring tmpname;
- srvstr_get_path(inbuf, tmpname, params+53, sizeof(tmpname), parameter_count-53, STR_TERMINATE, &status);
- if (!NT_STATUS_IS_OK(status)) {
- return ERROR_NT(status);
- }
- pstrcat(fname, tmpname);
- }
- } else {
- srvstr_get_path(inbuf, fname, params+53, sizeof(fname), parameter_count-53, STR_TERMINATE, &status);
- if (!NT_STATUS_IS_OK(status)) {
- return ERROR_NT(status);
- }
-
- /*
- * Check to see if this is a mac fork of some kind.
- */
-
- if( is_ntfs_stream_name(fname)) {
- return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND);
- }
+ /* Ensure the data_len is correct for the sd and ea values given. */
+ if ((ea_len + sd_len > data_count)
+ || (ea_len > data_count) || (sd_len > data_count)
+ || (ea_len + sd_len < ea_len) || (ea_len + sd_len < sd_len)) {
+ DEBUG(10, ("call_nt_transact_create - ea_len = %u, sd_len = "
+ "%u, data_count = %u\n", (unsigned int)ea_len,
+ (unsigned int)sd_len, (unsigned int)data_count));
+ reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+ return;