- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: DIRCMP kind of misleading
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
Discussions
Discussions
Forums
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
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
тАО08-15-2002 02:05 PM
тАО08-15-2002 02:05 PM
I ran a dircmp on a directory with 6 programs and all came back showing they were the same. Another user did the exact same dircmp and the results were that each program was different.
You ask why? I will tell you. The other user did not have permission to read the individual files.
DIRCMP did not give any indication of a read problem. The results were correct. What the user could read from the two directories were different.
What is your recommendations:
1. Ask for a change to the program?
2. Let the program be as is?
3. Some other ideas?
TIA
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2002 02:24 PM
тАО08-15-2002 02:24 PM
SolutionThe other thing to keep in mind is that dircmp can only compare text file; binary data will throw it a curveball. If you really want to do a comparison, you should build a utility around cksum. If the CRC's agree, the files are identical. You could make if fairly fancy by using the file command to determine if the file is a textfile and then run the diff command if you want the difflike output that dircmp can provide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2002 03:01 PM
тАО08-15-2002 03:01 PM
Re: DIRCMP kind of misleading
That is all the info I need.
I will build into the script to check permissions of the files first.
You get all the points
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2002 03:21 PM
тАО08-15-2002 03:21 PM
Re: DIRCMP kind of misleading
then cmp -s $D1/"$a" $D2/"$a"
>add RET=$?
>chg if [ $RET = 0 ]
then if [ "$Sflag" != "yes" ]
then echo "same $a"
fi
>add elif [ $RET != 1 ]
>add then if [ "$Sflag" != "yes" ]
>add then echo "unreadable $a"
>add fi
else echo "different $a"
Here is the output: I suggest HP make the change to dircmp. The cmp command has 2 as an unreadble return code for files.
Aug 15 19:25 2002 Comparison of dir1 dir2 Page 1
directory .
unreadable ./eric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-18-2002 02:05 AM
тАО08-18-2002 02:05 AM
Re: DIRCMP kind of misleading
are on target. They're evil from a security
standpoint. So evil, in fact, that future HP-UX releases (11.22 and later) will not support them by default.
It wouldn't make sense to make dircmp setuid
anyway. Doing this would effectively let any user read any file on the system!
I agree that silently skipping unreadable
files is non-intuitive. Making dircmp give
better error messages in this case seems
like the right thing to do. I have
submitted an enhancement request for
dircmp with HP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2002 04:39 AM
тАО08-19-2002 04:39 AM
Re: DIRCMP kind of misleading
As you can see I did not change the setuid.
It was just a simple check of the return code that was already documented.
Thanks for submitting it to HP. I do not know the procedure for that ans appreciate it.