Browse code

Update get/set dns servers, DUID, IAID in netmgr v1.0.3

Change-Id: Ife8068d6a03d8d62f964e9e50e45cf64e8c81221
Reviewed-on: http://photon-jenkins.eng.vmware.com/1163
Reviewed-by: michellew <michellew@vmware.com>
Tested-by: michellew <michellew@vmware.com>
(cherry picked from commit f63cfbff488fe13a6bae7d616cfbfd26953b2bbe)
Reviewed-on: http://photon-jenkins.eng.vmware.com/1195
Reviewed-by: suezzelur <anishs@vmware.com>
Tested-by: suezzelur <anishs@vmware.com>

vinaykul authored on 2016/07/09 10:39:40
Showing 4 changed files
1 1
deleted file mode 100644
... ...
@@ -1,11 +0,0 @@
1
-+++ b/tools/netmgr/main.c	2016-05-26 03:51:30.499792142 +0000
2
-@@ -102,7 +102,7 @@
3
-             {
4
-                 err = arCmdMap[nCommandCount].pFnCmd(pCmdArgs);
5
-                 bail_on_error(err);
6
--                nFound = 0;
7
-+                nFound = 1;
8
-                 break;
9
-             }
10
-         }
11 1
deleted file mode 100644
... ...
@@ -1,43 +0,0 @@
1
-diff -uNr nm1/src/iniparser.c nm2/src/iniparser.c
2
-+++ nm2/src/iniparser.c	2016-06-03 17:03:42.345225428 +0000
3
-@@ -600,7 +600,7 @@
4
- 
5
-     sprintf(pszTmpPath, "%s%s", pszPath, pszSuffix);
6
- 
7
--    fp = fopen(pszTmpPath, "w");
8
-+    fp = fopen(pszTmpPath, "w+");
9
-     if (!fp)
10
-     {
11
-         err = errno;
12
-@@ -630,6 +630,11 @@
13
-     fclose(fp);
14
-     fp = NULL;
15
- 
16
-+    if (chmod(pszTmpPath, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) != 0)
17
-+    {
18
-+        bail_on_error(errno);
19
-+    }
20
-+
21
-     if (rename(pszTmpPath, pszPath) < 0)
22
-     {
23
-         err = errno;
24
-diff -uNr nm1/src/netmgr.c nm2/src/netmgr.c
25
-+++ nm2/src/netmgr.c	2016-06-03 17:03:42.345225428 +0000
26
-@@ -241,11 +241,13 @@
27
- 
28
-     if (strlen(pszDuid) == 0)
29
-     {
30
--        err = set_key_value(cfgFileName, szSectionName, szKey, NULL, 0);
31
-+        err = set_key_value(cfgFileName, szSectionName, szKey, NULL,
32
-+                            F_CREATE_CFG_FILE);
33
-     }
34
-     else
35
-     {
36
--        err = set_key_value(cfgFileName, szSectionName, szKey, pszDuid, 0);
37
-+        err = set_key_value(cfgFileName, szSectionName, szKey, pszDuid,
38
-+                            F_CREATE_CFG_FILE);
39
-     }
40
-     bail_on_error(err);
41
- 
42 1
deleted file mode 100644
... ...
@@ -1,56 +0,0 @@
1
-diff -uNr nm1/src/iniparser.c nm2/src/iniparser.c
2
-+++ nm2/src/iniparser.c	2016-06-16 01:34:40.587238993 +0000
3
-@@ -537,7 +537,8 @@
4
-     )
5
- {
6
-     uint32_t err = 0;
7
--    PKEYVALUE_INI pCursor = NULL;
8
-+    PKEYVALUE_INI *pCursor = NULL;
9
-+    PKEYVALUE_INI pCandidate = NULL;
10
- 
11
-     if (!pSection || !pszKey || !*pszKey)
12
-     {
13
-@@ -545,29 +546,22 @@
14
-         bail_on_error(err);
15
-     }
16
- 
17
--    pCursor = pSection->pKeyValue;
18
--    while (pCursor)
19
-+    pCursor = &pSection->pKeyValue;
20
-+    while (*pCursor)
21
-     {
22
--        PKEYVALUE_INI pCandidate = NULL;
23
--
24
--        if (!strcmp(pCursor->pszKey, pszKey))
25
-+        if (!strcmp((*pCursor)->pszKey, pszKey))
26
-         {
27
--            pCandidate = pCursor;
28
--
29
--            if (pCursor == pSection->pKeyValue)
30
--            {
31
--                pSection->pKeyValue = pCursor->pNext;
32
--            }
33
-+            pCandidate = *pCursor;
34
-+            *pCursor = pCandidate->pNext;
35
-+            break;
36
-         }
37
-+        pCursor = &(*pCursor)->pNext;
38
-+    }
39
- 
40
--        pCursor = pCursor->pNext;
41
--
42
--        if (pCandidate)
43
--        {
44
--            pCandidate->pNext = NULL;
45
--
46
--            ini_cfg_free_keyvalue(pCandidate);
47
--        }
48
-+    if (pCandidate)
49
-+    {
50
-+        pCandidate->pNext = NULL;
51
-+        ini_cfg_free_keyvalue(pCandidate);
52
-     }
53
- 
54
- error:
55
-
... ...
@@ -1,20 +1,18 @@
1 1
 Summary:       PhotonOS Network Management Utilities
2 2
 Name:          netmgmt
3
-Version:       1.0.1
4
-Release:       5%{?dist}
3
+Version:       1.0.3
4
+Release:       1%{?dist}
5 5
 Group:         Applications/System
6 6
 Vendor:        VMware, Inc.
7 7
 License:       Apache2.0
8 8
 URL:           http://www.vmware.com
9 9
 Source0:       %{name}-%{version}.tar.gz
10
-Patch0:        netmgmt-cmdline-err-code-fix.patch
11
-Patch1:        netmgmt-file-perm-and-retval-fix.patch
12
-Patch2:        netmgmt-ini-parser-linklist-delete-fix.patch
13 10
 Distribution:  Photon
14 11
 BuildRequires: autoconf
15 12
 BuildRequires: glib-devel
16 13
 Requires:      glib
17
-%define sha1 netmgmt=b297d7fb04f1103e780a35ed739c402d6d474a6d
14
+Requires:      systemd >= 228
15
+%define sha1 netmgmt=c81f2226cac089a1d79d118ecca7f0a2ef873140
18 16
 
19 17
 %description
20 18
 Network management utilities for PhotonOS
... ...
@@ -29,9 +27,6 @@ header files and libraries for netmgmt
29 29
 
30 30
 %prep
31 31
 %setup -q
32
-%patch0 -p1
33
-%patch1 -p1
34
-%patch2 -p1
35 32
 
36 33
 %build
37 34
 autoreconf -mif
... ...
@@ -63,6 +58,8 @@ find %{buildroot} -name '*.la' -delete
63 63
 # %doc ChangeLog README COPYING
64 64
 
65 65
 %changelog
66
+*	Fri  Jul 08 2016 Vinay Kulkarni <kulkarniv@vmware.com> 1.0.3-1
67
+-	Update set/get dns_servers, duid, iaid APIs.
66 68
 *	Wed  Jun 15 2016 Vinay Kulkarni <kulkarniv@vmware.com> 1.0.1-5
67 69
 -	Fix linklist delete bug in iniparser.
68 70
 *	Fri  Jun 03 2016 Vinay Kulkarni <kulkarniv@vmware.com> 1.0.1-4