Sponsored Content
Top Forums Shell Programming and Scripting File Permissions (interesting one) Post 302168071 by sakshale on Sunday 17th of February 2008 12:11:51 AM
Old 02-17-2008
Unfortunately, for basic Unix, your first solution is the only one. You will have to create a custom group for those users. Fortunately, however, updated versions of Unix have added the concept of Access Control Lists. With them, you can grant user specific permissions on a specific file or directory. Check the documentation for what you are using, to see if Access Control Lists are supported.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File permissions

Is there any way that I can use the ls command to view the permissions that a group has on a file. I know ls -l file1 will list all the permissions for file1. Would I have to use the following command: ls -l file1 Then grep or sed the output to retrieve what permissions the group has. (5 Replies)
Discussion started by: beginner1
5 Replies

2. UNIX for Dummies Questions & Answers

file permissions: l

Hello, what does the l file permission stands for and in which UNIX systems can it be used? (1 Reply)
Discussion started by: Tobe
1 Replies

3. HP-UX

To give the "unzip" permissions & "create" file permissions

Hi, I am a Unix Admin. I have to give the permissions to a user for creating new file in a directory in HP-Ux 11.11 system since he cannot able to create a new file in the directory. Thanks in advance. Mike (3 Replies)
Discussion started by: Mike1234
3 Replies

4. UNIX for Advanced & Expert Users

File Permissions

Hi All, Could any one help me on is there any file where all file permissions are being stored? Please help me. (10 Replies)
Discussion started by: umesh.rout
10 Replies

5. Shell Programming and Scripting

Retain file permissions when saving .sh file from internet [OS X]

Hello. I have written a bash script that I am sharing with an OS X community I am a member of. The purpose of the script is to execute a series of commands for members without them having to get involved with Terminal, as it can be daunting for those with no experience of it at all. I have renamed... (4 Replies)
Discussion started by: baza210
4 Replies

6. HP-UX

File with no permissions

All, I have a very strange situation here. I have a server with 2 filesystems for 2 different users. The filesystem my user id is part of is copying a file with permissions 666 to the other filesystem - the files copied are owned by my userid. Sometimes, the file will be copied and when... (8 Replies)
Discussion started by: simshark
8 Replies

7. Solaris

File permissions

I have a process that runs as root user on solaris 10 and generates text files as output. The output files have a permission of 600. I need the file permission to be 644 so that other users can view the file. The output file is stored on a local disk (ZFS). Please help. Thanks in advance. (4 Replies)
Discussion started by: pingmeback
4 Replies

8. UNIX for Dummies Questions & Answers

File permissions

What command can i use to make sure that i cannot delete a file called backup (which i own) without affecting other permissions? seems simple dont know how i forgot. :mad: ---------- Post updated at 07:59 PM ---------- Previous update was at 06:34 PM ---------- anyone ??? ----------... (6 Replies)
Discussion started by: ink
6 Replies

9. Shell Programming and Scripting

ksh; Change file permissions, update file, change permissions back?

Hi, I am creating a ksh script to search for a string of text inside files within a directory tree. Some of these file are going to be read/execute only. I know to use chmod to change the permissions of the file, but I want to preserve the original permissions after writing to the file. How can I... (3 Replies)
Discussion started by: right_coaster
3 Replies

10. Shell Programming and Scripting

Changing file permissions of a file created by another user

Hi, I have used expdp for datapump. The .dmp file is created by the "oracle" user. my requirement is to make a zipped file of this .dmp file. What i am trying to do is change the permissions of this .dmp file from 0640 to 0644 and then do a gzip and zip it. Is there any way i can change... (3 Replies)
Discussion started by: qwertyu
3 Replies
ARCHIVE_ENTRY_ACL(3)					   BSD Library Functions Manual 				      ARCHIVE_ENTRY_ACL(3)

NAME
archive_entry_acl_add_entry, archive_entry_acl_add_entry_w, archive_entry_acl_clear, archive_entry_acl_count, archive_entry_acl_next, archive_entry_acl_next_w, archive_entry_acl_reset, archive_entry_acl_text_w -- functions for manipulating Access Control Lists in archive entry descriptions LIBRARY
Streaming Archive Library (libarchive, -larchive) SYNOPSIS
#include <archive_entry.h> void archive_entry_acl_add_entry(struct archive_entry *a, int type, int permset, int tag, int qualifier, const char *name); void archive_entry_acl_add_entry_w(struct archive_entry *a, int type, int permset, int tag, int qualifier, const wchar_t *name); void archive_entry_acl_clear(struct archive_entry *a); int archive_entry_acl_count(struct archive_entry *a, int type); int archive_entry_acl_next(struct archive_entry *a, int type, int *ret_type, int *ret_permset, int *ret_tag, int *ret_qual, const char **ret_name); int archive_entry_acl_next_w(struct archive_entry *a, int type, int *ret_type, int *ret_permset, int *ret_tag, int *ret_qual, const wchar_t **ret_name); int archive_entry_acl_reset(struct archive_entry *a, int type); const wchar_t * archive_entry_acl_text_w(struct archive_entry *a, int flags); DESCRIPTION
An ``Access Control List'' is a generalisation of the classic Unix permission system. The ACL interface of libarchive is derived from the POSIX.1e draft, but restricted to simplify dealing with practical implementations in various Operating Systems and archive formats. An ACL consists of a number of independent entries. Each entry specifies the permission set as bitmask of basic permissions. Valid permis- sions are: ARCHIVE_ENTRY_ACL_EXECUTE ARCHIVE_ENTRY_ACL_WRITE ARCHIVE_ENTRY_ACL_READ The permissions correspond to the normal Unix permissions. The tag specifies the principal to which the permission applies. Valid values are: ARCHIVE_ENTRY_ACL_USER The user specified by the name field. ARCHIVE_ENTRY_ACL_USER_OBJ The owner of the file. ARCHIVE_ENTRY_ACL_GROUP The group specied by the name field. ARCHIVE_ENTRY_ACL_GROUP_OBJ The group who owns the file. ARCHIVE_ENTRY_ACL_MASK The maximum permissions to be obtained via group permissions. ARCHIVE_ENTRY_ACL_OTHER Any principal who doesn't have a user or group entry. The principals ARCHIVE_ENTRY_ACL_USER_OBJ, ARCHIVE_ENTRY_ACL_GROUP_OBJ and ARCHIVE_ENTRY_ACL_OTHER are equivalent to user, group and other in the classic Unix permission model and specify non-extended ACL entries. All files have an access ACL (ARCHIVE_ENTRY_ACL_TYPE_ACCESS). This specifies the permissions required for access to the file itself. Direc- tories have an additional ACL (ARCHIVE_ENTRY_ACL_TYPE_DEFAULT), which controls the initial access ACL for newly created directory entries. archive_entry_acl_add_entry() and archive_entry_acl_add_entry_w() add a single ACL entry. For the access ACL and non-extended principals, the classic Unix permissions are updated. archive_entry_acl_clear() removes all ACL entries and resets the enumeration pointer. archive_entry_acl_count() counts the ACL entries that have the given type mask. type can be the bitwise-or of ARCHIVE_ENTRY_ACL_TYPE_ACCESS and ARCHIVE_ENTRY_ACL_TYPE_DEFAULT. If ARCHIVE_ENTRY_ACL_TYPE_ACCESS is included and at least one extended ACL entry is found, the three non-extened ACLs are added. archive_entry_acl_next() and archive_entry_acl_next_w() return the next entry of the ACL list. This functions may only be called after archive_entry_acl_reset() has indicated the presence of extended ACL entries. archive_entry_acl_reset() prepare reading the list of ACL entries with archive_entry_acl_next() or archive_entry_acl_next_w(). The function returns either 0, if no non-extended ACLs are found. In this case, the access permissions should be obtained by archive_entry_mode(3) or set using chmod(2). Otherwise, the function returns the same value as archive_entry_acl_count(). archive_entry_acl_text_w() converts the ACL entries for the given type mask into a wide string. In addition to the normal type flags, ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID and ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT can be specified to further customize the result. The returned long string is valid until the next call to archive_entry_acl_clear(), archive_entry_acl_add_entry(), archive_entry_acl_add_entry_w() or archive_entry_acl_text_w(). RETURN VALUES
archive_entry_acl_count() and archive_entry_acl_reset() returns the number of ACL entries that match the given type mask. If the type mask includes ARCHIVE_ENTRY_ACL_TYPE_ACCESS and at least one extended ACL entry exists, the three classic Unix permissions are counted. archive_entry_acl_next() and archive_entry_acl_next_w() return ARCHIVE_OK on success, ARCHIVE_EOF if no more ACL entries exist and ARCHIVE_WARN if archive_entry_acl_reset() has not been called first. archive_entry_text_w() returns a wide string representation of the ACL entrise matching the given type mask. The returned long string is valid until the next call to archive_entry_acl_clear(), archive_entry_acl_add_entry(), archive_entry_acl_add_entry_w() or archive_entry_acl_text_w(). SEE ALSO
archive(3), archive_entry(3) BUGS
ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID and ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT are not documented. BSD
February 2, 2012 BSD
All times are GMT -4. The time now is 05:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy