Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code Stealers 3

Status
Not open for further replies.

coffeysm

MIS
Oct 7, 2004
571
US
I just want to vent out some frustration. I am UNIX Admin and I work as a Contractor for the U.S. Government. I am also prior Military. I have been working with this woman who constantly steals my code from my scripts and then claims it as her own. It has gotten to the point where I can see her copying it verbatim and then making one change. I work very hard and take my job seriously and to see this moron doing this insults me very much. I mentioned it to her superior who is my friend. He was like don't worry I know where the real credit should go. But, nothing comes out of it...I do not want to start any drama, but I am getting fed up. The main problem is the fact that I am a contractor and she is a Government Civilian. I guess I was wondering if anyone had any similar situations and how did you handle it?
 
Les,

Without getting too technical, Harebrain's code is Unix for "Change the permissions on all files to 'no access' for anyone who is not the owner of the files." [smile]

The following Unix command would allow others to execute the files, but not to read or change the files:
Code:
chmod 711 *

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Isn't there a way this can be turned to everyone's advantage by making the unofficial copying become official.

Simply tell(ask?) your superior that since she's using your code anyway, you'd like to give it to her in a form she doesn't have to retype, for the communal good (avoid accusations at this stage!).

Thereafter forward all code that you think might be useful to her, to her directly, as soon as it's ready for the big wide world.

In that way it's quite clear to everybody that you are the source of all this code, and it's clear that you're supporting the group effort by making your code available to others. She has no reason to be angry at your action since it's designed to save her effort and help her...


 
Lionel, Brilliant idea ! Hava
star.gif
.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Stealing code is a good thing.

I used to look after graduate programmers, young people in their first job out of university (college)

A significant proportion of my time was spent telling them to use other people's code, this this wasn't just a good thing - it was their job.

Taking credit, claiming you've written something you haven't is another thing and it's laughable as well. I like lionelhill's idea. Make it obvious that it's being done and obvious that you're ok with it.

Mike

The options are: fast, cheap and right - pick any two... [orientalbow] & [anakin]

Want great answers to your Tek-Tips questions? Have a look at faq219-2884
 
Another idea, first posed by aarenot, is to create a magnificent script but after demo-ing it for her, introduce a small error.

-------------------------
The trouble with doing something right the first time is that nobody appreciates how difficult it was - Steven Wright
 
Santa/Dave:

Wouldn't that be:

CHMOD 755 not CHMOD 711? ;-)

Or better yet... CHMOD 750 hehe....



Just my 2¢
"Life gets mighty precious when there's less of it to waste." -Bonnie Raitt "Nick of Time"
--Greg
 
clue me in, I program Avaya IPOffice telephony/voicemail systems,not actuaully write code. What will these CHMOD entries do? I could use a good lol.



 
aarenot:

CHMOD is a Unix/Linux command.

It's short for "Change Mode".

A file in the *nix filesystem has, essentially, 3 permissions that can be set.

Permissions for the OWNER, permissions for users in the same GROUP, and permissions for everyone else.

It's easiest represented in binary.....

EXECUTE WRITE READ
4 2 1

.... So, to set OWNER with Read, Write, Execute, GROUP with READ ONLY, and everyone else with NOTHING would be:

710 <---- 7 being the sum of "Read, write and execute", 1 being "Read", and 0 being Nothing. The first number (7) represents the owner, the second the group, and the third everyone else.

To give everyone full permissions would be 777
Owner full, everyone else nothing, 700
... etc.

When you look at a ls (list... the equivelant of a dir command in dos) you see something like this:

Code:
-rw-r--r--    1 root     root         8510 Jan 25  2003 htdig.conf
-rw-rw-rw-    1 root     root          161 Jan  7 18:39 htpasswd.users
drwxr-xr-x    4 root     root         4096 Oct 20 19:34 httpd
-rw-r--r--    1 root     root         1752 Jan 25  2003 identd.conf
drwxr-xr-x    2 root     root         4096 Jun 17  2006 im
-rw-r--r--    1 root     root         3376 Jan 24  2003 im_palette.pal
-rw-r--r--    1 root     root          920 Jan 24  2003 im_palette-small.pal
-rw-r--r--    1 root     root          224 Jan 24  2003 im_palette-tiny.pal
-rw-r--r--    1 root     root         5464 Jan 24  2003 imrc
lrwxrwxrwx    1 root     root           11 Oct 20 19:11 init.d -> rc.d/init.d

As I look at each line, (for example, the imrc line, second to the bottom), I see -rw-r--r--, meaning the owner (Root) has read/write, the group (also root) has read, and everyone else has read. The 5464 is the file size, then the creation date, then the file name.

If I wanted to change the file "imrc" to alow others in the root group to be able to change the file, as well as read it, I would do a CHMOD 664 (read/write, read/write, read) which would make it -rw-rw-r--.

I hope that explains it. :)

Other related commands are CHOWN (Change Owner), and CHGRP (Change Group).

(p.s., just before you ask anyway... the d in the first column means it's a directory, the l means it's a "symbolic Link", the *nix equivelant to a "shortcut" to a file in another area.)



Just my 2¢
"Life gets mighty precious when there's less of it to waste." -Bonnie Raitt "Nick of Time"
--Greg
 
Greg said:
It's easiest represented in binary.....

EXECUTE WRITE READ
4 2 1
whoa, Whoa, WHOA, Greg...The bits are:

4 = Read
2 = Write
1 = Execute

Greg's earlier reply said:
Wouldn't that be: CHMOD 755 not CHMOD 711?
No wonder we disagreed on the CHMOD...My suggestion was owner = R,W,E...Everyone else is execute only. Your chmod would have everyone reading, as well...I say, don't even let them read the code, just execute. Right?

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Crap... you're right... I stand corrected....

RWXRWXRWX
421421421

<sigh> Totally backwards.... kind of like the day I'm having. And I put so much work into that nice explanation, too.... and if I had looked at the -rw-r--r-- MYSELF, I would have caught my mistake.



Just my 2¢
"Life gets mighty precious when there's less of it to waste." -Bonnie Raitt "Nick of Time"
--Greg
 
So, to correct myself:

The section BELOW the code is correct....

The section ABOVE the code should read:

READ WRITE EXECUTE
4 2 1

... so if I wanted OWNER to have READ, WRITE and EXECUTE, GROUP to have READ and WRITE, and everyone else to have READ ONLY, it would be CHMOD 764

<Sigh> Thanks for pointing out my CHMOD Dyslexia.



Just my 2¢
"Life gets mighty precious when there's less of it to waste." -Bonnie Raitt "Nick of Time"
--Greg
 
And that ends our lesson in *nix file permissions. Stay tuned for tomorrow when we explain the slightly more advanced task of the differences between symbolic links and shortcuts ;)

 

Wait, what about *nix file permissions Part II ?

Where we introduce Sticky Bits, SetUID and SetGID as well as ACL's with setfacl and getfacl. And maybe even umask.. ?
Maybe introduce the 4 number octal notation (e.g. 0755) for the extended perms.
We could also talk about the 'easier to understand for beginners' (but longer winded) symbolic notation of [tt]chmod -R og-rw somedir[/tt]

Or is that taking it a bit far ? ;-)



A smile is worth a thousand kind words. So smile, it's easy! :)
 
Hehe....

It reminds me of walking through Barnes and Noble's and seeing a book "AOL for dummies." I thought to myself, "Well, yeah...."



Just my 2¢
"Life gets mighty precious when there's less of it to waste." -Bonnie Raitt "Nick of Time"
--Greg
 
It reminds me of walking through Barnes and Noble's and seeing a book "AOL for dummies." I thought to myself, "Well, yeah...."
Now thats funny - that gets a star for making my morning....
 
I had to tell my mom that for years. And guess what. Now she pays for high speed internet AND aol. WTF?!?!?!?!?



Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top