file-permissions

How to give file permission to a specific user in a Group?

荒凉一梦 提交于 2019-12-05 12:14:13
问题 I have a Group 'g1' having 2 users Alice and Bob. I want to share a file 'file1' with both of them with different permissions.(for Alice read only and for Bob Read+write) 回答1: Assuming Bob can own the file the following should work for you. $ chown Bob:g1 file1 First set the ownership of the file to Bob to allow for read+write access and set the group ownership to the g1 group. $ chmod 640 file1 Set the owner to a read and write and set the group to read only. This is a common permission

Delphi 2009 classes / components to read/write file permissions

◇◆丶佛笑我妖孽 提交于 2019-12-05 10:22:10
Does anyone have a set of classes / components that will work with Delphi 2009 (Unicode) to read and write NTFS file permissions? There was a thing called "NTSet" - but they stopped development at Delphi 2006 about 3 years ago :-( Any other takers?? Thanks! Marc JCL has units to deal with file permissions, and they claim D2009 compatibility. Colin Wilson's "NT low-level" component set wraps the APIs you need, and supports Delphi 2009 as well as earlier releases. However you may need to rely on the MS documentation and samples if you need detailed help to implement a specific operation. You can

PHP - Protecting site from folders with 777 permissions

微笑、不失礼 提交于 2019-12-05 10:00:11
问题 Usually, I try to set my folders to have permission 775, but some web-hosting refuses to let PHP writes or move files to any folders unless it has permission 777 (it may be open_dir or safe mode). Are there any ways to prevent any PHP files from being ran from such folders, in case a malicious PHP script has been uploaded there? 回答1: Are there any ways to prevent any PHP files from being ran from such folders, in case a malicious PHP script has been uploaded there? You could disable PHP for

File ownership on building docker images

隐身守侯 提交于 2019-12-05 09:52:05
I want to set up file permissions for files I add to a docker image. I have this simple Dockerfile: FROM ubuntu:utopic WORKDIR /app RUN groupadd -g 1000 baz && useradd -u 1000 -g baz baz -d /app -s /bin/false RUN chown baz:baz /app && chmod g+s /app # want this to be have group baz ADD foo /app/ Building this with docker build -t abc . where there is a foo file in . creates an image. However, the permissions on /app/foo inside is not what I want. docker run abc ls -la total 12 drwxr-xr-x 2 baz baz 4096 Sep 2 23:21 . drwxr-xr-x 37 root root 4096 Sep 3 07:27 .. -rw-rw-r-- 1 root root 419 Sep 2

Umask difference between 0022 and 022 [closed]

▼魔方 西西 提交于 2019-12-05 09:47:30
问题 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 6 years ago . Is there any difference between umask 0022 and 022 ? I want to change my umask to 022 . How can I do it? 回答1: There is no difference between umask 0022 and umask 022 . The octal umasks are calculated via the bitwise AND of the unary complement of the argument using bitwise NOT. Set the umask like this: el@apollo

How to recursively change the owner and group on a directory with Chef?

倖福魔咒の 提交于 2019-12-05 09:39:10
问题 the resource_directory has only 2 actions available: create and delete I need to update the owner and group of a directory recursively. How do I do that? using a simple resource_execute ? execute "chown-data-www" do command "chown -R www-data:www-data /var/www/myfoler" user "root" action :run end 回答1: You can set the default action to nothing then have resources that may screw things up notify the perm fixer: execute "chown-data-www" do command "chown -R www-data:www-data /var/www/myfoler"

How can I get the default file permissions in Python?

岁酱吖の 提交于 2019-12-05 05:49:12
I am writing a Python script in which I write output to a temporary file and then move that file to its final destination once it is finished and closed. When the script finishes, I want the output file to have the same permissions as if it had been created normally through open(filename,"w") . As it is, the file will have the restrictive set of permissions used by the tempfile module for temp files. Is there a way for me to figure out what the "default" file permissions for the output file would be if I created it in place, so that I can apply them to the temp file before moving it? For the

Microsoft VBScript runtime error '800a0046' Permission denied

痴心易碎 提交于 2019-12-05 00:55:41
问题 I get the following error: Microsoft VBScript runtime error '800a0046' Permission denied When running a classic asp application. The error is here: (in the CreateTextFile line) Dim myFSO set myFSO = Server.CreateObject("Scripting.FileSystemObject") myFSO.CreateTextFile(fName) I know I can get around this problem by giving "Full control" to the "Everyone" user. This is a publicly accessible folder on our server, so I worry that this is a security risk? I would prefer to be able to give full

Glyphicons shows up fine in development but not when hosted in IIS

情到浓时终转凉″ 提交于 2019-12-05 00:07:03
问题 I am able to view my icons just fine when during development, however after creating the deployment package using visual studio's build deployment package, and hosting it on my local (same PC) IIS7.5 server, the icons do not show up. I just get a blank box for all of them I checked the path, the images are there. I googled around, and found someone with the same issue he had, but he was hosting his web project on apache, so what he did was to chmod all his files and folders to 777. I kinda

How to protect downloadable files in a remote directory from non-premium users (in php?)

天大地大妈咪最大 提交于 2019-12-04 18:46:49
Im building a "premium" section of my site and Im in a need to give download access to files in a remote directly (on a different server), to users with special privileges (accounts stored in mysql db). My site is coded in php/mysql so a php solution would be great. direct all download links to a php file that'll do all the credential checking. you can call the file download.php pass along parameters via cookies, get, post, session, or whichever manner you verify privileges. once credentials are verified, you can send an appropriate header. if it's an image, the header would be header("Content