Sponsored Content
Full Discussion: Setuid root and chown
Top Forums UNIX for Dummies Questions & Answers Setuid root and chown Post 68250 by reborg on Friday 1st of April 2005 07:52:34 PM
Old 04-01-2005
Quote:
Originally Posted by Just Ice
i actually just tested a quick script on solaris 9 with suid bit set and it does work ...
Code:
$ id
uid=1001(otto) gid=10(staff)
$ ls -l test
-rwsr-xr-x   1 root     other         61 Apr  1 19:05 test
$ cat test
#! /bin/ksh
chown otto joke
chmod 444 joke
ls -l joke
exit 0
$ ./test
-r--r--r--   1 otto     other        568 Apr  1 17:36 joke
$ ls -l
total 64
-r--r--r--   1 otto     other        568 Apr  1 17:36 joke
-rwsr-xr-x   1 root     other         61 Apr  1 19:05 test
$

But who was joke originally owned by?

Only kidding it did work for me too on Solaris 9, but I was pretty sure it shouldn't.

Last edited by reborg; 04-01-2005 at 08:57 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

setuid

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)
Discussion started by: sanjay92
2 Replies

2. UNIX for Advanced & Expert Users

Setuid Program with (-rwsr-sr-x 1 root other ) UID/EUID issue

Hi, I have a program with the following suid setup -rwsr-sr-x 1 root other 653 Aug 16 17:00 restart_server It basically starts up a service that has to be started by root. I just want the normal users to be able to restart the service using the script above. But when the... (7 Replies)
Discussion started by: 0ktalmagik
7 Replies

3. UNIX for Dummies Questions & Answers

setuid

could u plz give me clear idea of spcial permissions setuid,getuid and striky bit . (1 Reply)
Discussion started by: Prem
1 Replies

4. UNIX for Dummies Questions & Answers

chown -R under root directory

Hi I executed command "chown -R xxx:xxx /" with user root... and it was too late when I found the mistake. Ownership of some files under the root directory had already become xxx:xxx. Is there a way that can recovery the ownership of all my files back to the point where they were? I really thanks. (2 Replies)
Discussion started by: password636
2 Replies

5. AIX

sudo must be setuid root.

Guy's I'm trying to add some lines in sudo by useing this command visudo # User privilege specification root ALL=(ALL) ALL # Uncomment to allow people in group wheel to run all commands # %wheel ALL=(ALL) ALL # Same thing without a password # %wheel ALL=(ALL) NOPASSWD: ALL #... (5 Replies)
Discussion started by: ITHelper
5 Replies

6. UNIX for Dummies Questions & Answers

chown: Operation not permitted as root

Hi Expert, I am trying to change ownership of one file to another user that is exist in the system but getting operation not permitted error what could be the correct way? # ls -lh .Xauthority_ori -rw------- 1 maxim atlas 2.8K Jul 27 17:18 .Xauthority_ori # id -a uid=0(root)... (8 Replies)
Discussion started by: regmaster
8 Replies

7. Solaris

Need help with setuid.

Hi Gurus, I need your suggestions,to implement setuid. Here is the situation. I have a user xyz on a solaris zone.He needs to install a package using a pkgadd command but i guess only a root can run that .Is there any way I can set the setuid bit on the pkgadd which is in the location... (6 Replies)
Discussion started by: rama krishna
6 Replies

8. Solaris

Migration of system having UFS root FS with zones root to ZFS root FS

Hi All After downloading ZFS documentation from oracle site, I am able to successfully migrate UFS root FS without zones to ZFS root FS. But in case of UFS root file system with zones , I am successfully able to migrate global zone to zfs root file system but zone are still in UFS root file... (2 Replies)
Discussion started by: sb200
2 Replies

9. Red Hat

Find and Chown all files in a DIR except for Root

RHEL 6.3 Could someone tell me how to use the find and chown command to replace all files in a directory owned by user1 (for this example) and replace with user1:group1? Most importantly I dont want to change any files owned by root. I recently used the following command but it changed the root... (4 Replies)
Discussion started by: gps1976
4 Replies

10. UNIX for Beginners Questions & Answers

What keeps me from abusing setuid(0) and programs with setuid bit set?

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)
Discussion started by: sreyan32
2 Replies
Perl::Critic::Policy::Modules::ProhibitEvilModules(3pm) User Contributed Perl DocumentationPerl::Critic::Policy::Modules::ProhibitEvilModules(3pm)

NAME
Perl::Critic::Policy::Modules::ProhibitEvilModules - Ban modules that aren't blessed by your shop. AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
Use this policy if you wish to prohibit the use of specific modules. These may be modules that you feel are deprecated, buggy, unsupported, insecure, or just don't like. CONFIGURATION
The set of prohibited modules is configurable via the "modules" and "modules_file" options. The value of "modules" should be a string of space-delimited, fully qualified module names and/or regular expressions. An example of prohibiting two specific modules in a .perlcriticrc file: [Modules::ProhibitEvilModules] modules = Getopt::Std Autoload Regular expressions are identified by values beginning and ending with slashes. Any module with a name that matches "m/pattern/" will be forbidden. For example: [Modules::ProhibitEvilModules] modules = /Acme::/ would cause all modules that match "m/Acme::/" to be forbidden. In addition, you can override the default message ("Prohibited module "module" used") with your own, in order to give suggestions for alternative action. To do so, put your message in curly braces after the module name or regular expression. Like this: [Modules::ProhibitEvilModules] modules = Fatal {Found use of Fatal. Use autodie instead} /Acme::/ {We don't use joke modules} Similarly, the "modules_file" option gives the name of a file containing specifications for prohibited modules. Only one module specification is allowed per line and comments start with an octothorp and run to end of line; no curly braces are necessary for delimiting messages: Evil # Prohibit the "Evil" module and use the default message. # Prohibit the "Fatal" module and give a replacement message. Fatal Found use of Fatal. Use autodie instead. # Use a regular expression. /Acme::/ We don't use joke modules. By default, the modules that have been deprecated by the Perl 5 Porters are reported; at the time of writing these are Class::ISA, Pod::Plainer, Shell, and Switch. Specifying a value for the "modules" option will override this. NOTES
Note that this policy doesn't apply to pragmas. AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. perl v5.14.2 2012-06-07 Perl::Critic::Policy::Modules::ProhibitEvilModules(3pm)
All times are GMT -4. The time now is 10:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy