umask

Changing umask of apache on ArchLinux [closed]

邮差的信 提交于 2019-12-11 16:44:45
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . This didn't work: Setting the umask of the Apache user Arch doesn't have a /etc/apache2/envvars file, and changing the /etc/rc.d/httpd script didn't change anything. Maybe someone can enlighten me how/where to exactly change the rc-script, so apache has an umask 002 回答1: After trying again, strangely editing the

How to set umask default for an user?

风流意气都作罢 提交于 2019-12-11 09:17:12
问题 Does anybody know how can I set an umask by default for an user and force them to use it? I think put umask 0002 , for example, in his ~/.bashrc file but if I do that, they can change umask. Thanks ;) 回答1: You can make a work around for it by using /etc/profile file. I added the following lines at end of /etc/profile . It will overwrite the actual umask command by after setting it the value which you require umask 0002 alias umask='echo umask cannot be changed' enable -n umask [root@client1 ~

PHP mkdir() and fopen() does not work - permissions problem? umask problem?

只谈情不闲聊 提交于 2019-12-10 13:56:57
问题 The following PHP script fails to create the directory. It will also fail to create the file (when the directory already exists). ini_set('error_reporting', E_ALL); define('ABSPATH', $_SERVER['DOCUMENT_ROOT']); echo ABSPATH . '<br /><br />'; $dir_to_make = ABSPATH . '/aaatest'; $file_to_make = ABSPATH . '/aaatest/aaatest.txt'; echo umask() . '<br />'; mkdir($dir_to_make) or die('could not create directory'); fopen($file_to_make) or die('could not open/create file'); The umask() is returning a

Setting the umask of the jenkins process

大兔子大兔子 提交于 2019-12-10 12:47:03
问题 Our jenkins CI server (v1.499) runs tests that call URLs on the CI machine. The applications behind those URLs change the same temporary files as the unit test processes change, so those files need to be group writable. I fixed that for apache already, but totally fail with jenkins. Modifying /etc/default/jenkins to include an umask 002 command does not help. I'm checking that with gdb after restarting the service. So how can I change jenkins' umask setting? 回答1: Set the umask by configuring

What causes git's post-receive umask to be different from the user's umask?

≡放荡痞女 提交于 2019-12-07 08:42:03
问题 After some digging and help here from other people, I found out that I have a problem with the umask setting in git. What I want to achieve is that any git repo that is being checked out on my server, that the umask setting defaults to 0002. I don't want to have to configure this in every post-receive hook... I want this to be the default umask . How do I achieve that? My repositories are uploaded by logging in to ssh with the git user on the server. When I check the umask setting, this is

How to set default permissions for new files created with php

a 夏天 提交于 2019-12-07 07:47:48
问题 Hi I am running a centos server and I want to know how I can set the default chmod of a newly created file that is created by php like fopen. At the moment it is doing 644 but I want 666 so where can I specify this setting? 回答1: Like Linux, PHP has a chmod() command that can be invoked to change file permissions. See the documentation here: http://php.net/manual/en/function.chmod.php For a default setting you might try what Patrick Fisher states here: Setting the umask of the Apache user

How to create directory with right permissions using C on Posix

喜欢而已 提交于 2019-12-06 23:47:27
问题 I am trying to write a simple C program that creates directories (a mkdir clone.). This is what I have so far: #include <stdlib.h> #include <sys/stat.h> // mkdir #include <stdio.h> // perror mode_t getumask() { mode_t mask = umask(0); umask (mask); return mask; } int main(int argc, const char *argv[]) { mode_t mask = getumask(); printf("%i",mask); if (mkdir("trial",mask) == -1) { perror(argv[0]); exit(EXIT_FAILURE); } return 0; } This code creates directory with d--------- but I want it to

linux测试umask

冷暖自知 提交于 2019-12-05 18:59:40
客户需求,由于ftp服务器权限管理需要,测试能否通过修改oracle umask值,达到expdp导出文件权限,导出即是想要的权限。 Session 1 [oracle@adg1 ~]$ umask 0022 [oracle@adg1 ~]$ umask -S u=rwx,g=rx,o=rx 修改umask值 [oracle@adg1 ~]$ umask 027 [oracle@adg1 ~]$ umask -p umask 0027 [oracle@adg1 ~]$ touch a.txt -rw-r--r-- 1 oracle oinstall 0 08-14 22:22 test.txt -rw-r----- 1 oracle oinstall 0 08-14 22:23 a.txt --文件权限已换 -rw-r--r-- 1 oracle oinstall 0 08-14 22:24 b.txt Session 2 使用umask修改,只在当前session生效 [oracle@adg1 ~]$ umask 0022 touch c.txt [oracle@adg1 ~]$ ls -lrt c.txt -rw-r--r-- 1 oracle oinstall 0 Aug 14 22:33 c.txt 使用数据泵进行导出expdp一个表 $ expdp \'/ as

How to set default permissions for new files created with php

荒凉一梦 提交于 2019-12-05 15:42:11
Hi I am running a centos server and I want to know how I can set the default chmod of a newly created file that is created by php like fopen. At the moment it is doing 644 but I want 666 so where can I specify this setting? Wes Crow Like Linux, PHP has a chmod() command that can be invoked to change file permissions. See the documentation here: http://php.net/manual/en/function.chmod.php For a default setting you might try what Patrick Fisher states here: Setting the umask of the Apache user [root ~]$ echo "umask 000" >> /etc/sysconfig/httpd [root ~]$ service httpd restart You can use umask()

What causes git's post-receive umask to be different from the user's umask?

倾然丶 夕夏残阳落幕 提交于 2019-12-05 13:48:07
After some digging and help here from other people , I found out that I have a problem with the umask setting in git. What I want to achieve is that any git repo that is being checked out on my server, that the umask setting defaults to 0002. I don't want to have to configure this in every post-receive hook... I want this to be the default umask . How do I achieve that? My repositories are uploaded by logging in to ssh with the git user on the server. When I check the umask setting, this is already set to the right setting: root@server:~# su git git@server:~$ umask 0002 However, if I put umask