]> andersk Git - moira.git/commitdiff
Trim whitespace from childname, so we can update a container that
authorzacheiss <zacheiss>
Wed, 2 May 2001 21:44:12 +0000 (21:44 +0000)
committerzacheiss <zacheiss>
Wed, 2 May 2001 21:44:12 +0000 (21:44 +0000)
contains subcontainers.

Don't allow a machine to be assigned to more than one container.

server/qsupport.pc
server/queries2.c

index c6bbe15f9e9e424d47986312de2e46e9c72a35b8..aa041caec950e31ba7f853569c08420c78d9abc0 100644 (file)
@@ -1923,7 +1923,8 @@ int update_container(struct query *q, char *argv[], client *cl)
       EXEC SQL FETCH csr_ucon INTO :childname, :childid;
       if (sqlca.sqlcode)
              break;
-      
+
+      strcpy(childname, strtrim(childname));
       /* concatenate the new parent name with the existing sub-container name
        * we get the sub-containers new name */
       tmpchar = childname + strlen(name);
index e3229a75d233ee755138259f691e98e319f2e2b4..046ae23a22831a09453fe38927526e8e3503ac26 100644 (file)
@@ -3218,6 +3218,19 @@ static struct valobj amcn_valobj[] =     /* ADD_MACHINE_TO_CONTAINER */
 };
 
 static struct validate amcn_validate = /* for amtn and dmfn */
+{
+  amcn_valobj,
+  2,
+  "mach_id",
+  "mach_id = %d",
+  1,
+  0,
+  access_container,
+  0,
+  set_mach_modtime_by_id,
+};
+
+static struct validate dmcn_validate = /* for amtn and dmfn */
 {
   amcn_valobj,
   2,
@@ -6685,7 +6698,7 @@ struct query Queries[] = {
     "mach_id = %d AND cnt_id = %d",
     2,
     NULL,
-    &amcn_validate,
+    &dmcn_validate,
   },
 
   {
This page took 0.188137 seconds and 5 git commands to generate.