2025-01-24 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in the WebGet service that caused uploads to fail when
	using an Apache package with 'PrivateTmp=true' set in it's Systemd
	service definition.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2025-01-24 18:13:53 -05:00
parent 8f1b9d6d78
commit 1fc728df3f
3 changed files with 12 additions and 2 deletions

View File

@@ -96,6 +96,10 @@ RDFormPost::RDFormPost(RDFormPost::Encoding encoding,bool auto_delete)
post_error=RDFormPost::ErrorNoTempDir;
return;
}
if(chmod(post_tempdir->path().toUtf8(),0755)!=0) {
post_error=RDFormPost::ErrorNoTempDir;
return;
}
//
// (Perhaps) autodetect the encoding type
@@ -746,7 +750,8 @@ bool RDFormPost::GetMimePart(QString *name,QString *value,bool *is_file,
}
if(f2[0]=="filename") {
*value=post_tempdir->path()+"/"+f2[1].replace("\"","");
fd=open(value->toUtf8(),O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR);
fd=open(value->toUtf8(),O_WRONLY|O_CREAT,
S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
*is_file=true;
}
}