Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 300021 Details for
Bug 440195
Feature request: Support for directory level audit with recursion before 2.6.24 kernel and above at userspace
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
This patch add directory level audit with recursion feature in userspace
auditctl.c.ver1.7.patch (text/plain), 3.44 KB, created by
abhishek
on 2008-04-02 07:37:09 UTC
(
hide
)
Description:
This patch add directory level audit with recursion feature in userspace
Filename:
MIME Type:
Creator:
abhishek
Created:
2008-04-02 07:37:09 UTC
Size:
3.44 KB
patch
obsolete
>38,40d37 >< #include <assert.h> >< #include <dirent.h> >< #include <sys/types.h> >167d163 >< " -Z <path> Insert watch at <path>,if the <path> points to a directory then all subdirectories,files are watched \n" >1085,1178d1080 >< const char* get_file_type (const char* path) >< { >< struct stat st; >< lstat (path, &st); >< if (S_ISLNK (st.st_mode)) >< return "symbolic link"; >< else if (S_ISDIR (st.st_mode)) >< return "directory"; >< else if (S_ISCHR (st.st_mode)) >< return "character device"; >< else if (S_ISBLK (st.st_mode)) >< return "block device"; >< else if (S_ISFIFO (st.st_mode)) >< return "fifo"; >< else if (S_ISSOCK (st.st_mode)) >< return "socket"; >< else if (S_ISREG (st.st_mode)) >< return "regular file"; >< else >< /* Unexpected. Each entry should be one of the types above. */ >< assert (0); >< } >< >< int dir_scan (int argc, char *argv[]) >< { >< >< char* dir_path; >< int retval=1; >< char entry_path[PATH_MAX + 1]; >< DIR* dir; >< struct dirent* entry; >< size_t path_len; >< memset(entry_path,0,sizeof(entry_path)); >< dir_path=(char*)malloc(PATH_MAX + 1); >< strcpy(dir_path,argv[2]); >< >< /* Copy the directory path into entry_path. */ >< strncpy (entry_path, dir_path, sizeof (entry_path)); >< path_len = strlen (dir_path); >< >< /* If the directory path doesnât end with a slash, append a slash. */ >< if (entry_path[path_len - 1] != '/') >< { >< entry_path[path_len] = '/'; >< entry_path[path_len + 1] = '\0'; >< ++path_len; >< } >< >< /* Start the listing operation of the directory specified on the >< command line. */ >< dir = opendir (dir_path); >< free(dir_path); >< >< /* Loop over all directory entries. */ >< while ((entry = readdir (dir)) != NULL) >< { >< const char* type; >< >< /* Build the path to the directory entry by appending the entry >< name to the path name. */ >< strncpy (entry_path + path_len, entry->d_name, >< sizeof (entry_path) - path_len); >< >< /* Determine the type of the entry. */ >< type = get_file_type (entry_path); >< >< if (!strcmp (entry->d_name,".") || !strcmp (entry->d_name,"..")) >< continue; >< if (!strcmp(type,"directory")) >< { >< argv[1]="-w"; >< argv[2]=entry_path; >< >< //entry_path[strlen(entry_path)]='\0'; >< if (reset_vars()) >< { >< closedir (dir); >< return 1; >< } >< retval = setopt(argc, argv); >< if (retval == -3) >< { >< closedir (dir); >< return 0; >< } >< handle_request(retval); >< dir_scan (argc,argv); >< } >< } >< /* All done. */ >< closedir (dir); >< return 0; >< } >< >1186,1205c1088 >< >< /*-------------------------modification---------------------------*/ >< >< if( ((argc >=3) && (argc<=5)) && (strcmp(argv[1], "-Z") == 0) ) >< { >< /*Make sure we are root*/ >< if(getuid()!=0) >< { >< fprintf(stderr,"You must be root to run this program. \n"); >< return 4; >< } >< argv[1]="-w"; >< if (reset_vars()) >< return 1; >< retval = setopt(argc, argv); >< if (retval == -3) >< return 0; >< dir_scan(argc,argv); >< } >< else if ((argc == 3) && (strcmp(argv[1], "-R") == 0)) { >--- >> if ((argc == 3) && (strcmp(argv[1], "-R") == 0)) { >1218d1100 >< return handle_request(retval); >1237d1118 >< return handle_request(retval); >1239c1120 >< //return handle_request(retval); >--- >> return handle_request(retval);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 440195
: 300021