file-ownership

Nobody owner (99 99) in FTP caused by php functions?

会有一股神秘感。 提交于 2019-12-06 12:14:18
I have a script (Joomla) that creates files and directories on the server. The problem is that it creates them under owner 99 99 (nobody) and after I can't delete or modify them by FTP without the help of the server admin. I think that is move_uploaded_file function of php. Is there any solution of this problem by the WHM or by the server admin? Can I modify the default owner in ftp? What happens is the HTTP server is ran by a user called "nobody", and your FTP user is another one. When the upload occurs, the HTTP server creates the file under its username, and your FTP user has no permission

What user should own /usr/local/mysql on Mac?

做~自己de王妃 提交于 2019-12-03 02:59:31
问题 What should the file owner & group be of /usr/local/mysql and all contained files & directories? MySQL was working fine, but after I did sudo chown -R $USER:staff /usr/local to install Homebrew, MySQL couldn't automatically start on startup, and on the MySQL Preferences panel, I got "Warning: The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' user," and when I clicked Start MySQL Server, it didn't connect. To fix this, I ran sudo chown -R _mysql:wheel /usr/local/mysql

What user should own /usr/local/mysql on Mac?

☆樱花仙子☆ 提交于 2019-12-02 16:28:44
What should the file owner & group be of /usr/local/mysql and all contained files & directories? MySQL was working fine, but after I did sudo chown -R $USER:staff /usr/local to install Homebrew , MySQL couldn't automatically start on startup, and on the MySQL Preferences panel, I got "Warning: The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' user," and when I clicked Start MySQL Server, it didn't connect. To fix this, I ran sudo chown -R _mysql:wheel /usr/local/mysql/data . Then, I closed & opened System Preferences. The warning went away, and when I clicked Start

Keeping fileowner and permissions after copying file in C

时光总嘲笑我的痴心妄想 提交于 2019-12-02 10:11:16
here is my problem: In C, I create the copy of a file (with some changes) This is done trivially via fopen(), getchar and putchar. Copying the file is fine and the outputfile itself is what I want it to be. My problem is: I assume that I will use this program often as sudo and then the resulting file has both another owner (root) as well as different permissions (execute rights are gone). My question is: How can I copy the owner and permissions of the original file and then write them into the new one? Use the fstat (2) system call to obtain the details about the owner and the permissions, and

How do you permit PHP to write to a file without compromising server security

邮差的信 提交于 2019-12-01 20:01:02
问题 I am often confronted with negative comments whenever I want to have a PHP script write output to a file on the server. I use the fopen() , fwrite() and fclose() functions. The only way I know how to make this happen is to either set the permissions for the output file to 0666 or have it owned by "nobody" (which is the user that PHP runs under on our Apache web server). So, if "0666" or "owned by nobody" are security risks, how do you successfully and securely allow a PHP script to write to a

How do you permit PHP to write to a file without compromising server security

♀尐吖头ヾ 提交于 2019-12-01 18:04:18
I am often confronted with negative comments whenever I want to have a PHP script write output to a file on the server. I use the fopen() , fwrite() and fclose() functions. The only way I know how to make this happen is to either set the permissions for the output file to 0666 or have it owned by "nobody" (which is the user that PHP runs under on our Apache web server). So, if "0666" or "owned by nobody" are security risks, how do you successfully and securely allow a PHP script to write to a file? Thanks for sharing guidance on this topic. If you need to access the files from PHP after they

How to get file's owner name in Linux using C++?

泄露秘密 提交于 2019-11-30 07:06:34
How can I get get the owner name and group name of a file on a Linux filesystem using C++? The stat() call only gives me owner ID and group ID but not the actual name. -rw-r--r--. 1 john devl 3052 Sep 6 18:10 blah.txt How can I get 'john' and 'devl' programmatically? Jonathan Leffler Use getpwuid() and getgrgid() . #include <pwd.h> #include <grp.h> #include <sys/stat.h> struct stat info; stat(filename, &info); // Error check omitted struct passwd *pw = getpwuid(info.st_uid); struct group *gr = getgrgid(info.st_gid); // If pw != 0, pw->pw_name contains the user name // If gr != 0, gr->gr_name

Find out File Owner/Creator in C# [duplicate]

大兔子大兔子 提交于 2019-11-29 06:58:28
问题 Possible Duplicate: Getting / setting file owner in C# I searched the Internet but didn't found out how to get the File Creator/Owner In the FileInfo Class are only other Attributes like lastAccessTime, Size, but not the Owner/Creator. Does somebody know the answer? 回答1: string user = System.IO.File.GetAccessControl(path).GetOwner(typeof(System.Security.Principal.NTAccount)).ToString(); 来源: https://stackoverflow.com/questions/7445182/find-out-file-owner-creator-in-c-sharp

Docker creates files as root in mounted volume [duplicate]

对着背影说爱祢 提交于 2019-11-27 14:25:44
问题 This question already has an answer here: Share files between host system and docker container using specific UID 4 answers I'm using Docker (1.3.1) to build RPMs inside a container: docker run -v /home/matt/build:/build build-rpm /build/build-pkg.sh This works fine (my user is in the docker group, so I don't need to sudo) and drops a completed .rpm file in the current directory. The problem is that the file is created as owned by root. How can I arrange it so that the file is created owned