WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline Scooby

  • Newbie
  • *
  • Posts: 27
Is findshares open source?
« on: February 24, 2014, 02:58:47 PM »
I wanted to build findshares for arch linux X86_64
and wondered if it was open source?

if so were can it be obtained.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Is findshares open source?
« Reply #1 on: February 24, 2014, 03:02:18 PM »
This is neither a findshares nor an arch linux forum.
Try google.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: Is findshares open source?
« Reply #2 on: February 24, 2014, 08:50:05 PM »
Hi Scooby
Google won't help you. Findshares is something I wrote partly to learn programming in C and partly because I was not happy
with any of the programs available for performing these functions. Source code is attached.

Offline Scooby

  • Newbie
  • *
  • Posts: 27
Re: Is findshares open source?
« Reply #3 on: February 25, 2014, 02:58:04 PM »
much obliged Rich.

Thanks for creating and thanks for sharing

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: Is findshares open source?
« Reply #4 on: February 25, 2014, 03:37:35 PM »
Hi Scooby
You are welcome. Hope a 64 bit compile doesn't break it.

Offline Scooby

  • Newbie
  • *
  • Posts: 27
Re: Is findshares open source?
« Reply #5 on: February 27, 2014, 03:18:08 PM »
I got a lot of warnings about size of int
but otherwise compiled fine and seems to run OK

 ;D

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: Is findshares open source?
« Reply #6 on: February 27, 2014, 09:12:11 PM »
Hi Scooby
Glad it worked out for you. Just to satisfy my curiosity, if you get a chance, could you post a few examples of the warnings.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Is findshares open source?
« Reply #7 on: February 28, 2014, 03:45:32 AM »
findshares.c: In function 'Copy':
findshares.c:265: warning: cast from pointer to integer of different size
findshares.c:271: warning: cast from pointer to integer of different size
findshares.c:273: warning: cast from pointer to integer of different size
The only barriers that can stop you are the ones you create yourself.

Offline Scooby

  • Newbie
  • *
  • Posts: 27
Re: Is findshares open source?
« Reply #8 on: February 28, 2014, 01:28:49 PM »
In attachement there is a file containing all the compilerwarnings

The first three could I just replace int with long?
(the ones curaga posted)


And the others, do you think they are harmless?
(Actually If i remove compiler optimization flag "-Os"
many of the warnings go away then I only have curagas three
and findshares.c:1055:6: warning: variable 's' set but not used
file size difference is 21K compared to 25K
)

also got an error from another user ( see full output below )

Error line 445

What does that mean? error opening tcp port 445?
To me it seems user got info anyway



Code: [Select]
root@alphaos ~]# findshares
findshares version 1.05 Aug 3, 2011
Copyright Richard A. Rost April 23, 2011

Local Host Name  = alphaos
Local IP Address = 192.168.1.59 on wlan0

Error line 445
Samba/Windows Shares
--------------------------------------------------------------------------------
MSHOME
    RT-N66U          192.168.1.2       RT-N66U
   IPC$                           IPC Service (RT-N66U)


    DADS-MAC-MINI    192.168.1.10     

MSHOME
        xxxxx       192.168.1.55      Samba (xxxxx)
   media                          media
   removable_SDCARD               removable_media_SDCARD
   IPC$                           IPC Service (Samba (xxxxx))
« Last Edit: February 28, 2014, 02:52:45 PM by Scooby »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: Is findshares open source?
« Reply #9 on: February 28, 2014, 03:29:11 PM »
Hi Scooby
Code: [Select]
Error line 445That refers to line 445 in the source code. You will find:
Code: [Select]
return(__LINE__)throughout the source code. When a strategy fails, the program reports where the failure occurred and move on to the
next machine. In this particular case, it tried to connect to port 445. When that failed, it tried port 139 which also failed, so
it reported the error and resumed scanning. Some machine was blocking access to those ports.
Code: [Select]
c:1055:6: warning: variable 's' set but not usedHarmless. Some variable I stopped using but did not remove the definition.

Offline Scooby

  • Newbie
  • *
  • Posts: 27
Re: Is findshares open source?
« Reply #10 on: February 28, 2014, 03:35:25 PM »
So freak occurance that failure of scanning port 445 happens
on line 445? Maybe should I should add NOP-line so it's not the same  :P

Sorry to hammer but

findshares.c: In function 'Copy':
findshares.c:265: warning: cast from pointer to integer of different size
findshares.c:271: warning: cast from pointer to integer of different size
findshares.c:273: warning: cast from pointer to integer of different size

Do you think it would be safe to replace as in
    if(((int)csrc & 0xFFFFFF00) != 0) csrc+=(count - 1);
       

with
    if(((long)csrc & 0xFFFFFF00) != 0) csrc+=(count - 1);



Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: Is findshares open source?
« Reply #11 on: February 28, 2014, 03:42:22 PM »
Hi Scooby
If you want to do that, make sure the masks are also longer, or use a different strategy. Those three lines are basically
isolating the lower 8 bits to determine whether  csrc  is currently being used as a pointer or a byte.

Offline Scooby

  • Newbie
  • *
  • Posts: 27
Re: Is findshares open source?
« Reply #12 on: February 28, 2014, 04:14:39 PM »
Then maybe its best to ignore warnings and use int

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: Is findshares open source?
« Reply #13 on: February 28, 2014, 04:27:24 PM »
Hi Scooby
You could try this:
Code: [Select]
From:
if(((int)csrc & 0xFFFFFF00) != 0) csrc+=(count - 1);
To:
if(((long)csrc & -256) != 0) csrc+=(count - 1);
Do a similar type of change for line 271. For line 273, try:
Code: [Select]
From:
*cdest=((int)csrc & 0x000000FF);
To:
*cdest=((long)csrc & 255);

Offline Scooby

  • Newbie
  • *
  • Posts: 27
Re: Is findshares open source?
« Reply #14 on: February 28, 2014, 05:59:42 PM »
I'm a little rusty on anything else than decimal base  :-\

I don't get the -256

when trying out  decimal-to-hex-converter

I get
   -256 == 0xFFFF FF00

And 0xFFFF FF00 I think represent 64 bits right?

What I dont understand is why you used that to compare with int in your original code
since int is 32.

What am I missing