so im writing a script for a android system. these types of systems are not the typical unix systems.
what i need to do is basic. i have a script which I put in a directory and then zipped up the directory in a zip file. that way, when the script is unzipped, the person unzipping will see this:
now, when i take that zip file to a android system and i unzip it, the directory (MyScript) of the script in the zip file and the script itself (myscript.sh) loses their read and execute permissions which was assigned to them when they were zipped on the other system.
why is this happening?
first conclusion was to look into the permissions of the directory on the android system where the zip file is being unzipped.
when i do that, i see this:
The directory that is created from the zipped file has these permissions:
now, ive searched online for info on setuid and setgid but the explanations i come across and the real life application of them dont seem to work out for me.
what i basically want to do is have my script retain all of its original permissions whenever it is unzipped on any system.
the MyScript directory, after it is unzipped should have this:
I have the opposite problem - to accommodate the format's lack of permissions handling, when I extract a zip, it usually turns everything executable, just in case. This is because ZIP files, originating in MS-DOS, cannot encode executable bits... or permissions... or owners... Or really anything.
Use TAR if you expect permissions to be respected.
Just learning about the privilege escalation method provided by setuid. Correct me if I am wrong but what it does is change the uid of the current process to whatever uid I set. Right ?
So what stops me from writing my own C program and calling setuid(0) within it and gaining root privileges ?
... (2 Replies)
I have a user AAA who's who is part of a group call clserv and techsupp, His userfiles have the following permissions:-
drwxrwx--- 16 AAA clserv 1858 Aug 22 12:48 UserFiles
he has a link in his UserFiles/
lrwxrwxrwx 1 root root 36 Mar 9 2013 TECHSUPP_GLOBAL... (5 Replies)
While I was looking for tips for hardening the security of my MAC OSX I found the following posting:
"<How to disable Setuid and Setgid Binaries >
Setuid programs run with the privileges of the file's owner
(which is often root), no matter which user executes them.
Bugs in these programs... (6 Replies)
Hi all!
I have a folder with permissions 2770 (SETGID)
drwxrws--- 2 loguser admins 5 Mar 17 11:11 mydir
Inside that folder there are some files with permissions 0640:
-rw-r----- 1 loguser admins 0 Mar 17 11:11 monday.log
-rw-r----- 1 loguser admins ... (2 Replies)
hi..
why we go for setuid, setgid permissions?
as a system admin ,when we use this ,except default solaris setuid,setgid files and dirs..
hopes that anyone can help me regarding this.. (1 Reply)
About System and Perl: Sun Solaris 5.9 sparc, Perl 5.6.1
I've decided to use the perl file::find module to look for all the SETUID and SETGID files on my unix boxes. I wrote something like this: (I've shorted it a little to make it simple)
#!/opt/perl/bin/perl
use File::Find;
find... (1 Reply)
I have a setuid to root program that has now to be changed to setuid to oracle depending on who is running it. Oracle has only two groups, dba (primary) and osgrp1 (secondary). But running 'id' if oracle shows all the secondary groups belonging to root, and only dba or osgrp1 as the primary group... (2 Replies)
Hi,
I have been looking at setuid and setgid.
I understand that setuid determines who owns the file and setgid determines which group of people can access the file... yeah?!
But i need to know how to actually use setuid and setgid. I'm guessing chmod will feature somewhere..
Any help... (1 Reply)
I have a C wrapper programme which basically execute a shell script. The shell script has 700 as permission and oracle is owner of the shell script.
The C execuatble has 4711 permission so that means that it has setuid bit set and group and others can execute the C executable.
The reason why I am... (2 Replies)