2021-06-01 Fred Gleason <fredg@paravelsystems.com>

* Cleaned up compile warnings in 'lib/rdupload.cpp'.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2021-06-01 13:00:40 -04:00
parent 1c8cc2e1d1
commit a1388ed735
2 changed files with 9 additions and 6 deletions

View File

@ -21790,3 +21790,5 @@
* Cleaned up compile warnings in 'lib/rdtextfile.cpp'. * Cleaned up compile warnings in 'lib/rdtextfile.cpp'.
2021-06-01 Fred Gleason <fredg@paravelsystems.com> 2021-06-01 Fred Gleason <fredg@paravelsystems.com>
* Cleaned up compile warnings in 'lib/rdttydevice.cpp'. * Cleaned up compile warnings in 'lib/rdttydevice.cpp'.
2021-06-01 Fred Gleason <fredg@paravelsystems.com>
* Cleaned up compile warnings in 'lib/rdupload.cpp'.

View File

@ -2,7 +2,7 @@
// //
// Upload a File // Upload a File
// //
// (C) Copyright 2010-2020 Fred Gleason <fredg@paravelsystems.com> // (C) Copyright 2010-2021 Fred Gleason <fredg@paravelsystems.com>
// //
// This program is free software; you can redistribute it and/or modify // This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as // it under the terms of the GNU General Public License version 2 as
@ -34,6 +34,7 @@
#include "rd.h" #include "rd.h"
#include "rdapplication.h" #include "rdapplication.h"
#include "rdconf.h"
#include "rdsystemuser.h" #include "rdsystemuser.h"
#include "rdupload.h" #include "rdupload.h"
@ -169,7 +170,7 @@ RDUpload::ErrorCode RDUpload::runUpload(const QString &username,
curl_easy_setopt(curl,CURLOPT_KEYPASSWD,password.toUtf8().constData()); curl_easy_setopt(curl,CURLOPT_KEYPASSWD,password.toUtf8().constData());
} }
else { else {
strncpy(userpwd,(username+":"+password).toUtf8(),256); strncpy(userpwd,(username+":"+password).toUtf8(),255);
curl_easy_setopt(curl,CURLOPT_USERPWD,userpwd); curl_easy_setopt(curl,CURLOPT_USERPWD,userpwd);
} }
@ -188,8 +189,8 @@ RDUpload::ErrorCode RDUpload::runUpload(const QString &username,
curl_easy_setopt(curl,CURLOPT_DEBUGFUNCTION,UploadErrorCallback); curl_easy_setopt(curl,CURLOPT_DEBUGFUNCTION,UploadErrorCallback);
} }
if(user!=NULL) { if(user!=NULL) {
setegid(user->gid()); RDCheckExitCode("RDUpload::runUpload setegid",setegid(user->gid()));
seteuid(user->uid()); RDCheckExitCode("RDUpload::runUpload seteuid",seteuid(user->uid()));
} }
switch((curl_err=curl_easy_perform(curl))) { switch((curl_err=curl_easy_perform(curl))) {
case CURLE_OK: case CURLE_OK:
@ -227,8 +228,8 @@ RDUpload::ErrorCode RDUpload::runUpload(const QString &username,
break; break;
} }
if(user!=NULL) { if(user!=NULL) {
seteuid(getuid()); RDCheckExitCode("RDUpload::runUpload seteuid",seteuid(getuid()));
setegid(getgid()); RDCheckExitCode("RDUpload::runUpload setegid",setegid(getgid()));
delete user; delete user;
} }
if((curl_err!=CURLE_OK)&&log_debug) { if((curl_err!=CURLE_OK)&&log_debug) {