WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Is findshares open source?  (Read 8744 times)

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5270
Re: Is findshares open source?
« Reply #45 on: October 08, 2014, 03:58:00 PM »
Hi ko
Thank you for your patience and working with me on this. I glad we were able to resolve this to everyones satisfaction.

Offline ko

  • WikiUser
  • *
  • Posts: 8
Re: Is findshares open source?
« Reply #46 on: October 08, 2014, 10:31:28 PM »
Thanks Rich!

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5270
Re: Is findshares open source?
« Reply #47 on: October 09, 2014, 05:01:47 AM »
Hi ko
You are welcome.

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5270
Re: Is findshares open source?
« Reply #48 on: February 12, 2015, 07:20:06 PM »
If anyone is interested version 1.07 of findshares has been posted in the TC4, 5, and 6 repositories.
Changes from version 1.05:

     Scans all configured network interfaces found up to a maximum of 16 interfaces.

     Error messages now default to off. Use  --debug  to enable them.

     Added message to indicate if no shares were found.

     Stripped executable harder using sstrip. Extension size reduced from 12K to 8K. Executable reduced from 15200 bytes to 13928.
« Last Edit: February 12, 2015, 07:22:58 PM by Rich »

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1444
Re: Is findshares open source?
« Reply #49 on: July 22, 2016, 03:34:02 AM »
Hi Rich

findshares  fails if using a 3G modem connection for internet (ppp0) in conjunction with ethernet for LAN (eth0).

TC-7.2 x86

eth0 and ppp0 active:
Code: [Select]
$ findshares
findshares version 1.07 Feb 9, 2015
Copyright Richard A. Rost April 23, 2011

Local Host Name  = box

Scanning from  on
Network is unreachable: Error line 1097

eth0 only:
Code: [Select]
$ findshares
findshares version 1.07 Feb 9, 2015
Copyright Richard A. Rost April 23, 2011

Local Host Name  = box
Local IP Address = 192.168.0.1 on eth0

Scanning from 192.168.0.1 on eth0
Samba/Windows Shares
--------------------------------------------------------------------------------
WORKGROUP
    BOX              192.168.0.1       Samba Server
IPC$                           IPC Service (Samba Server)

Cheers
Download a copy and keep it handy: Core book ;)

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5270
Re: Is findshares open source?
« Reply #50 on: July 22, 2016, 09:22:10 AM »
Hi Misalf
Attached is the source package. Compile it by running the  compilefindshares  script. Let me know if it's fixed.
« Last Edit: July 23, 2016, 10:20:50 PM by Rich »

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1444
Re: Is findshares open source?
« Reply #51 on: July 22, 2016, 09:58:49 AM »
Hi Rich
Not fixed.
Code: [Select]
#!/bin/sh  ::  Tiny Core 7.2  ::  Linux 4.2.9-tinycore

19:55:05 tc@box:/tmp/findshares-v1.08/$ > ./compilefindshares
In file included from packetdata.h:10:0,
                 from findshares.c:67:
netrshareenum.h:47:31: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   .bytecount=10, .Filename[0]="\\srvsvc" };
                               ^
netrshareenum.h:47:31: note: (near initialization for ‘NTcreate.Filename[0]’)
netrshareenum.h:47:31: error: initializer element is not computable at load time
netrshareenum.h:47:31: note: (near initialization for ‘NTcreate.Filename[0]’)
In file included from findshares.c:67:0:
packetdata.h:63:14: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   .string[0]="NT LM 0.12" };
              ^
packetdata.h:63:14: note: (near initialization for ‘protocol.string[0]’)
packetdata.h:63:14: error: initializer element is not computable at load time
packetdata.h:63:14: note: (near initialization for ‘protocol.string[0]’)
packetdata.h:102:61: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   .ansipasswordlen=1, .capabilities=0x00000203, .strings[0]="Guest" };
                                                             ^
packetdata.h:102:61: note: (near initialization for ‘setup.strings[0]’)
packetdata.h:102:61: error: initializer element is not computable at load time
packetdata.h:102:61: note: (near initialization for ‘setup.strings[0]’)
packetdata.h:134:65: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   .AndXCommand=0xFF, .passwordlen=1, .bytecount=32, .strings[0]="\\\\" };
                                                                 ^
packetdata.h:134:65: note: (near initialization for ‘treeconn.strings[0]’)
packetdata.h:134:65: error: initializer element is not computable at load time
packetdata.h:134:65: note: (near initialization for ‘treeconn.strings[0]’)
findshares.c: In function ‘EnumShares’:
findshares.c:464:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  setup.sessionkey=*(uint64_t*)&rxbuffer[52];
  ^
findshares.c:491:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  treeconn.uid=*(uint16_t*)&rxbuffer[32];
  ^
findshares.c:507:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   NTcreate.tid=*(uint16_t*)&rxbuffer[28]; // Tree ID
   ^
findshares.c:509:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   NTcreate.uid=*(uint16_t*)&rxbuffer[32]; // User ID
   ^
findshares.c:513:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   RPCbind.tid=*(uint16_t*)&rxbuffer[28]; // Tree ID
   ^
findshares.c:515:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   RPCbind.uid=*(uint16_t*)&rxbuffer[32]; // User ID
   ^
findshares.c:516:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   RPCbind.FID=*(uint16_t*)&rxbuffer[42]; // File ID
   ^
findshares.c:522:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   NetrShareEnum.tid=*(uint16_t*)&rxbuffer[28]; // Tree ID
   ^
findshares.c:524:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   NetrShareEnum.uid=*(uint16_t*)&rxbuffer[32]; // User ID
   ^
findshares.c:584:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   enumshares.tid=*(uint16_t*)&rxbuffer[28]; // Tree ID
   ^
findshares.c:586:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   enumshares.uid=*(uint16_t*)&rxbuffer[32]; // User ID
   ^
findshares.c:619:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  netservergetinfo.tid=*(uint16_t*)&rxbuffer[28]; // Tree ID
  ^
findshares.c:621:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  netservergetinfo.uid=*(uint16_t*)&rxbuffer[32]; // User ID
  ^
findshares.c:632:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   enumservers2.tid=*(uint16_t*)&rxbuffer[28]; // Tree ID
   ^
findshares.c:634:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   enumservers2.uid=*(uint16_t*)&rxbuffer[32]; // User ID
   ^
findshares.c: At top level:
findshares.c:948:13: warning: ‘Hexdump’ defined but not used [-Wunused-function]
 static void Hexdump(void *src, int len)
             ^
   text    data     bss     dec     hex filename
  10947    1656      84   12687    318f findshares
-rwxr-xr-x 1 tc staff 15200 Jul 22 19:55 findshares
Code: [Select]
19:55:07 tc@box:/tmp/findshares-v1.08/$ > ./findshares
findshares version 1.08 Jul 22, 2016
Copyright Richard A. Rost April 23, 2011

Local Host Name  = box
19:55:11 tc@box:/tmp/findshares-v1.08/$ > sudo killall pppd
19:55:15 tc@box:/tmp/findshares-v1.08/$ > ./findshares
findshares version 1.08 Jul 22, 2016
Copyright Richard A. Rost April 23, 2011

Local Host Name  = box
Local IP Address = 192.168.0.1 on eth0

Scanning from 192.168.0.1 on eth0
Samba/Windows Shares
--------------------------------------------------------------------------------
WORKGROUP
    BOX              192.168.0.1       Samba Server
IPC$                           IPC Service (Samba Server)


Download a copy and keep it handy: Core book ;)

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5270
Re: Is findshares open source?
« Reply #52 on: July 23, 2016, 10:32:06 PM »
Hi Misalf
Please try again, I updated the attachment in reply #50. I don't know why you are getting all those warnings when you compile.
Maybe the GCC version in Tiny Core 7.2 has extra warnings enabled by default.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1444
Re: Is findshares open source?
« Reply #53 on: July 24, 2016, 03:27:57 AM »
Errors as well.
Code: [Select]
./compilefindshares
In file included from packetdata.h:10:0,
                 from findshares.c:67:
netrshareenum.h:47:31: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   .bytecount=10, .Filename[0]="\\srvsvc" };
                               ^
netrshareenum.h:47:31: note: (near initialization for ‘NTcreate.Filename[0]’)
netrshareenum.h:47:31: error: initializer element is not computable at load time
netrshareenum.h:47:31: note: (near initialization for ‘NTcreate.Filename[0]’)
In file included from findshares.c:67:0:
packetdata.h:63:14: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   .string[0]="NT LM 0.12" };
              ^
packetdata.h:63:14: note: (near initialization for ‘protocol.string[0]’)
packetdata.h:63:14: error: initializer element is not computable at load time
packetdata.h:63:14: note: (near initialization for ‘protocol.string[0]’)
packetdata.h:102:61: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   .ansipasswordlen=1, .capabilities=0x00000203, .strings[0]="Guest" };
                                                             ^
packetdata.h:102:61: note: (near initialization for ‘setup.strings[0]’)
packetdata.h:102:61: error: initializer element is not computable at load time
packetdata.h:102:61: note: (near initialization for ‘setup.strings[0]’)
packetdata.h:134:65: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
   .AndXCommand=0xFF, .passwordlen=1, .bytecount=32, .strings[0]="\\\\" };
                                                                 ^
packetdata.h:134:65: note: (near initialization for ‘treeconn.strings[0]’)
packetdata.h:134:65: error: initializer element is not computable at load time
packetdata.h:134:65: note: (near initialization for ‘treeconn.strings[0]’)
findshares.c: In function ‘EnumShares’:
findshares.c:464:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  setup.sessionkey=*(uint64_t*)&rxbuffer[52];
  ^
findshares.c:491:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  treeconn.uid=*(uint16_t*)&rxbuffer[32];
  ^
findshares.c:507:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   NTcreate.tid=*(uint16_t*)&rxbuffer[28]; // Tree ID
   ^
findshares.c:509:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   NTcreate.uid=*(uint16_t*)&rxbuffer[32]; // User ID
   ^
findshares.c:513:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   RPCbind.tid=*(uint16_t*)&rxbuffer[28]; // Tree ID
   ^
findshares.c:515:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   RPCbind.uid=*(uint16_t*)&rxbuffer[32]; // User ID
   ^
findshares.c:516:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   RPCbind.FID=*(uint16_t*)&rxbuffer[42]; // File ID
   ^
findshares.c:522:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   NetrShareEnum.tid=*(uint16_t*)&rxbuffer[28]; // Tree ID
   ^
findshares.c:524:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   NetrShareEnum.uid=*(uint16_t*)&rxbuffer[32]; // User ID
   ^
findshares.c:584:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   enumshares.tid=*(uint16_t*)&rxbuffer[28]; // Tree ID
   ^
findshares.c:586:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   enumshares.uid=*(uint16_t*)&rxbuffer[32]; // User ID
   ^
findshares.c:619:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  netservergetinfo.tid=*(uint16_t*)&rxbuffer[28]; // Tree ID
  ^
findshares.c:621:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  netservergetinfo.uid=*(uint16_t*)&rxbuffer[32]; // User ID
  ^
findshares.c:632:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   enumservers2.tid=*(uint16_t*)&rxbuffer[28]; // Tree ID
   ^
findshares.c:634:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
   enumservers2.uid=*(uint16_t*)&rxbuffer[32]; // User ID
   ^
findshares.c: At top level:
findshares.c:948:13: warning: ‘Hexdump’ defined but not used [-Wunused-function]
 static void Hexdump(void *src, int len)
             ^
size: 'findshares': No such file
strip: 'findshares': No such file
ls: cannot access findshares: No such file or directory
Any build deps I might need? Currently only compiletc.tcz installed.
Download a copy and keep it handy: Core book ;)

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5270
Re: Is findshares open source?
« Reply #54 on: July 24, 2016, 09:37:03 AM »
Hi Misalf
I'm PMing you a link to download a compiled copy of findshares.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1444
Re: Is findshares open source?
« Reply #55 on: July 24, 2016, 09:54:53 AM »
Thanks.
It still only succeeds if eth0 is the only active connection. Now it also tries to scan ppp0 though.

eth0 + ppp0 = Network is unreachable: Error line 1098
Download a copy and keep it handy: Core book ;)

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5270
Re: Is findshares open source?
« Reply #56 on: July 24, 2016, 10:01:24 AM »
Hi Misalf
Could you post the actual output of findshares please.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1444
Re: Is findshares open source?
« Reply #57 on: July 24, 2016, 10:41:28 AM »
Sure
Code: [Select]
20:38:46 tc@box:~/$ > sudo /usr/local/etc/init.d/samba status

smbd is running.


nmbd is running.

20:38:50 tc@box:~/$ > ifconfig
lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:500 (500.0 B)  TX bytes:500 (500.0 B)

ppp0      Link encap:Point-to-Point Protocol 
          inet addr:10.207.102.154  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:689 errors:0 dropped:0 overruns:0 frame:0
          TX packets:760 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:476113 (464.9 KiB)  TX bytes:84440 (82.4 KiB)

20:38:53 tc@box:~/$ > /tmp/findshares
findshares version 1.08 Jul 24, 2016
Copyright Richard A. Rost April 23, 2011

Local Host Name  = box
Local IP Address = 10.207.102.154 on ppp0

Scanning from 10.207.102.154 on ppp0
No shares found
20:39:01 tc@box:~/$ > sudo /opt/eth0_ics_server_ppp0.sh
#!/bin/sh  ::  Tiny Core 7.2  ::  Linux 4.2.9-tinycore

#!/bin/sh  ::  Tiny Core 7.2  ::  Linux 4.2.9-tinycore

20:39:22 tc@box:~/$ > ifconfig
eth0      Link encap:Ethernet  HWaddr 00:21:85:4D:77:2D 
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:500 (500.0 B)  TX bytes:500 (500.0 B)

ppp0      Link encap:Point-to-Point Protocol 
          inet addr:10.207.102.154  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:689 errors:0 dropped:0 overruns:0 frame:0
          TX packets:762 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:476113 (464.9 KiB)  TX bytes:84602 (82.6 KiB)

20:39:25 tc@box:~/$ > /tmp/findshares
findshares version 1.08 Jul 24, 2016
Copyright Richard A. Rost April 23, 2011

Local Host Name  = box
Local IP Address = 192.168.0.1 on eth0
Local IP Address = 10.207.102.154 on ppp0

Scanning from 10.207.102.154 on ppp0
Network is unreachable: Error line 1098
20:39:29!tc@box:~/$ > sudo killall pppd
20:39:36 tc@box:~/$ > /tmp/findshares
findshares version 1.08 Jul 24, 2016
Copyright Richard A. Rost April 23, 2011

Local Host Name  = box
Local IP Address = 192.168.0.1 on eth0

Scanning from 192.168.0.1 on eth0
Samba/Windows Shares
--------------------------------------------------------------------------------
WORKGROUP
    BOX              192.168.0.1       Samba Server
IPC$                           IPC Service (Samba Server)


Download a copy and keep it handy: Core book ;)

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5270
Re: Is findshares open source?
« Reply #58 on: July 24, 2016, 12:13:41 PM »
Hi Misalf
PMing you a new download link.

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1444
Re: Is findshares open source?
« Reply #59 on: July 24, 2016, 12:20:46 PM »
Hey Rich
This version seems to be good. Thanks!
Download a copy and keep it handy: Core book ;)