svn commit: samba r11585 - branches/SAMBA_3_0/source/modules trunk/source/modules

vlendec at samba.org vlendec at samba.org
Tue Nov 8 20:13:27 GMT 2005


Author: vlendec
Date: 2005-11-08 20:13:26 +0000 (Tue, 08 Nov 2005)
New Revision: 11585

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11585

Log:
Implement the possibility to have AFS users as SIDs in pts.

Volker

Modified:
   branches/SAMBA_3_0/source/modules/vfs_afsacl.c
   trunk/source/modules/vfs_afsacl.c


Changeset:
Modified: branches/SAMBA_3_0/source/modules/vfs_afsacl.c
===================================================================
--- branches/SAMBA_3_0/source/modules/vfs_afsacl.c	2005-11-08 18:24:18 UTC (rev 11584)
+++ branches/SAMBA_3_0/source/modules/vfs_afsacl.c	2005-11-08 20:13:26 UTC (rev 11585)
@@ -39,6 +39,9 @@
 
 static char space_replacement = '%';
 
+/* Do we expect SIDs as pts names? */
+static BOOL sidpts;
+
 extern int afs_syscall(int, char *, int, char *, int);
 
 struct afs_ace {
@@ -151,6 +154,18 @@
 		sid_copy(&sid, &global_sid_Builtin_Backup_Operators);
 		type = SID_NAME_ALIAS;
 
+	} else if (sidpts) {
+		/* All PTS users/groups are expressed as SIDs */
+
+		sid_copy(&sid, &global_sid_NULL);
+		type = SID_NAME_UNKNOWN;
+
+		if (string_to_sid(&sid, name)) {
+			fstring user, domain;
+			/* We have to find the type, look up the SID */
+			lookup_sid(&sid, domain, user, &type);
+		}
+
 	} else {
 
 		fstring user, domain;
@@ -771,6 +786,11 @@
 					     only_username);
 				strlower_m(name);
 			}
+
+			if (sidpts) {
+				/* Expect all users/groups in pts as SIDs */
+				sid_to_string(name, &ace->trustee);
+			}
 		}
 
 		while ((p = strchr_m(name, ' ')) != NULL)
@@ -825,6 +845,8 @@
 
 	DEBUG(5, ("afs_get_nt_acl: %s\n", fsp->fsp_name));
 
+	sidpts = lp_parm_bool(SNUM(fsp->conn), "afsacl", "sidpts", False);
+
 	if (!afs_get_afs_acl(fsp->fsp_name, &acl)) {
 		return 0;
 	}
@@ -883,6 +905,8 @@
 	fileacls = lp_parm_const_string(SNUM(handle->conn), "afsacl", "fileacls",
 					"yes");
 
+	sidpts = lp_parm_bool(SNUM(handle->conn), "afsacl", "sidpts", False);
+
 	ZERO_STRUCT(old_afs_acl);
 	ZERO_STRUCT(new_afs_acl);
 	ZERO_STRUCT(dir_acl);

Modified: trunk/source/modules/vfs_afsacl.c
===================================================================
--- trunk/source/modules/vfs_afsacl.c	2005-11-08 18:24:18 UTC (rev 11584)
+++ trunk/source/modules/vfs_afsacl.c	2005-11-08 20:13:26 UTC (rev 11585)
@@ -39,6 +39,9 @@
 
 static char space_replacement = '%';
 
+/* Do we expect SIDs as pts names? */
+static BOOL sidpts;
+
 extern int afs_syscall(int, char *, int, char *, int);
 
 struct afs_ace {
@@ -151,6 +154,18 @@
 		sid_copy(&sid, &global_sid_Builtin_Backup_Operators);
 		type = SID_NAME_ALIAS;
 
+	} else if (sidpts) {
+		/* All PTS users/groups are expressed as SIDs */
+
+		sid_copy(&sid, &global_sid_NULL);
+		type = SID_NAME_UNKNOWN;
+
+		if (string_to_sid(&sid, name)) {
+			fstring user, domain;
+			/* We have to find the type, look up the SID */
+			lookup_sid(&sid, domain, user, &type);
+		}
+
 	} else {
 
 		fstring user, domain;
@@ -771,6 +786,11 @@
 					     only_username);
 				strlower_m(name);
 			}
+
+			if (sidpts) {
+				/* Expect all users/groups in pts as SIDs */
+				sid_to_string(name, &ace->trustee);
+			}
 		}
 
 		while ((p = strchr_m(name, ' ')) != NULL)
@@ -825,6 +845,8 @@
 
 	DEBUG(5, ("afs_get_nt_acl: %s\n", fsp->fsp_name));
 
+	sidpts = lp_parm_bool(SNUM(fsp->conn), "afsacl", "sidpts", False);
+
 	if (!afs_get_afs_acl(fsp->fsp_name, &acl)) {
 		return 0;
 	}
@@ -883,6 +905,8 @@
 	fileacls = lp_parm_const_string(SNUM(handle->conn), "afsacl", "fileacls",
 					"yes");
 
+	sidpts = lp_parm_bool(SNUM(handle->conn), "afsacl", "sidpts", False);
+
 	ZERO_STRUCT(old_afs_acl);
 	ZERO_STRUCT(new_afs_acl);
 	ZERO_STRUCT(dir_acl);



More information about the samba-cvs mailing list