Hi!

----

Another bug related to binary variables in ast-ksh.2009-05-05:
The testcase $ ksh93 -c 'compound x ; typeset -b -a x.ar ; i=0 ; while
read -N10 x.ar[i] ; do (( i++ )) ; done </etc/profile ; print -v x' #
does not seem to use base64 encoding for the content of a...@] - instead
it looks like plain C strings.

Example:
-- snip --
$ ksh93 -c 'compound x ; typeset -b -a x.ar ; i=0 ; while read -N10
x.ar[i] ; do (( i++ )) ; done </etc/profile ; print -v
x'                                  
(
        typeset -a -b ar=(
                $'#\n# CDDL H'
                'EADER STAR'
                $'T\n#\n# The '
                'contents o'
                'f this fil'
                'e are subj'
                'ect to the'
                ' terms of '
                $'the\n# Comm'
                'on Develop'
                'ment and D'
                istributio
                'n License '
                '(the "Lice'
                $'nse").\n# Y'
                'ou may not'
                ' use this '
                'file excep'
                't in compl'
                'iance with'
                ' the Licen'
                $'se.\n#\n# Yo'
                'u can obta'
                'in a copy '
                'of the lic'
                'ense at us'
                r/src/OPEN
                SOLARIS.LI
                $'CENSE\n# or'
                ' http://ww'
                w.opensola
                ris.org/os
                /licensing
                $'.\n# See th'
                'e License '
                'for the sp'
                'ecific lan'
                'guage gove'
                'rning perm'
                $'issions\n# '
                'and limita'
                'tions unde'
                'r the Lice'
                $'nse.\n#\n# W'
                'hen distri'
                'buting Cov'
                'ered Code,'
                ' include t'
                'his CDDL H'
                'EADER in e'
                $'ach\n# file'
                ' and inclu'
                'de the Lic'
                'ense file '
                'at usr/src'
                /OPENSOLAR
                IS.LICENSE
                $'.\n# If app'
                'licable, a'
                'dd the fol'
                'lowing bel'
                'ow this CD'
                'DL HEADER,'
                $' with the\n'
                '# fields e'
                'nclosed by'
                ' brackets '
                '"[]" repla'
                'ced with y'
                'our own id'
                $'entifying\n'
                '# informat'
                'ion: Porti'
                'ons Copyri'
                'ght [yyyy]'
                ' [name of '
                'copyright '
                $'owner]\n#\n#'
                ' CDDL HEAD'
                $'ER END\n#\n#'
                ' Copyright'
                ' 2007 Sun '
                Microsyste
                'ms, Inc.  '
                'All rights'
                ' reserved.'
                $'\n# Use is '
                'subject to'
                ' license t'
                $'erms.\n#\n\n#'
                $'ident\t"@(#'
                $')profile\t1'
                $'.21\t07/07/'
                $'26 SMI"\n\n#'
                ' The profi'
                'le that al'
                'l logins g'
                'et before '
                'using thei'
                'r own .pro'
                $'file.\n\ntra'
                $'p ""  2 3\n'
                'export LOG'
                $'NAME PATH\n'
                $'\nif [ "$TE'
                'RM" = "" ]'
                $'\nthen\n\tif '
                $'/bin/i386\n'
                $'\tthen\n\t\tTE'
                RM\=sun-col
                $'or\n\telse\n\t'
                $'\tTERM=sun\n'
                $'\tfi\n\texpor'
                $'t TERM\nfi\n'
                $'\n#\tLogin a'
                'nd -su she'
                'lls get /e'
                tc/profile
                ' services.'
                $'\n#\t-rsh is'
                ' given its'
                ' environme'
                'nt in its '
                $'.profile.\n'
                $'\ncase "$0"'
                $' in\n-sh | '
                '-ksh | -ks'
                'h93 | -jsh'
                $' | -bash)\n'
                $'\n\tif [ ! -'
                'f .hushlog'
                $'in ]\n\tthen'
                $'\n\t\t/usr/sb'
                $'in/quota\n\t'
                $'\t#\tAllow t'
                'he user to'
                ' break the'
                ' Message-O'
                'f-The-Day '
                $'only.\n\t\ttr'
                $'ap "trap \''
                $'\' 2"  2\n\t\t'
                '/bin/cat -'
                's /etc/mot'
                $'d\n\t\ttrap "'
                $'" 2\n\n\t\t/bi'
                $'n/mail -E\n'
                $'\t\tcase $? '
                $'in\n\t\t0) \n\t'
                $'\t\techo "Yo'
                'u have new'
                $' mail."\n\t\t'
                $'  \t;;\n\t\t2)'
                $' \n\t\t\techo '
                '"You have '
                $'mail."\n\t\t '
                $'  \t;;\n\t\tes'
                $'ac\n\tfi\nesa'
                $'c\n\nexport '
                PAGER\=less
                $'\n\n# nearly'
                ' "unlimitt'
                'ed" shell '
                history...
                $'\nHISTFILES'
                IZE\='16384 '
                '; export H'
                ISTFILESIZ
                $'E\nHISTSIZE'
                '=16384    '
                ' ; export '
                $'HISTSIZE\n\n'
                '# move tem'
                'p user fil'
                'es to subd'
                'ir in /tmp'
                $'\nexport TM'
                PDIR\='"/tmp'
                '/${LOGNAME'
                $'}"\nmkdir -'
                'p "${TMPDI'
                'R}" 2>/dev'
                $'/null\n\nPAT'
                H\=/opt/onb
                ld/bin:/op
                t/SUNWspro
                /bin:/usr/
                ccs/bin:/u
                sr/dt/bin:
                /usr/openw
                in/bin:/us
                r/sfw/bin:
                /usr/local
                /bin:/usr/
                sbin:/usr/
                $'bin\nMANPAT'
                H\='"$(sep="'
                '" ; echo "'
                '$PATH" | t'
                'r ":" "\n"'
                ' | while r'
                'ead i ; do'
                ' i="$(dirn'
                'ame "$i")"'
                ' ; [ -d "$'
                '{i}/man" ]'
                ' && printf'
                ' "%s%s" "$'
                'sep" "$i/m'
                'an" ; sep='
                '":" ; done'
                $')"\nexport '
                'PATH MANPA'
                $'TH\n\numask '
                $'022\ntrap  '
                ''
        )
)
-- snip --

AFAIK the expected behaviour would be that all the strings are base64
encoded, right ?

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to