chmod with CInternetFile or CFTPConnection

Posted on 2003-03-06
Medium Priority
Last Modified: 2013-11-20

I'm transfering files with help of the MFC-Classes CInternetConnection and CFTPConnection. The problem is that the files does not have enough permissions on the target server. I can not find any methode to change the file permissions. Is there any other way ? I did not find a methode for permissions within the CInternetFile, too.

What could I do ?
Question by:DennisWood
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2

Expert Comment

ID: 8080571
What do you mean change permissions???
The files sould take the default permission of the shell
(if you're in unix) which is set with the umask command...

You want to setuided the files so that there executed by a
admin account or someting like that os a remote system???
On a windoze marchine or a unix one?


Author Comment

ID: 8081338
I mean the unix file access permissions on the linux-ftp-server. In usual ftp-clients it is possible to transfer a file to a ftp server and then change the permissions, e.g. to rw-rw-rw- (666).

I don't want to change anything on the ftp-server !

The "client" I write under windoze with the MFC

Expert Comment

ID: 8081479
So If I understand correctly...
A windoze client upload a file on a unix ftp server.
But it turns out that the dile on the unix machine has the
wrong file permission (like 444) and you are wondering how to
chmod the file from the client side AFTER it has been uploaded...

I think once the file has been transfered from the client it is too late...

Several options are available on the unix side...
a cron job which chmod all file in the upload area at regular
interval seems the simplest...

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

LVL 49

Expert Comment

ID: 8094844
>>I don't want to change anything on the ftp-server !

If you want to change the file permissions on the server, then how can this be true?  Perhaps you need to provide mpore information.  Are you talking about downloading files from the server or uploading files to it?

-- Dan

Author Comment

ID: 8111780
I'm talking about uploading.
It would be enough to give the file the correct permissions, e.g. 444, in the moment I upload it.
LVL 49

Expert Comment

ID: 8113788
Wouldn't allowing the client to set the permissions be a serious security breach?  For instance, if the server was set to disallow execution, then if the client were to be allowed to simply override that setting... well, it makes me shudder.  Even something as simple as allowing the client to change a read-only file to a read-write could be disasterous.

-- Dan

Accepted Solution

aquila98 earned 300 total points
ID: 8113959
I think is you set up a default shell for the anonymous user
account (or whatever user you use to ftp and upload) with
the umask command like umask 444 (assuming you're under Solaris... Other unix might have another syntax for that command, check the man page)... That way ANY files created
by that shell would have 444 by default... As long as the user can cd to a folder and pass along the 444 permission up to
the file thru the folders...

This info is kelp in /etc/passwd or /etc/login forget which...
If I remember enaugh my unix days this might work...


Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question