Mysterious error message: the string sent to system()

mcferrin at inuxc.UUCP mcferrin at inuxc.UUCP
Sun Nov 23 17:56:36 AEST 1986


> []
> In case anyone wants to know what the string I was sending to system(),
> it certainly wasn't anything out of the ordinary.
> I was sending either "chmod 666 <full-path-file-name>" or
> "email <full-path-file-name>". "email" is a program I've written.
> With either string, I got the error message "00: is not an identifier"
> from system(), but the same string worked fine if I typed it myself.
> Also, this is a 4.3BSD microVAX, but I don't think that it matters so
> much either. I've even taken a peek at the BSD sources to try and see
> where/how the error is generated, but I didn't have any luck.
> 
> -- 
> --==---==---==--
> .. And hast thou slain the Jabberwock? ..
> 
> ARPA: don at umd5.UMD.EDU     BITNET: don%umd5 at umd2
> UUCP: ..!seismo!umd5.umd.edu!don

I have experienced this problem in SYS-V.  My problem had NOTHING to
do with the "string" passed to system().  System() envokes the shell
with the "-c string" format.  During shell initialization, the enviornment
variables are processed and enter into a internal list used by the
shell.  I have seen cases where a programmer did not allow room for
the null byte and subsequently clobber the 1st byte of the next VARIABLE
name, not its value.  So make sure that you are not clobbering your
enviornment variables (**environ)

The one I usually ran into was LOGNAME.  Sometimes someone would allow
8 bytes for its value and since my LOGNAME was 8 characters, various
programs would fail on me and not other users.

				Paul McFerrin
				AT&T-IS Consumer Products Division
				Indianapolis, Ind.



More information about the Comp.unix.questions mailing list