09-04-2009
write permission to a perticular user to a directory
Hi,
The requirement is like,
the program needs 2 argument one is user_id and second one is directory path. My script will check if that user_id has write access to the directory path. The directory path may be in any file system like AFS or NFS.
Can any one please suggest some points to procceed? I have written somthing which works fine for NFS not for AFS. My logic is checking if the said user_id is the owner and 'u' part of the prmission rwx or not, similalry if it not owner, then chek if belongs to group of that directory owner and like wise.
10 More Discussions You Might Find Interesting
1. Solaris
dear all
does any one give any user write permission using access control list or another way to solve this problem (1 Reply)
Discussion started by: murad.jaber
1 Replies
2. Shell Programming and Scripting
I need to find all the files that have group Read or Write permission or files that have user write permission.
This is what I have so far:
find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}'
It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies
3. UNIX for Dummies Questions & Answers
hello,
I would like to grant full access to a directory which is owned by root and the web application that created it. I have though of adding the permission to the whole world, but for security reason I would like to grant it to one more user.
I have tried this 'chmod -U newUser+wrx... (2 Replies)
Discussion started by: run123
2 Replies
4. Solaris
is is possible to grant user access to only one subdirectory? example
a. create ftp user with read/write/delete access (ftp user doesnt belong to uguys group)
$ cd /etc/mydir
$ls
file1 file2
$ls -al
-rw-rw-r-x 2 unixguy uguys 96 Dec 8 12:53 file1
-rw-rw-r-x 2 unixguy uguys 96 Dec 8... (1 Reply)
Discussion started by: lhareigh890
1 Replies
5. Shell Programming and Scripting
Guys, i wanna get any user files with write permission (on user or group permission) for review but i confuse with -perm parameter.
any body can help me to explain what is that mean?
thank's (1 Reply)
Discussion started by: michlix
1 Replies
6. Web Development
Hi
I am trying to make a web program which is command line equivalent. i have done the coding in cgi program in perl and html for basic forms to take inputs. when i ran the program from web application i see permission denied messages. after analyzing i found apache is running as wwwrun which... (2 Replies)
Discussion started by: rakeshkumar
2 Replies
7. UNIX for Advanced & Expert Users
In our project we have several unix scripts that trigger different processes. These scripts write logs to a particular folder 'sesslogs', create output data files in a separate directory called 'datafiles' etc. Usually L1 support team re-run these scripts . We donot want L1 support team to have... (14 Replies)
Discussion started by: waavman
14 Replies
8. UNIX for Beginners Questions & Answers
Hi All,
We have a scenario in production where we want only one user from a group to modify the file. The file is not set to write permission for application manager.
-r--r--r-- 1 amgr u00 15661716 Aug 30 00:06 DCI.dat
So here amgr will have permission to edit the file. We want a... (10 Replies)
Discussion started by: arunkumar_mca
10 Replies
9. UNIX for Beginners Questions & Answers
logMsg='Started by '${USER}
LOG_MESSAGE "${logMsg}"
resultCode=$?
if ]; then
return ${resultCode}
fi
touch ${FILELISTPATH}
resultCode=$?
if ]; then
logMsg='failed to create file list:'${FILELISTPATH}
LOG_ERROR "${logMsg}" CUSTOM_PREPROCESS ${FATAL}
... (2 Replies)
Discussion started by: raka123
2 Replies
10. UNIX for Beginners Questions & Answers
I have built a website and I can access and edit the website'files on server via the root user. The current file and directory structures are not changeable. Now I am hiring a webpage designer to help me re-design some pages, I am going to let the designer edit the files directly on the server. So... (5 Replies)
Discussion started by: uwo-g-xw
5 Replies
LEARN ABOUT DEBIAN
dpns_rename
DPNS_RENAME(3) DPNS Library Functions DPNS_RENAME(3)
NAME
dpns_rename - rename a DPNS file or directory in the name server
SYNOPSIS
#include <sys/types.h>
#include "dpns_api.h"
int dpns_rename (const char *oldpath, const char *newpath)
DESCRIPTION
dpns_rename renames a DPNS file or directory in the name server.
oldpath and newpath must be of the same type, i.e. both regular files or both directories.
If newpath exists already, it will be removed before the rename takes place. If newpath is a directory, it must be empty.
When renaming a directory, newpath must not be a descendant of oldpath, i.e. newpath must not contain a path prefix that names oldpath.
Write permission is required on both parents. If oldpath is a directory, write permission is required on it and if newpath is an existing
directory, write permission is also required on it.
If any of the parents has the sticky bit S_ISVTX set, either
the effective user ID of the requestor must match the owner ID of the file or
the effective user ID of the requestor must match the owner ID of the directory or
the file must be writable by the requestor or
the requestor must have ADMIN privilege in the Cupv database.
RETURN VALUE
This routine returns 0 if the operation was successful or -1 if the operation failed. In the latter case, serrno is set appropriately.
ERRORS
ENOENT A component of oldpath prefix does not exist or oldpath or newpath is a null pathname.
EACCES Search permission is denied on a component of the path prefixes or write permission on the parent directories is denied or
oldpath is a directory and write permission is denied on oldpath or newpath.
EFAULT oldpath or newpath is a NULL pointer.
EEXIST newpath is an existing directory and is not empty or newpath is an existing file with replicas.
ENOTDIR A component of the path prefixes is not a directory or oldpath is a directory and newpath is an existing regular file.
EISDIR newpath is a directory while oldpath is a regular file.
EINVAL newpath is a descendant of oldpath.
ENAMETOOLONG The length of oldpath or newpath exceeds CA_MAXPATHLEN or the length of a path component exceeds CA_MAXNAMELEN.
SENOSHOST Host unknown.
SENOSSERV Service unknown.
SECOMERR Communication error.
ENSNACT Name server is not running or is being shutdown.
SEE ALSO
Castor_limits(4), dpns_chdir(3), dpns_chmod(3), dpns_unlink(3), Cupvlist(1)
AUTHOR
LCG Grid Deployment Team
DPNS
$Date: 2005/06/30 08:34:03 $ DPNS_RENAME(3)