- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script question
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
10-24-2000 12:47 AM
10-24-2000 12:47 AM
script question
this will be executed by the particular user. Can Anyone through how can I
achieve this. I tried suid option (chmod 4711 file). still have problem?
2. While running a script, user could not able to use ctrl+c or any other command
to get unix prompt. If any interruption occurs, it should go back to previous menu.
Pls help me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2000 12:52 AM
10-24-2000 12:52 AM
Re: script question
when using suid/sgid on shell scripts you must have at the first line (example posix-shell):
#!/sbin/sh
To prevent exiting the script by CTRL-C do:
trap "echo break" 2
(make sure you have an input option to leave the script)
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2000 12:58 AM
10-24-2000 12:58 AM
Re: script question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2000 01:07 AM
10-24-2000 01:07 AM
Re: script question
One way to avoid the suid problem altogether in this case is to (re)create your print queues allowing CANCEL by anyone. There's a check-box when you setup printers in SAM to specify this. The -orc option of 'lpadmin' controls this ability.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2000 01:10 AM
10-24-2000 01:10 AM
Re: script question
and the machine is in production now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2000 01:12 AM
10-24-2000 01:12 AM
Re: script question
here an example c source:
main(argc, argv)
int argc;
char **argv;
{
setuid(9);
setgid(7);
execvp("/usr/bin/cancel", argv);
}
Compile ie:
cc mycancel.c -o /usr/contrib/bin/mycancel
chown lp:lp /usr/contrib/bin/mycancel
chmod ug+s /usr/contrib/bin/mycancel
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2000 01:22 AM
10-24-2000 01:22 AM
Re: script question
I can't able to use the '-e' option. other thing is working fine. What could
be the problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2000 01:26 AM
10-24-2000 01:26 AM
Re: script question
so you have to set root capabilties (but i think this could be a security risk):
main(argc, argv)
int argc;
char **argv;
{
setuid(0); setgid(3);
execvp("/usr/bin/cancel", argv);
}
Compile ie:
cc mycancel.c -o /usr/contrib/bin/mycancel
chown root:sys /usr/contrib/bin/mycancel
chmod ug+s /usr/contrib/bin/mycancel
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2000 07:08 AM
10-24-2000 07:08 AM
Re: script question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2000 07:28 AM
10-24-2000 07:28 AM
Re: script question
If -orc option run sucesfully to you, reacreate printers is not a great problem.
Fisrt, do a tar cvf /tmp/printers /etc/lp/interface
Write a script to remove and recreate printers based on lpstat -v ( printer and device ), for each printer you must generate commands:
lpadmin -x.....
lpadmin -d xxxxx -mdumb printer
enable printer
accept printer
As final step recover printer interfaces ( tar xvf /tmp/printers). Interface files are scripts, so dumb printer will be recover with actual script.
Create a printer for test, and when you procedure run ok, apply to all printers.
CNTRL-C.
If you dont like users break your shell do:
trap ' ' 2.
This will avoid treatement of INTR signal.