<?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 Disabling SET-ID error with a C - wrapper in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/disabling-set-id-error-with-a-c-wrapper/m-p/2868997#M97910</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I obtained the following error when running a PERL script which takes an a text input file as its argument.&lt;BR /&gt;However, when executing the PERL script, the error message is obtained:&lt;BR /&gt;&lt;BR /&gt;YOU HAVEN'T DISABLED SET-ID SCRIPTS IN THE KERNEL YET!FIX YOUR KERNEL, PUT A C WRAPPER AROUND THIS SCRIPT, OR USE -u AND UNDUMP!&lt;BR /&gt;&lt;BR /&gt;None of the outputs written in the original PERL script produced this output. &lt;BR /&gt;&lt;BR /&gt;I have cheked that no SGID, SUID and sticky bits set within the filesystem which this script resides. &lt;BR /&gt;&lt;BR /&gt;I tried writting a C wrapper function for the sake of trying it out. It goes as follows:&lt;BR /&gt;&lt;BR /&gt;#include&lt;UNISTD.H&gt;&lt;BR /&gt;#include&lt;STDIO.H&gt;&lt;BR /&gt;#include&lt;ERRNO.H&gt;&lt;BR /&gt;#include&lt;STDLIB.H&gt;&lt;BR /&gt;#include&lt;STRING.H&gt;&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char* argv[]){&lt;BR /&gt;   char ** myArray = (char**)malloc(10);&lt;BR /&gt;   myArray[0]=(char*)malloc(50);&lt;BR /&gt;   myArray[1]=(char*)malloc(50);&lt;BR /&gt;   myArray[2]=NULL;&lt;BR /&gt;&lt;BR /&gt;   strcpy(myArray[0], "/pgadm1/adm/cleaw/script/read.pl");&lt;BR /&gt;   strcpy(a[1], "/pgadm1/adm/cleaw/script/tt");&lt;BR /&gt;   execv("/pgadm1/adm/cleaw/script/read.pl", a);&lt;BR /&gt;   perror("execv");&lt;BR /&gt;   exit(1);&lt;BR /&gt;}   &lt;BR /&gt;&lt;BR /&gt;The PERL script is a very elementary script:&lt;BR /&gt;#!/usr/bin/intel/perl&lt;BR /&gt;if(scalar @ARGV ==0){&lt;BR /&gt;   print "Usage $0 &lt;PATTERN file=""&gt;"&lt;BR /&gt;   exit(1); &lt;BR /&gt;}&lt;BR /&gt;$file = shift(@ARGV);&lt;BR /&gt;chomp($file);&lt;BR /&gt;$contents = `head -1 $file`;&lt;BR /&gt;print "\$contents = $contents \n";&lt;BR /&gt; &lt;BR /&gt;The text file is as follows:&lt;BR /&gt;#cat pattern_file.txt&lt;BR /&gt;Hi this is a test&lt;BR /&gt;Bye&lt;BR /&gt;&lt;BR /&gt;There is not SGID, SUID or sticky bit even set on the input file. All files have been set to permission mode 755. &lt;BR /&gt;&lt;BR /&gt;Could anyone help me out with this problem? &lt;BR /&gt;Or is there anything wrong with the wrapper code which I'm unaware of?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;  &lt;BR /&gt;&lt;/PATTERN&gt;&lt;/STRING.H&gt;&lt;/STDLIB.H&gt;&lt;/ERRNO.H&gt;&lt;/STDIO.H&gt;&lt;/UNISTD.H&gt;</description>
    <pubDate>Sat, 21 Dec 2002 08:21:35 GMT</pubDate>
    <dc:creator>Chern Jian Leaw</dc:creator>
    <dc:date>2002-12-21T08:21:35Z</dc:date>
    <item>
      <title>Disabling SET-ID error with a C - wrapper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disabling-set-id-error-with-a-c-wrapper/m-p/2868997#M97910</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I obtained the following error when running a PERL script which takes an a text input file as its argument.&lt;BR /&gt;However, when executing the PERL script, the error message is obtained:&lt;BR /&gt;&lt;BR /&gt;YOU HAVEN'T DISABLED SET-ID SCRIPTS IN THE KERNEL YET!FIX YOUR KERNEL, PUT A C WRAPPER AROUND THIS SCRIPT, OR USE -u AND UNDUMP!&lt;BR /&gt;&lt;BR /&gt;None of the outputs written in the original PERL script produced this output. &lt;BR /&gt;&lt;BR /&gt;I have cheked that no SGID, SUID and sticky bits set within the filesystem which this script resides. &lt;BR /&gt;&lt;BR /&gt;I tried writting a C wrapper function for the sake of trying it out. It goes as follows:&lt;BR /&gt;&lt;BR /&gt;#include&lt;UNISTD.H&gt;&lt;BR /&gt;#include&lt;STDIO.H&gt;&lt;BR /&gt;#include&lt;ERRNO.H&gt;&lt;BR /&gt;#include&lt;STDLIB.H&gt;&lt;BR /&gt;#include&lt;STRING.H&gt;&lt;BR /&gt;&lt;BR /&gt;int main(int argc, char* argv[]){&lt;BR /&gt;   char ** myArray = (char**)malloc(10);&lt;BR /&gt;   myArray[0]=(char*)malloc(50);&lt;BR /&gt;   myArray[1]=(char*)malloc(50);&lt;BR /&gt;   myArray[2]=NULL;&lt;BR /&gt;&lt;BR /&gt;   strcpy(myArray[0], "/pgadm1/adm/cleaw/script/read.pl");&lt;BR /&gt;   strcpy(a[1], "/pgadm1/adm/cleaw/script/tt");&lt;BR /&gt;   execv("/pgadm1/adm/cleaw/script/read.pl", a);&lt;BR /&gt;   perror("execv");&lt;BR /&gt;   exit(1);&lt;BR /&gt;}   &lt;BR /&gt;&lt;BR /&gt;The PERL script is a very elementary script:&lt;BR /&gt;#!/usr/bin/intel/perl&lt;BR /&gt;if(scalar @ARGV ==0){&lt;BR /&gt;   print "Usage $0 &lt;PATTERN file=""&gt;"&lt;BR /&gt;   exit(1); &lt;BR /&gt;}&lt;BR /&gt;$file = shift(@ARGV);&lt;BR /&gt;chomp($file);&lt;BR /&gt;$contents = `head -1 $file`;&lt;BR /&gt;print "\$contents = $contents \n";&lt;BR /&gt; &lt;BR /&gt;The text file is as follows:&lt;BR /&gt;#cat pattern_file.txt&lt;BR /&gt;Hi this is a test&lt;BR /&gt;Bye&lt;BR /&gt;&lt;BR /&gt;There is not SGID, SUID or sticky bit even set on the input file. All files have been set to permission mode 755. &lt;BR /&gt;&lt;BR /&gt;Could anyone help me out with this problem? &lt;BR /&gt;Or is there anything wrong with the wrapper code which I'm unaware of?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;  &lt;BR /&gt;&lt;/PATTERN&gt;&lt;/STRING.H&gt;&lt;/STDLIB.H&gt;&lt;/ERRNO.H&gt;&lt;/STDIO.H&gt;&lt;/UNISTD.H&gt;</description>
      <pubDate>Sat, 21 Dec 2002 08:21:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disabling-set-id-error-with-a-c-wrapper/m-p/2868997#M97910</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-12-21T08:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Disabling SET-ID error with a C - wrapper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/disabling-set-id-error-with-a-c-wrapper/m-p/2868998#M97911</link>
      <description>The message:&lt;BR /&gt;&lt;BR /&gt;YOU HAVEN'T DISABLED SET-ID SCRIPTS IN THE KERNEL YET!FIX YOUR KERNEL, PUT A C WRAPPER AROUND THIS SCRIPT, OR USE -u AND UNDUMP! &lt;BR /&gt;&lt;BR /&gt;is not part of HP-UX. Apparently, someone has put some sort of security package on your system which is interfering with your project. HP-UX can disable the execution of setUID programs and scripts with options to mount points such as /tmp and /home. However, if you were to disable setUID capability completely, you would never be able to login and many important programs will no longer run.</description>
      <pubDate>Sat, 21 Dec 2002 14:29:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/disabling-set-id-error-with-a-c-wrapper/m-p/2868998#M97911</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2002-12-21T14:29:10Z</dc:date>
    </item>
  </channel>
</rss>

