[patch] Allow chown of directories from W2k domain clients

Andrew Furey andrew at terminus.net.au
Wed Feb 19 14:58:46 GMT 2003

>>+	if (strcmp(strerror(errno),"Is a directory") == 0) {
>>+	    fd = conn->vfs_ops.opendir(conn,dos_to_unix_static(fname));
>>+	}
> This needs some serious flamage...  Why can't you just use the errno
> directly?

Because I couldn't find it :(  The closest I could come was #21 (listed 
in asm/errno.h), but I couldn't confirm it - whenever I tried to access 
the errno variable (by logging it) smbd would segfault :(  My C is a bit 
(OK, a lot) rusty...

>> 	if ((file_ace_list == NULL) && (dir_ace_list == NULL)) {
>>+		/* if we're here we're probably trying to chown a directory
>>+		   (fails normally) - andrew at terminus.net.au */
>>+		fstrcpy(fullpath, conn->connectpath);
>>+		fstrcat(fullpath, "/");
>>+		fstrcat(fullpath, fsp->fsp_name);
>>+		become_root();
> What are you doing to ensure that only your admin users can do this?

At present, relying on the W2k client to only show them the dialog if 
they have access (probably a wrong assumption anyway).


I know, you don't have to say it... but you know doubt know the Samba 
internals a lot better than me, so if you want to add in checks (indeed, 
rewrite the whole patch) you're more than welcome. :/

ANDREW FUREY <andrew at terminus.net.au> - Sysadmin/developer for Terminus.
Providing online networks of Australian lawyers (http://www.ilaw.com.au)
and Linux experts (http://www.linuxconsultants.com.au) for instant help!
Disclaimer: http://www.terminus.net.au/disclaimer.html. GCS L+++ P++ t++

More information about the samba-technical mailing list