08-07-2009
find setuid files
I would like to list files with setuid and setgid set up. I used the find command, but I got a lot of permission denied error. I tried to redirect the error to the hole it does not work. I used the command string below
find . -type f \( -perm -4000 -o -perm -2000 \) -exec ls {} \; 2>/dev/null
find: paths must precede expression.
How can I redirect the error of my find result to the hole?
Thanks,
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
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 Dummies Questions & Answers
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)
Discussion started by: crispy
1 Replies
3. Shell Programming and Scripting
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)
Discussion started by: x96riley3
1 Replies
4. UNIX for Dummies Questions & Answers
could u plz give me clear idea of spcial permissions setuid,getuid and striky bit . (1 Reply)
Discussion started by: Prem
1 Replies
5. HP-UX
for security issue ,i would like to find all privilege tools that can setuid
how to do this (2 Replies)
Discussion started by: alert0919
2 Replies
6. Solaris
Hi All,
Can someone give me some info about setuid or guid topic? Also about sticky bit.
Thanks in advance,
itik (9 Replies)
Discussion started by: itik
9 Replies
7. HP-UX
Hi All,
How to prevent root user from doing setuid().
In otherwords, if the root(any user) is trying to do setuid in a program it should fail. (5 Replies)
Discussion started by: guru13
5 Replies
8. Solaris
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
9. UNIX for Beginners Questions & Answers
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
10. Shell Programming and Scripting
I'm trying - as an ordinary user - to create a file in the root directory of my system. For that purpose I wrote a simple script that echoes a string into a file. I made the file executable, used sudo to change ownership to root. Like this:
$ cat hello
#!/bin/bash
echo hello > /hello
$... (5 Replies)
Discussion started by: Ralph
5 Replies
LEARN ABOUT CENTOS
acl_get_perm
ACL_GET_PERM(3) BSD Library Functions Manual ACL_GET_PERM(3)
NAME
acl_get_perm -- test for a permission in an ACL permission set
LIBRARY
Linux Access Control Lists library (libacl, -lacl).
SYNOPSIS
#include <sys/types.h>
#include <acl/libacl.h>
int
acl_get_perm(acl_permset_t permset_d, acl_perm_t perm);
DESCRIPTION
The acl_get_perm() function tests if the permission specified by the argument perm is contained in the ACL permission set pointed to by the
argument permset_d.
Any existing descriptors that refer to permset_d continue to refer to that permission set.
RETURN VALUE
If successful, the acl_get_perm() function returns 1 if the permission specified by perm is contained in the ACL permission set permset_d,
and 0 if the permission is not contained in the permission set. Otherwise, the value -1 is returned and the global variable errno is set to
indicate the error.
ERRORS
If any of the following conditions occur, the acl_get_perm() function returns -1 and sets errno to the corresponding value:
[EINVAL] The argument permset_d is not a valid descriptor for a permission set within an ACL entry.
The argument perm is not a valid acl_perm_t value.
STANDARDS
This is a non-portable, Linux specific extension to the ACL manipulation functions defined in IEEE Std 1003.1e draft 17 ("POSIX.1e", aban-
doned).
SEE ALSO
acl_add_perm(3), acl_clear_perms(3), acl_delete_perm(3), acl_get_permset(3), acl_set_permset(3), acl(5)
AUTHOR
Written by Andreas Gruenbacher <a.gruenbacher@bestbits.at>.
Linux ACL March 23, 2002 Linux ACL