chown/chmod -R from kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've been trying to fix usbfs bug (bugme 1418), and i have problems
implementing chown/chmod.

I've come up with following code (outputs 4xabd, even when there should be
directories; nothing seems chmoded in /proc/bus/usb/)

Any pointer what did i do wrong appreciated.


	Domen

struct dentry *dentry;   
list_for_each_entry(dentry, &s_root->d_subdirs, d_subdirs) {  
	printk("a\n");     
	if (!dentry->d_inode)    
		continue;     
	printk("b\n");     
	if (dentry->d_inode->i_mode & S_IFDIR) { 
		printk("c\n");     
		struct dentry *devd;   
		     
		dentry->d_inode->i_uid = busuid;   
		dentry->d_inode->i_gid = busgid;   
		dentry->d_inode->i_mode = busmode & S_IFDIR; 
		     
		list_for_each_entry(devd, &dentry->d_subdirs,    
				d_subdirs) {    
			dentry->d_inode->i_uid = devuid;   
			dentry->d_inode->i_gid = devgid;   
			dentry->d_inode->i_mode = devmode & S_IFREG; 
		}     
	} else {   
		printk("d\n");     
		dentry->d_inode->i_uid = listuid;   
		dentry->d_inode->i_gid = listgid;   
		dentry->d_inode->i_mode = listmode & S_IFREG; 
	}     
}     

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux