Page 1 of 1

Weird scripts behavior/output on some F6xxx

Posted: Tue Nov 26, 2013 2:49 pm
by juusso
While checking SamyGO Extensions on F series, we got problem. If script is started normally from rcSGO (rcSGO -> /etc/rc.local -> 04_04_samba.init start), then we don`t get shares listed because smbclient returns empty list of shares. To troubleshoot problem we call just only smbclient binary (via script trough console). The output is...:

Code: Select all

]]=NAME-RESOLVE-ORDER]=HOST]=IP]]=HOST]=LEVEL]=<c|x>IXFqgbNan]=DIR]=STRING]=BYTES]=PORT]]]=DEBUGLEVEL]=CONFIGFILE]=LOGFILEBASE]]=SOCKETOPTIONS]=NETBIOSNAME]=WORKGROUP]=SCOPE]=USERNAME]]]=FILE]=on|off|required]]]]
werd, right?
Then same script is called from web interface (test.cgi). Now everything goes smoothly, shares listed and mounted. Same script gives the output:

Code: Select all

Usage: smbclient [-?EgBVNkPeC] [-?|--help] [--usage]
        [-R|--name-resolve=NAME-RESOLVE-ORDER] [-M|--message=HOST]
        [-I|--ip-address=IP] [-E|--stderr] [-L|--list=HOST]
        [-m|--max-protocol=LEVEL] [-T|--tar=<c|x>IXFqgbNan]
        [-D|--directory=DIR] [-c|--command=STRING] [-b|--send-buffer=BYTES]
        [-p|--port=PORT] [-g|--grepable] [-B|--browse]
        [-d|--debuglevel=DEBUGLEVEL] [-s|--configfile=CONFIGFILE]
        [-l|--log-basename=LOGFILEBASE] [-V|--version]
        [-O|--socket-options=SOCKETOPTIONS] [-n|--netbiosname=NETBIOSNAME]
        [-W|--workgroup=WORKGROUP] [-i|--scope=SCOPE] [-U|--user=USERNAME]
        [-N|--no-pass] [-k|--kerberos] [-A|--authentication-file=FILE]
        [-S|--signing=on|off|required] [-P|--machine-pass] [-e|--encrypt]
        [-C|--use-ccache] service <password>
Looks like normal start of binary w/o arguments.

The general question: why same binary/script gives so different output in two different ways it was being started?
From shell - weird characters
From cgi script - normal, like it should be.

I suspect some environment variables, no idea where to check. Like shell output is filtered or so. ARS_module is unloaded, by the way.

With nfs mounts -same problem - showmounts doesn`t return correct values if started from rcSGO, but works well if started manually via web interface.

Re: Weird smbclient output on some F6xxx

Posted: Tue Nov 26, 2013 3:06 pm
by bugficks
i think ive found it :)
04_04_samba.init has a utf BOM header, u8-unix. check w/ hex editor

Re: Weird scripts behavior/output on some F6xxx

Posted: Tue Nov 26, 2013 3:08 pm
by juusso
:shock:

Re: Weird scripts behavior/output on some F6xxx

Posted: Tue Nov 26, 2013 3:30 pm
by juusso
too simple to be truth. Checked twice, fixed header (conver to ANSI, was UTF without BOM), but result is same:

Code: Select all

]]=NAME-RESOLVE-ORDER]=HOST]=IP]]=HOST]=LEVEL]=<c|x>IXFqgbNan]=DIR]=STRING]=BYTES]=PORT]]]=DEBUGLEVEL]=CONFIGFILE]=LOGFILEBASE]]=SOCKETOPTIONS]=NETBIOSNAME]=WORKGROUP]=SCOPE]=USERNAME]]]=FILE]=on|off|required]]]]
creating lame upcase table
creating lame lowcase table
]]=NAME-RESOLVE-ORDER]=HOST]=IP]]=HOST]=LEVEL]=<c|x>IXFqgbNan]=DIR]=STRING]=BYTES]=PORT]]]=DEBUGLEVEL]=CONFIGFILE]=LOGFILEBASE]]=SOCKETOPTIONS]=NETBIOSNAME]=WORKGROUP]=SCOPE]=USERNAME]]]=FILE]=on|off|required]]]]
creating lame upcase table
creating lame lowcase table
]]=NAME-RESOLVE-ORDER]=HOST]=IP]]=HOST]=LEVEL]=<c|x>IXFqgbNan]=DIR]=STRING]=BYTES]=PORT]]]=DEBUGLEVEL]=CONFIGFILE]=LOGFILEBASE]]=SOCKETOPTIONS]=NETBIOSNAME]=WORKGROUP]=SCOPE]=USERNAME]]]=FILE]=on|off|required]]]]

Re: Weird scripts behavior/output on some F6xxx

Posted: Tue Nov 26, 2013 3:37 pm
by bugficks
hmm, well how about logging env from both processes and compare them? set > /log/file
does this problem start w/ a certain fw?

Re: Weird scripts behavior/output on some F6xxx

Posted: Tue Nov 26, 2013 3:41 pm
by juusso
F6400, F6800, firmware T-MST12DEUC-1109, both have same issue.
Aso F5300, firmware T-MST12DEUC-1104. Grr... :x

Re: Weird scripts behavior/output on some F6xxx

Posted: Tue Nov 26, 2013 4:07 pm
by juusso
In general: what the difference between to lauch the same script:
1. from another script
2. from cgi page via http

i think result should be same, because: script is same, binaries are same. Everything is same except how do we call that script. In our case result is not same...
I even compiled lame (cmd line web client), and tried to lauch our script via cmd line. Guess what - nothing. Nothing changed. That`s why i guess something is werird with console/shell/env variables.


p.s. maybe this issue is related to recent samsung`s changes against SamyGO: firmware update for E series, which blocks SamyGO and does funy tricks with virtUSB (arris said, he can`t play video files, mounted on vusb anymore. Just photo and music files...)?, now - crazy shell scripts... :idea:

Re: Weird scripts behavior/output on some F6xxx

Posted: Tue Nov 26, 2013 4:21 pm
by zoelechat
juuso wrote:p.s. maybe this issue is related to recent samsung`s changes against SamyGO: firmware update for E series, which blocks SamyGO and does funy tricks with virtUSB (arris said, he can`t play video files, mounted on vusb anymore. Just photo and music files...)?, now - crazy shell scripts... :idea:
Just to notice that I'm using latest MST10PDEUC(1040.2) on my E and I've no such issues. In fact I even don't see any difference at any level with previous(1032.0) I finally updated.

Re: Weird scripts behavior/output on some F6xxx

Posted: Wed Nov 27, 2013 12:04 pm
by bugficks
smb works for me. shares are mounted and accessible. cant easily test nfs

Code: Select all

/mnt/etc/init.d/04_04_samba.init stop
/mnt/etc/init.d/04_04_samba.init start
insmod: can't insert '/mnt/lib/modules/3.0.33/kernel/fs/cifs/cifs.ko': File exists
Search Shares
on: 192.168.1.1
creating lame upcase table
creating lame lowcase table
on: 192.168.1.25
creating lame upcase table
creating lame lowcase table
Domain=[BLUBBOOK] OS=[Windows 7 Home Premium 7601 Service Pack 1] Server=[Windows 7 Home Premium 6.1]