svn commit: samba r2796 - in branches/SAMBA_4_0/source/ntvfs/unixuid: .

tridge at samba.org tridge at samba.org
Sun Oct 3 07:31:32 GMT 2004


Author: tridge
Date: 2004-10-03 07:31:32 +0000 (Sun, 03 Oct 2004)
New Revision: 2796

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/ntvfs/unixuid&rev=2796&nolog=1

Log:
- changed ldap attributes "UnixID" to "unixID" and "UnixName" to "unixName" to be more ldap traditional

- register the unixuid module as all 3 ntvfs backend types, as it doesn't care what type of backend
  it filters



Modified:
   branches/SAMBA_4_0/source/ntvfs/unixuid/vfs_unixuid.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/unixuid/vfs_unixuid.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/unixuid/vfs_unixuid.c	2004-10-03 07:00:17 UTC (rev 2795)
+++ branches/SAMBA_4_0/source/ntvfs/unixuid/vfs_unixuid.c	2004-10-03 07:31:32 UTC (rev 2796)
@@ -35,7 +35,7 @@
 			       struct smbsrv_request *req, struct dom_sid *sid, uid_t *uid)
 {
 	struct unixuid_private *private = ntvfs->private_data;
-	const char *attrs[] = { "sAMAccountName", "UnixID", "UnixName", "sAMAccountType", NULL };
+	const char *attrs[] = { "sAMAccountName", "unixID", "unixName", "sAMAccountType", NULL };
 	int ret;
 	const char *s;
 	void *ctx;
@@ -47,7 +47,7 @@
 
 	ret = samdb_search(private->samctx, ctx, NULL, &res, attrs, "objectSid=%s", sidstr);
 	if (ret != 1) {
-		DEBUG(2,("Unable to map sid %s to unix uid\n", sidstr));
+		DEBUG(0,("sid_to_unixuid: unable to find sam record for sid %s\n", sidstr));
 		talloc_free(ctx);
 		return NT_STATUS_ACCESS_DENIED;
 	}
@@ -60,7 +60,7 @@
 	}
 
 	/* first try to get the uid directly */
-	s = samdb_result_string(res[0], "UnixID", NULL);
+	s = samdb_result_string(res[0], "unixID", NULL);
 	if (s != NULL) {
 		*uid = strtoul(s, NULL, 0);
 		talloc_free(ctx);
@@ -68,11 +68,11 @@
 	}
 
 	/* next try via the UnixName attribute */
-	s = samdb_result_string(res[0], "UnixName", NULL);
+	s = samdb_result_string(res[0], "unixName", NULL);
 	if (s != NULL) {
 		struct passwd *pwd = getpwnam(s);
 		if (!pwd) {
-			DEBUG(0,("UnixName %s for sid %s does not exist as a local user\n", s, sidstr));
+			DEBUG(0,("unixName %s for sid %s does not exist as a local user\n", s, sidstr));
 			talloc_free(ctx);
 			return NT_STATUS_ACCESS_DENIED;
 		}
@@ -109,7 +109,7 @@
 			       struct smbsrv_request *req, struct dom_sid *sid, gid_t *gid)
 {
 	struct unixuid_private *private = ntvfs->private_data;
-	const char *attrs[] = { "sAMAccountName", "UnixID", "UnixName", "sAMAccountType", NULL };
+	const char *attrs[] = { "sAMAccountName", "unixID", "unixName", "sAMAccountType", NULL };
 	int ret;
 	const char *s;
 	void *ctx;
@@ -121,7 +121,7 @@
 
 	ret = samdb_search(private->samctx, ctx, NULL, &res, attrs, "objectSid=%s", sidstr);
 	if (ret != 1) {
-		DEBUG(2,("Unable to map sid %s to unix gid\n", sidstr));
+		DEBUG(0,("sid_to_unixgid: unable to find sam record for sid %s\n", sidstr));
 		talloc_free(ctx);
 		return NT_STATUS_ACCESS_DENIED;
 	}
@@ -134,7 +134,7 @@
 	}
 
 	/* first try to get the gid directly */
-	s = samdb_result_string(res[0], "UnixID", NULL);
+	s = samdb_result_string(res[0], "unixID", NULL);
 	if (s != NULL) {
 		*gid = strtoul(s, NULL, 0);
 		talloc_free(ctx);
@@ -142,11 +142,11 @@
 	}
 
 	/* next try via the UnixName attribute */
-	s = samdb_result_string(res[0], "UnixName", NULL);
+	s = samdb_result_string(res[0], "unixName", NULL);
 	if (s != NULL) {
 		struct group *grp = getgrnam(s);
 		if (!grp) {
-			DEBUG(0,("UnixName '%s' for sid %s does not exist as a local group\n", s, sidstr));
+			DEBUG(0,("unixName '%s' for sid %s does not exist as a local group\n", s, sidstr));
 			talloc_free(ctx);
 			return NT_STATUS_ACCESS_DENIED;
 		}
@@ -708,10 +708,6 @@
 
 	ZERO_STRUCT(ops);
 
-	/* fill in the name and type */
-	ops.name = "unixuid";
-	ops.type = NTVFS_DISK;
-	
 	/* fill in all the operations */
 	ops.connect = unixuid_connect;
 	ops.disconnect = unixuid_disconnect;
@@ -742,12 +738,21 @@
 	ops.trans = unixuid_trans;
 	ops.logoff = unixuid_logoff;
 
-	/* register ourselves with the NTVFS subsystem. */
+	ops.name = "unixuid";
+
+	/* we register under all 3 backend types, as we are not type specific */
+	ops.type = NTVFS_DISK;	
 	ret = register_backend("ntvfs", &ops);
+	if (!NT_STATUS_IS_OK(ret)) goto failed;
 
-	if (!NT_STATUS_IS_OK(ret)) {
-		DEBUG(0,("Failed to register unixuid backend!\n"));
-	}
+	ops.type = NTVFS_PRINT;	
+	ret = register_backend("ntvfs", &ops);
+	if (!NT_STATUS_IS_OK(ret)) goto failed;
+
+	ops.type = NTVFS_IPC;	
+	ret = register_backend("ntvfs", &ops);
+	if (!NT_STATUS_IS_OK(ret)) goto failed;
 	
+failed:
 	return ret;
 }



More information about the samba-cvs mailing list