<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: script question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456954#M12829</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;so you have to set root capabilties (but i think this could be a security risk):&lt;BR /&gt;main(argc, argv) &lt;BR /&gt;int argc; &lt;BR /&gt;char **argv; &lt;BR /&gt;{ &lt;BR /&gt;  setuid(0);                                    setgid(3); &lt;BR /&gt;  execvp("/usr/bin/cancel", argv); &lt;BR /&gt;} &lt;BR /&gt;Compile ie: &lt;BR /&gt;cc mycancel.c -o /usr/contrib/bin/mycancel &lt;BR /&gt;chown root:sys /usr/contrib/bin/mycancel &lt;BR /&gt;chmod ug+s /usr/contrib/bin/mycancel &lt;BR /&gt;&lt;BR /&gt;Regards</description>
    <pubDate>Tue, 24 Oct 2000 08:26:15 GMT</pubDate>
    <dc:creator>Andreas Voss</dc:creator>
    <dc:date>2000-10-24T08:26:15Z</dc:date>
    <item>
      <title>script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456947#M12822</link>
      <description>1. Writing script to cancel print jobs. This script will cancel all the users print jobs. &lt;BR /&gt;    this will be executed by the particular user. Can Anyone through how can I &lt;BR /&gt;   achieve this. I tried suid option (chmod 4711 file). still have problem?&lt;BR /&gt;&lt;BR /&gt;2. While running a script, user could not able to use ctrl+c or any other command &lt;BR /&gt;   to get unix prompt. If any interruption occurs, it should go back to previous menu.&lt;BR /&gt;&lt;BR /&gt;Pls help me.</description>
      <pubDate>Tue, 24 Oct 2000 07:47:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456947#M12822</guid>
      <dc:creator>Madanagopalan S</dc:creator>
      <dc:date>2000-10-24T07:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456948#M12823</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;when using suid/sgid on shell scripts you must have at the first line (example posix-shell):&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;To prevent exiting the script by CTRL-C do:&lt;BR /&gt;trap "echo break" 2&lt;BR /&gt;(make sure you have an input option to leave the script)&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Tue, 24 Oct 2000 07:52:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456948#M12823</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2000-10-24T07:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456949#M12824</link>
      <description>I tried the same. but its still saying " must have root capability to use this option" for cancel command. How can I do it for C program.</description>
      <pubDate>Tue, 24 Oct 2000 07:58:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456949#M12824</guid>
      <dc:creator>Madanagopalan S</dc:creator>
      <dc:date>2000-10-24T07:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456950#M12825</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Oct 2000 08:07:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456950#M12825</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-10-24T08:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456951#M12826</link>
      <description>I can't recreate the print queues since nearly more than 20 queues are there&lt;BR /&gt;and the machine is in production now.</description>
      <pubDate>Tue, 24 Oct 2000 08:10:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456951#M12826</guid>
      <dc:creator>Madanagopalan S</dc:creator>
      <dc:date>2000-10-24T08:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456952#M12827</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;here an example c source:&lt;BR /&gt;main(argc, argv)&lt;BR /&gt;int    argc;&lt;BR /&gt;char **argv;&lt;BR /&gt;{&lt;BR /&gt;  setuid(9);&lt;BR /&gt;  setgid(7);&lt;BR /&gt;  execvp("/usr/bin/cancel", argv);&lt;BR /&gt;}&lt;BR /&gt;Compile ie:&lt;BR /&gt;cc mycancel.c -o /usr/contrib/bin/mycancel&lt;BR /&gt;chown lp:lp /usr/contrib/bin/mycancel&lt;BR /&gt;chmod ug+s /usr/contrib/bin/mycancel&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Tue, 24 Oct 2000 08:12:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456952#M12827</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2000-10-24T08:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456953#M12828</link>
      <description>Andreas voss, &lt;BR /&gt;&lt;BR /&gt;      I can't able to use the '-e' option. other thing is working fine. What could &lt;BR /&gt;be the problem</description>
      <pubDate>Tue, 24 Oct 2000 08:22:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456953#M12828</guid>
      <dc:creator>Madanagopalan S</dc:creator>
      <dc:date>2000-10-24T08:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456954#M12829</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;so you have to set root capabilties (but i think this could be a security risk):&lt;BR /&gt;main(argc, argv) &lt;BR /&gt;int argc; &lt;BR /&gt;char **argv; &lt;BR /&gt;{ &lt;BR /&gt;  setuid(0);                                    setgid(3); &lt;BR /&gt;  execvp("/usr/bin/cancel", argv); &lt;BR /&gt;} &lt;BR /&gt;Compile ie: &lt;BR /&gt;cc mycancel.c -o /usr/contrib/bin/mycancel &lt;BR /&gt;chown root:sys /usr/contrib/bin/mycancel &lt;BR /&gt;chmod ug+s /usr/contrib/bin/mycancel &lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Tue, 24 Oct 2000 08:26:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456954#M12829</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2000-10-24T08:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456955#M12830</link>
      <description>Am I missing something?  Isn't this exactly what the command "cancel -a" is designed to do?  A user always has the ability to cancel his own print jobs, and teh -a flag tells cancel to stop all jobs to any printer owned by the login user.&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Oct 2000 14:08:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456955#M12830</guid>
      <dc:creator>Alan Riggs</dc:creator>
      <dc:date>2000-10-24T14:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: script question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456956#M12831</link>
      <description>&lt;BR /&gt;If -orc option run sucesfully to you, reacreate printers is not a great problem.&lt;BR /&gt;&lt;BR /&gt;Fisrt, do a tar cvf /tmp/printers /etc/lp/interface&lt;BR /&gt;&lt;BR /&gt;Write a script to remove and recreate printers based on lpstat -v ( printer and device ), for each printer you must generate commands:&lt;BR /&gt;&lt;BR /&gt;lpadmin -x.....&lt;BR /&gt;lpadmin -d xxxxx -mdumb printer&lt;BR /&gt;enable printer&lt;BR /&gt;accept printer&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;As final step recover printer interfaces ( tar xvf /tmp/printers).  Interface files are scripts, so dumb printer will be recover with actual script.&lt;BR /&gt;&lt;BR /&gt;Create a printer for test, and when you procedure run ok, apply to all printers.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;CNTRL-C.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If you dont like users  break your shell do: &lt;BR /&gt;trap ' ' 2.&lt;BR /&gt;This will avoid treatement of INTR signal.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Oct 2000 14:28:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-question/m-p/2456956#M12831</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2000-10-24T14:28:19Z</dc:date>
    </item>
  </channel>
</rss>

