- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- permission issue
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2009 08:53 AM
07-21-2009 08:53 AM
I am facing one problem in sendmail that permission denied error. i checked for permission of /var/spool/clientmqueue and that was 755. i changed it to 770 and sendmail is working fine afterwards.
Next day, i faced the same issue again in same server and again the permission changed to 755. i checked for crontab and there is a script scheduled everyday, which is something like this.
# Fix homedir ownership and access.
if [ -r ${homedir} ]
then
echo "Resetting ownership and access for ${homedir}." >> $log
chown ${login}:${gid} ${homedir}
chmod 755 ${homedir}
fi
Which fix the ownership and permissions for every user in /etc/passwd. As smmsp is the user exist in /etc/passwd and /var/spool/clientmqueue is his home directory, it changes the permission of clientmqueue to 755 everyday. We cannot comment this script to run. Please suggest how would i get rid of this problem.
And, also please tell me what is this -r is used in that script.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2009 09:03 AM
07-21-2009 09:03 AM
Solutionthe script you have given does nothing to the /var/spool/mqueue unless you have a symbollic link to this mqueue file and doing something like
chown -R owner:group ${homedir}
chmod -R permissions ${homedir}
which will recursively change the contents of the homedir. But your script snippet above is not an indicative of this. So, whatever your problem is, is not coming from this code you gave in your post
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2009 09:09 AM
07-21-2009 09:09 AM
Re: permission issue
The '-r' tests for readability (true or false being the result).
I presume that your script has a loop so you could do something like:
#!/usr/bin/sh
OLDIFS=${IFS}
IFS=":"
while read name pass uid gid homedir shellprog
do
[ "${name}" = smmsp -o "${name}" = root ] && continue
if [ -r ${homedir} ]; then
echo "Resetting ownership and access for ${homedir}." >> $log
chown ${login}:${gid} ${homedir}
chmod 755 ${homedir}
fi
done < /etc/passwd
IFS=${OLDIFS}
exit 0
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2009 09:18 AM
07-21-2009 09:18 AM
Re: permission issue
You cannot allow this script to run anymore. You must contact the senior system administrator and point out the consequences of running this script. I would seriously question why such a script is needed. If users are damaging their directories by experimenting with commands they don't understand, those users must not have a shell login. Instead, they must be given a simple menu that they cannot modify. This script will damage application user directories such as Oracle or Sybase and applications.
I would request that the reason this script exists needs to be fixed (as in: remove the reason for $HOME directories changing)
The [ -r ${homedir} ] is testing to see if the directory is readable, a poor test indeed. This might be a file or a symbolic link or any of several inappropriate things. And whether the directory is readable by the current script is irrelevant. This script would have to be run by root for a normal set of home directories.
A better test is -d to test for a directory but that isn't enough for proper validation.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2009 10:15 AM
07-21-2009 10:15 AM
Re: permission issue
We are editing this script accordingly so that it wont do such conditional test and changing of ownership of home directories.