svn commit: samba r17498 - in branches/SAMBA_3_0_23/source/utils: .
jra at samba.org
jra at samba.org
Fri Aug 11 18:59:44 GMT 2006
Author: jra
Date: 2006-08-11 18:59:44 +0000 (Fri, 11 Aug 2006)
New Revision: 17498
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=17498
Log:
Add similar clarifications to 3.0.23 code. Uninitialized
variable not a problem though in this branch.
Jeremy.
Modified:
branches/SAMBA_3_0_23/source/utils/net_groupmap.c
Changeset:
Modified: branches/SAMBA_3_0_23/source/utils/net_groupmap.c
===================================================================
--- branches/SAMBA_3_0_23/source/utils/net_groupmap.c 2006-08-11 18:51:31 UTC (rev 17497)
+++ branches/SAMBA_3_0_23/source/utils/net_groupmap.c 2006-08-11 18:59:44 UTC (rev 17498)
@@ -192,7 +192,8 @@
uint32 rid = 0;
gid_t gid;
int i;
-
+ const char *name_type = "domain group";
+
/* get the options */
for ( i=0; i<argc; i++ ) {
if ( !StrnCaseCmp(argv[i], "rid", strlen("rid")) ) {
@@ -236,15 +237,21 @@
case 'b':
case 'B':
sid_type = SID_NAME_WKN_GRP;
+ name_type = "wellknown group";
break;
case 'd':
case 'D':
sid_type = SID_NAME_DOM_GRP;
+ name_type = "domain group";
break;
case 'l':
case 'L':
sid_type = SID_NAME_ALIAS;
+ name_type = "alias (local) group";
break;
+ default:
+ d_fprintf(stderr, "unknown group type %s\n", type);
+ return -1;
}
}
else {
@@ -317,7 +324,8 @@
return -1;
}
- d_printf("Successfully added group %s to the mapping db\n", ntgroup);
+ d_printf("Successfully added group %s to the mapping db as a %s\n",
+ ntgroup, name_type);
return 0;
}
@@ -413,15 +421,18 @@
* Allow changing of group type only between domain and local
* We disallow changing Builtin groups !!! (SID problem)
*/
- if (sid_type != SID_NAME_UNKNOWN) {
- if (map.sid_name_use == SID_NAME_WKN_GRP) {
- d_fprintf(stderr, "You can only change between domain and local groups.\n");
- return -1;
- }
-
- map.sid_name_use=sid_type;
+ if (sid_type == SID_NAME_UNKNOWN) {
+ d_fprintf(stderr, "Can't map to an unknown group type.\n");
+ return -1;
}
+ if (map.sid_name_use == SID_NAME_WKN_GRP) {
+ d_fprintf(stderr, "You can only change between domain and local groups.\n");
+ return -1;
+ }
+
+ map.sid_name_use=sid_type;
+
/* Change comment if new one */
if ( ntcomment[0] )
fstrcpy( map.comment, ntcomment );
More information about the samba-cvs
mailing list