- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Printer Access
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
02-24-2002 10:47 PM
02-24-2002 10:47 PM
of documents to number of pages or size
of documents. For example, restrict the
user to print only 10 pages or 1mb size
of docs in HPUX 11.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2002 11:01 PM
02-24-2002 11:01 PM
Re: Printer Access
You can write a wrapper script for lp. I did this once for SAP print jobs so that if they exceed a certain size, they are not printed.
I don't have it with my off-hand but it is something like this (simplied version assuming straightforward lp with only filename as parameter):
# mv /usr/bin/lp /usr/bin/lp.bin
# vi /usr/bin/lp
#!/sbin/sh
size=`ll $1|awk '{print $5}`
if [ "$size" -gt "2048" ]
then
echo $1 is too large for printing
exit 1
else
/usr/bin/lp.bin $*
fi
You can modify this wrapper script to suit your needs.
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2002 11:21 PM
02-24-2002 11:21 PM
Re: Printer Access
lp command is suid program. If I write
some shell script for this lp, is there
any security issue other than binary.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2002 11:28 PM
02-24-2002 11:28 PM
SolutionThe /usr/bin/lp script should be 0755 and owned by root since it must be an executable script.
The /usr/bin/lp.bin script should retain its permissions and be 4555 (4 for setuid) and owned by root.
There is no security implications (ie. security level will be same as before the change) because you are not modifying the binary (known now as /usr/bin/lp.bin and previously as /usr/bin/lp) or its permissions. In addition, the shell script has no setuid/setgid bits on (thus not subjected to buffer overflow vulnerability issues which cause root compromises).
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2002 12:10 AM
02-25-2002 12:10 AM
Re: Printer Access
Thanks for your idea.
I have developed the script and its working
fine with notification also..
Thanks .