Hello,
However, it looks like an internal problem of /bin/sh. Try running
/bin/sh -x ./install.sh /home/slist
This lists every command before it is executed (with variables expanded). Maybe it gives some more insight.
thanks for your help, now I ended up with ... + 4<& 0 + ../src/setid root + 0< install.sh2 /bin/sh[11]: 4: 0403-007 Generated or received a file descriptor number that is not valid. + exit 1 ... But why not use another shell ?! I tried the same with ksh - no succes, after that I used bash and there were no problems! I'm on an AIX 4.3.2, on Solaris 2.7 x86 it worked also with /bin/sh, maybe it's a problem with the AIX sh ?! So I will force the use of bash ... In bash the output starts with: ... + exec + ../src/setid root ... instead of the +4<& 0. Regards, Carsten ================================================== == == Dipl.-Ing. Carsten Karkola == == TU Dresden - Fak.Bauingenieurwesen - FRZ == == Tel.: +49 351 463 3659 == Fax: +49 351 463 7766 == e-mail: carsten.karkola@mailbox.tu-dresden.de == ==================================================
"Carsten" == Carsten Karkola <carsten.karkola@mailbox.tu-dresden.de> writes:
Carsten> Hello, >> However, it looks like an internal problem of /bin/sh. >> Try running >> >> /bin/sh -x ./install.sh /home/slist >> >> This lists every command before it is executed (with >> variables expanded). Maybe it gives some more insight. Carsten> thanks for your help, now I ended up with Carsten> ... Carsten> + 4<& 0 Carsten> + ../src/setid root Carsten> + 0< install.sh2 Carsten> /bin/sh[11]: 4: 0403-007 Generated or received a Carsten> file descriptor number that is not valid. Carsten> + exit 1 ... Carsten> But why not use another shell ?! [...] Carsten> maybe it's a problem with the AIX sh ?! So I will force Carsten> the use of bash ... In bash the output starts with: Carsten> ... Carsten> + exec Carsten> + ../src/setid root Carsten> ... Carsten> instead of the +4<& 0. Yes, that sounds like sh and ksh have a problem with the "exec 4<& 0" in install.sh. Hmm, that means "open a new file descriptor (fd) number 4 and connect it to fd 0". I can imagine that having two fds reading from the same stream confuses the shell, especially if one of them is stdin (fd 0). Maybe it even cannot process this special variant of the exec instruction. Does anyone know the reason for this input redirection, BTW? Hans-Albert -- Hans-Albert Schneider <Hans-Albert.Schneider@mchp.siemens.de> Siemens AG phone: (+49) 89 636 45445 Corporate Technology fax: (+49) 89 636 42284 Munich, Germany -- To get my public PGP key, send me a mail with subject "send key" --
Hans-Albert Schneider <Hans-Albert.Schneider@mchp.siemens.de> writes:
"Carsten" == Carsten Karkola <carsten.karkola@mailbox.tu-dresden.de> writes: ... Carsten> thanks for your help, now I ended up with Carsten> ... Carsten> + 4<& 0 Carsten> + ../src/setid root Carsten> + 0< install.sh2 Carsten> /bin/sh[11]: 4: 0403-007 Generated or received a Carsten> file descriptor number that is not valid. Carsten> + exit 1 ... ... Yes, that sounds like sh and ksh have a problem with the "exec 4<& 0" in install.sh.
Actually, I don't think its the "exec 4<&0" that's the problem...
Hmm, that means "open a new file descriptor (fd) number 4 and connect it to fd 0". I can imagine that having two fds reading from the same stream confuses the shell, especially if one of them is stdin (fd 0). Maybe it even cannot process this special variant of the exec instruction.
If that was true, then the n<&m redirection format would be completely useless. That's certainly not true for ksh. Checking a copy of the manpage for the newest ksh from AT&T Labs, I see that redirections to file descriptors greater than 2 are set to be close-on-exec. That would explain it because then the shell invoked by setid would find fd 4 closed.
Does anyone know the reason for this input redirection, BTW?
The install.sh2 script needs the original stdin, while setid takes the script to be invoked as the other user on its stdin. Carsten, can you try changing the install.sh file around the setid invocations from: exec 4<&0 case $installerid in [0-9]*) . ./install.sh2 ;; *) $setid $installerid <install.sh2 || exit 1;; esac $setid $listid $target <install.sh3 || exit 64 exec 4<&- to: case $installerid in [0-9]*) . ./install.sh2 4<&0 ;; *) $setid $installerid 4<&0 <install.sh2 || exit 1;; esac $setid $listid $target 4<&0 <install.sh3 || exit 64 and then try it again under AIX or with ksh, whichever shell made it fail before? Philip Guenther
An: Hans-Albert.Schneider@mchp.siemens.de Durchschläge an: Carsten Karkola <carsten.karkola@mailbox.tu-dresden.de>, smartlist@Lists.RWTH-Aachen.DE Betreff: Re: Installation problem running install.sh Datum: Fri, 20 Jul 2001 19:59:50 -0500 Von: Philip Guenther <guenther@gac.edu> I have changed the install.sh with your replacement:
to: case $installerid in [0-9]*) . ./install.sh2 4<&0 ;; *) $setid $installerid 4<&0 <install.sh2 || exit 1;; esac $setid $listid $target 4<&0 <install.sh3 || exit 64
... and it works fine under AIX, many thanks! Regards, Carsten ================================================== == == Dipl.-Ing. Carsten Karkola == == TU Dresden - Fak.Bauingenieurwesen - FRZ == == Tel.: +49 351 463 3659 == Fax: +49 351 463 7766 == e-mail: carsten.karkola@mailbox.tu-dresden.de == ==================================================
Does anyone out there have a recipe just to reject messages that have an attachment? --DK
Carsten Karkola <carsten.karkola@mailbox.tu-dresden.de> writes: ...
I have changed the install.sh with your replacement:
to: case $installerid in [0-9]*) . ./install.sh2 4<&0 ;; *) $setid $installerid 4<&0 <install.sh2 || exit 1;; esac $setid $listid $target 4<&0 <install.sh3 || exit 64
... and it works fine under AIX, many thanks!
Cool. That fix will be included in the next version of SmartList. Philip Guenther
participants (4)
-
Carsten Karkola
-
David Kelly
-
Hans-Albert Schneider
-
Philip Guenther