Browse code

update c-rest-engine, lightwave, pmd

Change-Id: I92e3b8ac61568a73857fb8ba0c7ffc1fcc556c19
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4410
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Kumar Kaushik <kaushikk@vmware.com>

Priyesh Padmavilasom authored on 2017/11/30 14:52:51
Showing 10 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,13 @@
0
+diff --git a/server/restengine/httpUtilsInternal.c b/server/restengine/httpUtilsInternal.c
1
+index edc4033..ad7203f 100644
2
+--- a/server/restengine/httpUtilsInternal.c
3
+@@ -520,7 +520,7 @@ VmRESTCopyConfig(
4
+ 
5
+     if (!(IsNullOrEmptyString(pConfig->pszDebugLogFile)))
6
+     {
7
+-        strncpy(pRESTConfig->pszDebugLogFile, pConfig->pszDebugLogFile, (MAX_DEAMON_NAME_LEN - 1));
8
++        strncpy(pRESTConfig->pszDebugLogFile, pConfig->pszDebugLogFile, (MAX_PATH_LEN - 1));
9
+     }
10
+ 
11
+     if (!(IsNullOrEmptyString(pConfig->pszDaemonName)))
... ...
@@ -1,7 +1,7 @@
1 1
 Name:          c-rest-engine
2 2
 Summary:       minimal http(s) server library
3
-Version:       1.0.5
4
-Release:       2%{?dist}
3
+Version:       1.1
4
+Release:       1%{?dist}
5 5
 Group:         Applications/System
6 6
 Vendor:        VMware, Inc.
7 7
 License:       Apache 2.0
... ...
@@ -10,8 +10,14 @@ Requires:      openssl >= 1.0.1
10 10
 BuildRequires: coreutils >= 8.22
11 11
 BuildRequires: openssl-devel >= 1.0.1
12 12
 Source0:       %{name}-%{version}.tar.gz
13
-%define sha1   c-rest-engine=f846acf51e5d8b31d73d78c3d55c14e887208064
14 13
 Patch0:        c-rest-engine-aarch64.patch
14
+Patch1:        socket_RW.patch
15
+Patch2:        syslog_noInit.patch
16
+Patch3:        socket_logging.patch
17
+Patch4:        c-rest-engine-fix-log-file-len.patch
18
+Patch5:        errno_init.patch
19
+Patch6:        ssl_shutdown.patch
20
+%define sha1   c-rest-engine=a25927fd98ec92df5e210cc4941fa626604636f6
15 21
 
16 22
 %description
17 23
 c-rest-engine is a minimal embedded http(s) server written in C.
... ...
@@ -29,6 +35,12 @@ development libs and header files for c-rest-engine
29 29
 %prep
30 30
 %setup -q
31 31
 %patch0 -p1
32
+%patch1 -p1
33
+%patch2 -p1
34
+%patch3 -p1
35
+%patch4 -p1
36
+%patch5 -p1
37
+%patch6 -p1
32 38
 
33 39
 %build
34 40
 cd build
... ...
@@ -62,6 +74,8 @@ find %{buildroot} -name '*.la' -delete
62 62
 # %doc ChangeLog README COPYING
63 63
 
64 64
 %changelog
65
+*  Thu Nov 23 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.1-1
66
+-  Update to v1.1-1
65 67
 *  Tue Nov 14 2017 Alexey Makhalov <amakhalov@vmware.com> 1.0.5-2
66 68
 -  Aarch64 support
67 69
 *  Thu Nov 02 2017 Kumar Kaushik <kaushikk@vmware.com> 1.0.5-1
68 70
new file mode 100644
... ...
@@ -0,0 +1,111 @@
0
+From b9a3185e4556e8c5785a60fb57c2924bbd0529f7 Mon Sep 17 00:00:00 2001
1
+From: Kumar Kaushik <kaushikk@vmware.com>
2
+Date: Wed, 29 Nov 2017 18:47:39 -0800
3
+Subject: [PATCH] Avoiding previous errno variable use
4
+
5
+Change-Id: I76b0ef967df8b1ad6fa1844e1e461af470bb3b0f
6
+---
7
+ transport/posix/socket.c | 51 +++++++++++++++++++++++++++++++-----------------
8
+ 1 file changed, 33 insertions(+), 18 deletions(-)
9
+
10
+diff --git a/transport/posix/socket.c b/transport/posix/socket.c
11
+index 79c7a38..d3a3dbc 100644
12
+--- a/transport/posix/socket.c
13
+@@ -853,6 +853,8 @@ VmSockPosixRead(
14
+     do
15
+     {
16
+         nRead = 0;
17
++        errno = 0;
18
++        errorCode = 0;
19
+         if (pRESTHandle->pSSLInfo->isSecure && (pSocket->ssl != NULL))
20
+         {
21
+             nRead = SSL_read(pSocket->ssl, (pszBufPrev + nPrevBuf), MAX_DATA_BUFFER_LEN);
22
+@@ -864,7 +866,7 @@ VmSockPosixRead(
23
+             errorCode = errno;
24
+         }
25
+ 
26
+-        if ((nRead > 0) && (nRead <= MAX_DATA_BUFFER_LEN))
27
++        if (nRead > 0)
28
+         {
29
+             nPrevBuf += nRead;
30
+             dwError = VmRESTReallocateMemory(
31
+@@ -877,22 +879,6 @@ VmSockPosixRead(
32
+         }
33
+     }while((nRead > 0) && (nPrevBuf < pRESTHandle->pRESTConfig->maxDataPerConnMB));
34
+ 
35
+-    if (((pSocket->fd > 0) && (errorCode == EAGAIN || errorCode == EWOULDBLOCK)) || ((pRESTHandle->pSSLInfo->isSecure) && (errorCode == SSL_ERROR_WANT_READ)))
36
+-    {
37
+-        dwError = REST_ENGINE_SUCCESS;
38
+-    }
39
+-    else if (nRead < 0)
40
+-    {
41
+-        VMREST_LOG_ERROR(pRESTHandle, "Socket read failed with error code %u", errorCode);
42
+-        dwError = errorCode;
43
+-    }
44
+-    else if (nRead == 0)
45
+-    {
46
+-        VMREST_LOG_ERROR(pRESTHandle,"%s", "Socket read failed due to broken pipe");
47
+-        dwError = VM_SOCK_POSIX_ERROR_BROKEN_PIPE;
48
+-    }
49
+-    BAIL_ON_VMREST_ERROR(dwError);
50
+-
51
+     if (nPrevBuf >= pRESTHandle->pRESTConfig->maxDataPerConnMB)
52
+     {
53
+         /**** Discard the request here itself. This might be the first read IO cycle ****/
54
+@@ -901,6 +887,33 @@ VmSockPosixRead(
55
+     }
56
+     BAIL_ON_VMREST_ERROR(dwError);
57
+ 
58
++    if (nRead == -1)
59
++    {
60
++        if (((pSocket->fd > 0) && (errorCode == EAGAIN || errorCode == EWOULDBLOCK)) || ((pRESTHandle->pSSLInfo->isSecure) && (errorCode == SSL_ERROR_WANT_READ)))
61
++        {
62
++            dwError = REST_ENGINE_SUCCESS;
63
++        }
64
++        else
65
++        {
66
++            VMREST_LOG_ERROR(pRESTHandle,"%s","Unknown socket read error: errno %u, errorCode %u, nRead %d", errno, errorCode, nRead);
67
++            dwError = REST_ENGINE_FAILURE;
68
++        }
69
++    }
70
++    else
71
++    {
72
++        if (nRead == 0)
73
++        {
74
++            VMREST_LOG_ERROR(pRESTHandle,"%s","Socket Read Failed: Remote has closed the connection");
75
++            dwError = VM_SOCK_POSIX_ERROR_BROKEN_PIPE;
76
++        }
77
++        else
78
++        {
79
++            VMREST_LOG_ERROR(pRESTHandle, "Socket read failed with error code %u", errorCode);
80
++            dwError = errorCode;
81
++        }
82
++    }
83
++    BAIL_ON_VMREST_ERROR(dwError);
84
++
85
+     pSocket->pszBuffer = pszBufPrev;
86
+     pSocket->nProcessed = 0;
87
+     pSocket->nBufData = nPrevBuf;
88
+@@ -933,11 +946,12 @@ VmSockPosixRead(
89
+     if (pszBufPrev && pSocket && pRESTHandle->pSockContext)
90
+     {
91
+         /**** Delete the socket from poller ****/
92
++        
93
+         VmSockPosixEventQueueDelete_inlock(
94
+             pRESTHandle->pSockContext->pEventQueue,
95
+             pSocket
96
+             );
97
+-
98
++        
99
+         VmRESTFreeMemory(pszBufPrev);
100
+         pszBufPrev = NULL;
101
+         pSocket->pszBuffer = NULL;
102
+@@ -1566,6 +1580,7 @@ VmSockPosixSetRequestHandle(
103
+                       pSocket
104
+                       );
105
+         BAIL_ON_VMREST_ERROR(dwError);
106
++       
107
+ 
108
+         if (pSocket->pTimerSocket->fd > 0)
109
+         {
0 110
new file mode 100644
... ...
@@ -0,0 +1,54 @@
0
+diff -ru c-rest-engine-1.1/transport/posix/defines.h c-rest-engine-1.1-modified/transport/posix/defines.h
1
+--- c-rest-engine-1.1/transport/posix/defines.h	2017-10-31 11:20:36.000000000 -0700
2
+@@ -50,6 +50,7 @@
3
+ 
4
+ /**** Transport internal error codes ****/
5
+ #define VM_SOCK_POSIX_ERROR_SYS_CALL_FAILED    5100
6
++#define VM_SOCK_POSIX_ERROR_BROKEN_PIPE        5101
7
+ #define MAX_RETRY_ATTEMPTS                     50000
8
+ 
9
+ 
10
+diff -ru c-rest-engine-1.1/transport/posix/socket.c c-rest-engine-1.1-modified/transport/posix/socket.c
11
+--- c-rest-engine-1.1/transport/posix/socket.c	2017-10-31 11:20:36.000000000 -0700
12
+@@ -879,10 +879,16 @@
13
+     {
14
+         dwError = REST_ENGINE_SUCCESS;
15
+     }
16
+-    else
17
++    else if (nRead < 0)
18
+     {
19
++        VMREST_LOG_ERROR(pRESTHandle, "Socket read failed with error code %u", errorCode);
20
+         dwError = errorCode;
21
+     }
22
++    else if (nRead == 0)
23
++    {
24
++        VMREST_LOG_ERROR(pRESTHandle,"%s", "Socket read failed due to broken pipe");
25
++        dwError = VM_SOCK_POSIX_ERROR_BROKEN_PIPE;
26
++    }
27
+     BAIL_ON_VMREST_ERROR(dwError);
28
+ 
29
+     if (nPrevBuf >= pRESTHandle->pRESTConfig->maxDataPerConnMB)
30
+@@ -980,7 +986,7 @@
31
+              nWritten = write(pSocket->fd, (pszBuffer + nWrittenTotal) ,nRemaining);
32
+              errorCode = errno;
33
+          }
34
+-         if (nWritten >= 0)
35
++         if (nWritten > 0)
36
+          {
37
+              nWrittenTotal += nWritten;
38
+              nRemaining -= nWritten;
39
+@@ -1017,6 +1023,12 @@
40
+                      BAIL_ON_VMREST_ERROR(dwError);
41
+                  }
42
+              }
43
++             else
44
++             {
45
++                 dwError = VM_SOCK_POSIX_ERROR_SYS_CALL_FAILED;
46
++                 VMREST_LOG_ERROR(pRESTHandle,"Socket write failed with error code %u, dwError %u, nWritten %d", errorCode, dwError, nWritten);
47
++                 BAIL_ON_VMREST_ERROR(dwError);
48
++             }
49
+         }
50
+     }
51
+     VMREST_LOG_DEBUG(pRESTHandle,"\nWrite Status on Socket with fd = %d\nRequested: %d nBufLen\nWritten %d bytes\n", pSocket->fd, nBufLen, nWrittenTotal);
0 52
new file mode 100644
... ...
@@ -0,0 +1,94 @@
0
+From 8afe888fb34b1d121bae7701c51d0e7d0c96cbb5 Mon Sep 17 00:00:00 2001
1
+From: Kumar Kaushik <kaushikk@vmware.com>
2
+Date: Mon, 20 Nov 2017 15:21:56 -0800
3
+Subject: [PATCH] Adding more debug for socket read failures
4
+
5
+Change-Id: I85b10413b4fe9273a11e46da038aa2e31ffd0318
6
+(cherry picked from commit a0c4357aca99a08a28d10875aff87c6e3d1798be)
7
+---
8
+ common/sockinterface.c   | 11 +++++------
9
+ transport/posix/socket.c | 27 ++++++++++++++++++++++++++-
10
+ 2 files changed, 31 insertions(+), 7 deletions(-)
11
+
12
+diff --git a/common/sockinterface.c b/common/sockinterface.c
13
+index a53c4a5..403189c 100644
14
+--- a/common/sockinterface.c
15
+@@ -521,11 +521,10 @@ VmRESTTcpReceiveNewData(
16
+    {
17
+        VMREST_LOG_DEBUG(pRESTHandle,"%s","Calling closed connection....");
18
+        /**** Close connection ****/ 
19
+-       dwError = VmRESTDisconnectClient(
20
+-                     pRESTHandle,
21
+-                     pSocket
22
+-                     );
23
+-       BAIL_ON_VMREST_ERROR(dwError);
24
++       VmRESTDisconnectClient(
25
++           pRESTHandle,
26
++           pSocket
27
++           );
28
+ 
29
+        /****  free request object memory ****/
30
+        if (pRequest)
31
+@@ -542,7 +541,7 @@ VmRESTTcpReceiveNewData(
32
+ 
33
+ error:
34
+ 
35
+-    VMREST_LOG_DEBUG(pRESTHandle,"ERROR code %u", dwError);
36
++    VMREST_LOG_ERROR(pRESTHandle,"ERROR code %u", dwError);
37
+     goto cleanup;
38
+ }
39
+ 
40
+diff --git a/transport/posix/socket.c b/transport/posix/socket.c
41
+index 029633a..79c7a38 100644
42
+--- a/transport/posix/socket.c
43
+@@ -539,6 +539,8 @@ VmSockPosixWaitForEvent(
44
+                 BAIL_ON_VMREST_ERROR(dwError);
45
+             }
46
+ 
47
++            VMREST_LOG_DEBUG(pRESTHandle,"Notification on socket fd %d", pEventSocket->fd);
48
++
49
+             if (pEvent->events & (EPOLLERR | EPOLLHUP))
50
+             {
51
+                 eventType = VM_SOCK_EVENT_TYPE_CONNECTION_CLOSED;
52
+@@ -919,8 +921,23 @@ VmSockPosixRead(
53
+ 
54
+ error:
55
+ 
56
+-    if (pszBufPrev && pSocket)
57
++    if (pSocket)
58
++    {
59
++        VMREST_LOG_ERROR(pRESTHandle,"Socket read failed with Socket fd %d, dwError = %u, nRead = %d, errno = %u, errorCode = %u", pSocket->fd, dwError, nRead, errno, errorCode);
60
++    }
61
++    else
62
++    {
63
++        VMREST_LOG_ERROR(pRESTHandle,"Socket read failed with dwError = %u, nRead = %d, errno = %u, errorCode = %u", dwError, nRead, errno, errorCode);
64
++    }
65
++
66
++    if (pszBufPrev && pSocket && pRESTHandle->pSockContext)
67
+     {
68
++        /**** Delete the socket from poller ****/
69
++        VmSockPosixEventQueueDelete_inlock(
70
++            pRESTHandle->pSockContext->pEventQueue,
71
++            pSocket
72
++            );
73
++
74
+         VmRESTFreeMemory(pszBufPrev);
75
+         pszBufPrev = NULL;
76
+         pSocket->pszBuffer = NULL;
77
+@@ -1542,6 +1559,14 @@ VmSockPosixSetRequestHandle(
78
+                       pSocket->pTimerSocket
79
+                       );
80
+         BAIL_ON_VMREST_ERROR(dwError);
81
++
82
++        /**** Delete actual IO socket from poller ****/
83
++        dwError = VmSockPosixEventQueueDelete_inlock(
84
++                      pQueue,
85
++                      pSocket
86
++                      );
87
++        BAIL_ON_VMREST_ERROR(dwError);
88
++
89
+         if (pSocket->pTimerSocket->fd > 0)
90
+         {
91
+             close(pSocket->pTimerSocket->fd);
0 92
new file mode 100644
... ...
@@ -0,0 +1,123 @@
0
+From a7aba08f7fd2700c92fd9661eee212755ba8795e Mon Sep 17 00:00:00 2001
1
+From: Kumar Kaushik <kaushikk@vmware.com>
2
+Date: Thu, 7 Dec 2017 12:53:17 -0800
3
+Subject: [PATCH] Fixing tls: unexpected message ERROR
4
+
5
+Change-Id: I63dce89d4dcfa445b6594d4b776ef8827f1498ff
6
+(cherry picked from commit 424f6d0f3435eccad781d39ef0c656a00395dc46)
7
+---
8
+ transport/posix/socket.c | 34 +++++++++++++++++++++++-----------
9
+ 1 file changed, 23 insertions(+), 11 deletions(-)
10
+
11
+diff --git a/transport/posix/socket.c b/transport/posix/socket.c
12
+index d3a3dbc..18cef89 100644
13
+--- a/transport/posix/socket.c
14
+@@ -576,7 +576,6 @@ VmSockPosixWaitForEvent(
15
+                                    FALSE
16
+                                    );
17
+                     BAIL_ON_VMREST_ERROR(dwError);
18
+-                
19
+                 }
20
+ 
21
+                 dwError = VmSockPosixEventQueueAdd_inlock(
22
+@@ -895,7 +894,7 @@ VmSockPosixRead(
23
+         }
24
+         else
25
+         {
26
+-            VMREST_LOG_ERROR(pRESTHandle,"%s","Unknown socket read error: errno %u, errorCode %u, nRead %d", errno, errorCode, nRead);
27
++            VMREST_LOG_ERROR(pRESTHandle,"Unknown socket read error: errno %u, errorCode %u, nRead %d", errno, errorCode, nRead);
28
+             dwError = REST_ENGINE_FAILURE;
29
+         }
30
+     }
31
+@@ -1007,6 +1006,9 @@ VmSockPosixWrite(
32
+ 
33
+     while(nWrittenTotal < nBufLen )
34
+     {
35
++         nWritten = 0;
36
++         errorCode = 0;
37
++         errno = 0;
38
+          if (pRESTHandle->pSSLInfo->isSecure && (pSocket->ssl != NULL))
39
+          {
40
+              nWritten = SSL_write(pSocket->ssl,(pszBuffer + nWrittenTotal),nRemaining);
41
+@@ -1030,7 +1032,7 @@ VmSockPosixWrite(
42
+          }
43
+          else
44
+          {
45
+-             if (errorCode == EAGAIN || errorCode == EWOULDBLOCK || errorCode == SSL_ERROR_WANT_WRITE)
46
++             if ((nWritten < 0) && (errorCode == EAGAIN || errorCode == EWOULDBLOCK || errorCode == SSL_ERROR_WANT_WRITE))
47
+              {
48
+                  if (timeOutSec >= 0)
49
+                  {
50
+@@ -1101,6 +1103,8 @@ VmSockPosixCloseSocket(
51
+     )
52
+ {
53
+     DWORD                            dwError = REST_ENGINE_SUCCESS;
54
++    int                              ret = 0;
55
++    uint32_t                         errorCode = 0;
56
+     BOOLEAN                          bLocked = FALSE;
57
+ 
58
+     if (!pRESTHandle || !pSocket )
59
+@@ -1121,18 +1125,24 @@ VmSockPosixCloseSocket(
60
+         pSocket->pTimerSocket->fd = -1;
61
+     }
62
+ 
63
++    if (pRESTHandle->pSSLInfo->isSecure && pSocket->ssl)
64
++    {
65
++        ret = SSL_shutdown(pSocket->ssl);
66
++        if (ret < 0)
67
++        {
68
++            errorCode = SSL_get_error(pSocket->ssl, ret);
69
++            VMREST_LOG_ERROR(pRESTHandle,"Error on SSL_shutdown on socket %d, return value %d, errorCode %u", pSocket->fd, ret, errorCode);
70
++        }
71
++        SSL_free(pSocket->ssl);
72
++        pSocket->ssl = NULL;
73
++    }
74
++
75
+     if (pSocket->fd >= 0)
76
+     {
77
+         close(pSocket->fd);
78
+         pSocket->fd = -1;
79
+     }
80
+ 
81
+-    if (pRESTHandle->pSSLInfo->isSecure && pSocket->ssl)
82
+-    {
83
+-        SSL_shutdown(pSocket->ssl);
84
+-        SSL_free(pSocket->ssl);
85
+-        pSocket->ssl = NULL;
86
+-    }
87
+ 
88
+ cleanup:
89
+ 
90
+@@ -1742,6 +1752,7 @@ VmSockPosixIsSafeToCloseConnOnTimeOut(
91
+     BAIL_ON_VMREST_ERROR(dwError);
92
+ 
93
+     pSocket = pTimerSocket->pIoSocket;
94
++    errno = 0;
95
+ 
96
+     if ((pRESTHandle->pSSLInfo->isSecure) && (pSocket->ssl))
97
+     {
98
+@@ -1771,6 +1782,7 @@ VmSockPosixIsSafeToCloseConnOnTimeOut(
99
+             do
100
+             {
101
+                 errorCode = 0;
102
++                errno = 0;
103
+                 nRead = 0;
104
+                 nRead = read(pTimerSocket->fd, &res, sizeof(res));
105
+                 errorCode = errno;
106
+@@ -1918,13 +1930,13 @@ VmRESTAcceptSSLContext(
107
+     }
108
+     else if ((ret == -1) && ((errorCode == SSL_ERROR_WANT_READ) || (errorCode == SSL_ERROR_WANT_WRITE)))
109
+     {
110
+-       VMREST_LOG_DEBUG(pRESTHandle,"SSL handshake not completed for socket %d", pSocket->fd);
111
++       VMREST_LOG_DEBUG(pRESTHandle," SSL handshake not completed for socket %d, ret %d, errorCode %u", pSocket->fd, ret, errorCode);
112
+        pSocket->bSSLHandShakeCompleted = FALSE;
113
+        bReArm = TRUE;
114
+     }
115
+     else
116
+     {
117
+-        VMREST_LOG_ERROR(pRESTHandle, "SSL handshake failed...connection will be closed for socket with fd %d", pSocket->fd);
118
++        VMREST_LOG_ERROR(pRESTHandle, "SSL handshake failed...connection will be closed for socket with fd %d, ret %d, errorCode %u", pSocket->fd, ret, errorCode);
119
+         dwError = VMREST_TRANSPORT_SSL_ACCEPT_FAILED;
120
+         BAIL_ON_VMREST_ERROR(dwError);
121
+     }
0 122
new file mode 100644
... ...
@@ -0,0 +1,151 @@
0
+From 56c8c0ffd82c8fe8c396d8c00f23688adcdc9ecd Mon Sep 17 00:00:00 2001
1
+From: Kumar Kaushik <kaushikk@vmware.com>
2
+Date: Wed, 15 Nov 2017 17:24:44 -0800
3
+Subject: [PATCH] Remove init/shutdown of syslog from library
4
+
5
+Change-Id: I7705f44c468d2ce69a15b531e108ef0cfbe391b8
6
+---
7
+ build/package/rpm/c-rest-engine.spec |  4 +++-
8
+ common/logging.c                     | 45 ++++++++----------------------------
9
+ server/vmrestd/main.c                |  8 ++++++-
10
+ 3 files changed, 20 insertions(+), 37 deletions(-)
11
+
12
+diff --git a/build/package/rpm/c-rest-engine.spec b/build/package/rpm/c-rest-engine.spec
13
+index 8730113..02c1e62 100644
14
+--- a/build/package/rpm/c-rest-engine.spec
15
+@@ -1,7 +1,7 @@
16
+ Name:          c-rest-engine
17
+ Summary:       Minimal http(s) server library
18
+ Version:       1.1
19
+-Release:       1%{?dist}
20
++Release:       3%{?dist}
21
+ Group:         Applications/System
22
+ Vendor:        VMware, Inc.
23
+ License:       Apache 2.0
24
+diff --git a/common/logging.c b/common/logging.c
25
+index 6bef25c..385c0b6 100644
26
+--- a/common/logging.c
27
+@@ -41,13 +41,7 @@ VmRESTLogInitialize(
28
+     }
29
+     BAIL_ON_VMREST_ERROR(dwError);
30
+ 
31
+-    if (pRESTHandle->pRESTConfig->useSysLog)
32
+-    {
33
+-        /**** Use syslog ****/
34
+-        openlog(pRESTHandle->pRESTConfig->pszDaemonName, 0, LOG_DAEMON);
35
+-        setlogmask(LOG_UPTO(logLevelToSysLogLevel(pRESTHandle->debugLogLevel)));
36
+-    }
37
+-    else if (!(IsNullOrEmptyString(pRESTHandle->pRESTConfig->pszDebugLogFile)))
38
++    if ((!(IsNullOrEmptyString(pRESTHandle->pRESTConfig->pszDebugLogFile))) && (pRESTHandle->pRESTConfig->useSysLog == FALSE))
39
+     {
40
+         if ((pRESTHandle->logFile = fopen(pRESTHandle->pRESTConfig->pszDebugLogFile, "a")) == NULL)
41
+         {
42
+@@ -55,10 +49,6 @@ VmRESTLogInitialize(
43
+             dwError = REST_ENGINE_FAILURE;
44
+         }
45
+     }
46
+-    else
47
+-    {
48
+-        dwError = REST_ENGINE_FAILURE;
49
+-    }
50
+     BAIL_ON_VMREST_ERROR(dwError);
51
+ 
52
+ cleanup:
53
+@@ -76,11 +66,7 @@ VmRESTLogTerminate(
54
+     PVMREST_HANDLE                   pRESTHandle
55
+     )
56
+ {
57
+-    if (pRESTHandle && pRESTHandle->pRESTConfig->useSysLog)
58
+-    {
59
+-        closelog();
60
+-    }
61
+-    else if (pRESTHandle && pRESTHandle->logFile != NULL)
62
++    if (pRESTHandle && pRESTHandle->logFile != NULL)
63
+     {
64
+        fclose(pRESTHandle->logFile);
65
+        pRESTHandle->logFile = NULL;
66
+@@ -95,10 +81,9 @@ VmRESTLog(
67
+     ...)
68
+ {
69
+     char        extraLogMessage[EXTRA_LOG_MESSAGE_LEN] = {0};
70
+-    struct      timespec tspec = {0};
71
+-    time_t      ltime;
72
+-    struct      tm mytm = {0};
73
+     char        logMessage[MAX_LOG_MESSAGE_LEN];
74
++    struct      tm* tm_info = NULL;
75
++    struct      timeval tv = {0};
76
+ 	
77
+     va_list     va;
78
+     const char* logLevelTag = "";
79
+@@ -115,30 +100,20 @@ VmRESTLog(
80
+         vsnprintf( logMessage, sizeof(logMessage), fmt, va );
81
+         logMessage[sizeof(logMessage)-1] = '\0';
82
+         va_end( va );
83
+-        ltime = time(&ltime);
84
++        gettimeofday(&tv, NULL);
85
++
86
++        tm_info = localtime(&tv.tv_sec);
87
+         logLevelTag = logLevelToTag(level);
88
+-        localtime_r(&ltime, &mytm);
89
+-        snprintf(extraLogMessage, sizeof(extraLogMessage) - 1,
90
+-                  "%4d%2d%2d%2d%2d%2d.%03ld:t@%lu:%-3.7s: ",
91
+-                  mytm.tm_year+1900,
92
+-                  mytm.tm_mon+1,
93
+-                  mytm.tm_mday,
94
+-                  mytm.tm_hour,
95
+-                  mytm.tm_min,
96
+-                  mytm.tm_sec,
97
+-                  tspec.tv_nsec/NSECS_PER_MSEC,
98
+-                  (unsigned long) pthread_self(),
99
+-                  logLevelTag? logLevelTag : "UNKNOWN");
100
++        strftime(extraLogMessage, sizeof(extraLogMessage) - 1, "%F %T", tm_info);   
101
+ 
102
+         if (pRESTHandle->pRESTConfig->useSysLog)
103
+         {
104
+             sysLogLevel = logLevelToSysLogLevel(level);
105
+-            snprintf(extraLogMessage, sizeof(extraLogMessage) - 1, "t@%lu: ", (unsigned long) pthread_self());
106
+-            syslog(sysLogLevel, "%s: %s%s", logLevelToTag(level), extraLogMessage, logMessage);
107
++            syslog(sysLogLevel, "%s:%lu t@%lu %-3.7s: %s\n", extraLogMessage, (long unsigned)(tv.tv_usec), (unsigned long) pthread_self(),(logLevelTag? logLevelTag : "UNKNOWN"),logMessage);
108
+         }
109
+         else if (pRESTHandle->logFile != NULL)
110
+         {
111
+-            fprintf(pRESTHandle->logFile, "%s%s\n", extraLogMessage, logMessage);
112
++            fprintf(pRESTHandle->logFile, "%s:%lu t@%lu %-3.7s: %s\n", extraLogMessage, (long unsigned)(tv.tv_usec), (unsigned long) pthread_self(),(logLevelTag? logLevelTag : "UNKNOWN"),logMessage);
113
+             fflush( pRESTHandle->logFile );
114
+         }
115
+     }
116
+diff --git a/server/vmrestd/main.c b/server/vmrestd/main.c
117
+index 353f597..214b28d 100644
118
+--- a/server/vmrestd/main.c
119
+@@ -116,7 +116,7 @@ int main()
120
+     pConfig1->maxDataPerConnMB = 10;
121
+     pConfig1->nWorkerThr = 5;
122
+     pConfig1->nClientCnt = 5;
123
+-    pConfig1->useSysLog = FALSE;
124
++    pConfig1->useSysLog = TRUE;
125
+     pConfig1->pszSSLCertificate = "/root/mycert.pem";
126
+     pConfig1->isSecure = TRUE;
127
+     pConfig1->pszSSLKey = "/root/mycert.pem";
128
+@@ -127,6 +127,10 @@ int main()
129
+     pConfig1->pszSSLCipherList = NULL;
130
+     pConfig1->SSLCtxOptionsFlag = 0;
131
+ 
132
++    /**** Init sys log ****/
133
++    openlog("VMREST_KAUSHIK", 0, LOG_DAEMON);
134
++    setlogmask(LOG_UPTO(LOG_DEBUG));
135
++
136
+     dwError = VmRESTInit(pConfig, &gpRESTHandle);
137
+     dwError = VmRESTInit(pConfig1, &gpRESTHandle1);
138
+ 
139
+@@ -177,6 +181,8 @@ int main()
140
+  //   VmRESTShutdownSSL(sslCtx1);
141
+ #endif
142
+ 
143
++    closelog();
144
++
145
+ return dwError;
146
+ 
147
+ }
... ...
@@ -1,14 +1,14 @@
1 1
 Name:          lightwave
2 2
 Summary:       VMware Lightwave
3
-Version:       1.3.1
4
-Release:       5%{?dist}
3
+Version:       1.3.1.7
4
+Release:       1%{?dist}
5 5
 License:       Apache 2.0
6 6
 Group:         Applications/System
7 7
 Vendor:        VMware, Inc.
8 8
 URL: 	       https://github.com/vmware/lightwave
9 9
 Source0:       lightwave-%{version}.tar.gz
10 10
 Patch0:        lightwave-gssapi-unix-creds-separation.patch
11
-%define sha1 lightwave=e8cc3582ffe0586b9b21ef87d9abe4160854e9c4
11
+%define sha1 lightwave=abe987b67aadab05040ac38c11474b8d93fe8644
12 12
 Distribution:  Photon
13 13
 
14 14
 Requires:  apache-tomcat >= 8.5.8
... ...
@@ -27,7 +27,7 @@ Requires:  lightwave-client = %{version}
27 27
 BuildRequires: ant-contrib >= 1.0
28 28
 BuildRequires: apache-maven >= 3.3.9
29 29
 BuildRequires: boost-devel = 1.63.0
30
-BuildRequires: c-rest-engine-devel
30
+BuildRequires: c-rest-engine-devel >= 1.1
31 31
 BuildRequires: commons-daemon >= 1.0.15
32 32
 BuildRequires: copenapi-devel
33 33
 BuildRequires: coreutils >= 8.22
... ...
@@ -41,6 +41,7 @@ BuildRequires: openssl-devel >= 1.0.2
41 41
 BuildRequires: python2-devel >= 2.7.8
42 42
 BuildRequires: sqlite-devel >= 3.14
43 43
 BuildRequires: go
44
+BuildRequires: binutils
44 45
 
45 46
 %description
46 47
 VMware Lightwave Server
... ...
@@ -94,7 +95,7 @@ Client libraries to communicate with Lightwave Services
94 94
 
95 95
 %package client
96 96
 Summary: Lightwave Client
97
-Requires: c-rest-engine
97
+Requires: c-rest-engine >= 1.1
98 98
 Requires: copenapi
99 99
 Requires: coreutils >= 8.22
100 100
 Requires: cyrus-sasl >= 2.1
... ...
@@ -915,6 +916,9 @@ fi
915 915
 %{_datadir}/config/vmdns-rest.json
916 916
 %{_datadir}/config/vmdnsd-syslog-ng.conf
917 917
 %{_datadir}/config/idm/*
918
+%{_datadir}/config/vmca-telegraf.conf
919
+%{_datadir}/config/vmdir-telegraf.conf
920
+%{_datadir}/config/vmdns-telegraf.conf
918 921
 
919 922
 %{_jarsdir}/openidconnect-client-lib.jar
920 923
 %{_jarsdir}/openidconnect-common.jar
... ...
@@ -939,13 +943,23 @@ fi
939 939
 %{_jarsdir}/log4j-api-2.8.2.jar
940 940
 %{_jarsdir}/log4j-slf4j-impl-2.8.2.jar
941 941
 %{_jarsdir}/log4j-core-2.8.2.jar
942
+%{_jarsdir}/args4j-2.33.jar
943
+%{_jarsdir}/commons-codec-1.9.jar
944
+%{_jarsdir}/commons-lang3-3.3.2.jar
945
+%{_jarsdir}/httpcore-4.4.4.jar
946
+%{_jarsdir}/jackson-annotations-2.8.4.jar
947
+%{_jarsdir}/jackson-core-2.8.4.jar
948
+%{_jarsdir}/jackson-databind-2.8.4.jar
949
+%{_jarsdir}/jersey-media-json-jackson-2.25.1.jar
950
+%{_jarsdir}/json-smart-1.3.1.jar
951
+%{_jarsdir}/nimbus-jose-jwt-4.12.jar
942 952
 
943 953
 
944 954
 %{_webappsdir}/lightwaveui.war
945 955
 %{_webappsdir}/ROOT.war
946 956
 
947
-%{_configdir}/firewall.json
948 957
 %{_configdir}/setfirewallrules.py
958
+%{_configdir}/lw-firewall-server.json
949 959
 
950 960
 %{_servicedir}/firewall.service
951 961
 %{_servicedir}/vmware-stsd.service
... ...
@@ -959,6 +973,7 @@ fi
959 959
 %config %attr(600, root, root) %{_prefix}/vmware-sts/conf/server.xml
960 960
 %config %attr(600, root, root) %{_prefix}/vmware-sts/conf/web.xml
961 961
 %config %attr(600, root, root) %{_prefix}/vmware-sts/conf/tomcat-users.xml
962
+%config %attr(600, root, root) %{_prefix}/vmware-sts/conf/vmsts-telegraf.conf
962 963
 
963 964
 %files client-libs
964 965
 %{_lib64dir}/libvmafcfgapi.so*
... ...
@@ -1017,6 +1032,11 @@ fi
1017 1017
 %{_datadir}/config/vmdir-client.reg
1018 1018
 %{_datadir}/config/vmdns-client.reg
1019 1019
 %{_datadir}/config/vmafdd-syslog-ng.conf
1020
+%{_datadir}/config/lw-firewall-client.json
1021
+%{_datadir}/config/refresh-resolve-conf.sh
1022
+%{_datadir}/config/telegraf.conf
1023
+%{_datadir}/config/vmafd-telegraf.conf
1024
+
1020 1025
 
1021 1026
 %{_jreextdir}/vmware-endpoint-certificate-store.jar
1022 1027
 %{_jreextdir}/client-domain-controller-cache.jar
... ...
@@ -1101,11 +1121,10 @@ fi
1101 1101
 %{_sbindir}/postd
1102 1102
 
1103 1103
 %{_bindir}/postadmintool
1104
-%{_bindir}/lwraftleavefed
1105
-%{_bindir}/lwraftaclmgr
1106 1104
 %{_bindir}/lwraftpromo
1107 1105
 %{_bindir}/postschema
1108 1106
 %{_bindir}/post-cli
1107
+%{_bindir}/postaclmgr
1109 1108
 
1110 1109
 %{_lib64dir}/sasl2/libsaslpostdb.so*
1111 1110
 
... ...
@@ -1115,10 +1134,15 @@ fi
1115 1115
 %{_datadir}/config/post.reg
1116 1116
 %{_datadir}/config/postd-syslog-ng.conf
1117 1117
 %{_datadir}/config/post-client.reg
1118
+%{_datadir}/config/lw-firewall-post.json
1119
+%{_datadir}/config/post-demote-deads.sh
1120
+%{_datadir}/config/post-telegraf.conf
1118 1121
 
1119 1122
 # %doc ChangeLog README COPYING
1120 1123
 
1121 1124
 %changelog
1125
+*   Thu Nov 23 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.3.1.7-1
1126
+-   update to lightwave 1.3.1.7 (release 1.3.1-7 in lightwave repo)
1122 1127
 *   Mon Sep 25 2017 Alexey Makhalov <amakhalov@vmware.com> 1.3.1-5
1123 1128
 -   Requires coreutils or toybox
1124 1129
 *   Fri Sep 22 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.3.1-4
1125 1130
new file mode 100644
... ...
@@ -0,0 +1,194 @@
0
+diff --git a/conf/pmd.conf b/conf/pmd.conf
1
+index c4c5a66..f622385 100644
2
+--- a/conf/pmd.conf
3
+@@ -9,6 +9,11 @@ rolepluginsdir=/etc/javelin.roles.plugins.d
4
+ enabled=1
5
+ port=2081
6
+ apispec=/etc/pmd/restapispec.json
7
++sslcert=/etc/pmd/server.crt
8
++sslkey=/etc/pmd/server.key
9
++logfile=/var/log/pmd/restServer.log
10
++client-count=5
11
++worker-thread-count=5
12
+ 
13
+ [rpc-server]
14
+ enabled=1
15
+diff --git a/server/config.c b/server/config.c
16
+index ef42750..e7841a5 100644
17
+--- a/server/config.c
18
+@@ -44,6 +44,21 @@ pmd_get_rest_config(
19
+                                (void **)&pRestConfig);
20
+     BAIL_ON_PMD_ERROR(dwError);
21
+ 
22
++    //set defaults
23
++    pRestConfig->nWorkerThreadCount = PMD_REST_DEFAULT_WORKER_THREAD;
24
++    pRestConfig->nClientCount = PMD_REST_DEFAULT_CLIENTS;
25
++    dwError = PMDAllocateString(PMD_REST_DEFAULT_SSL_CERT,
26
++                                &pRestConfig->pszSSLCert);
27
++    BAIL_ON_PMD_ERROR(dwError);
28
++    dwError = PMDAllocateString(PMD_REST_DEFAULT_SSL_KEY,
29
++                                &pRestConfig->pszSSLKey);
30
++
31
++    BAIL_ON_PMD_ERROR(dwError);
32
++    dwError = PMDAllocateString(PMD_REST_DEFAULT_LOG_FILE,
33
++                                &pRestConfig->pszLogFile);
34
++    BAIL_ON_PMD_ERROR(dwError);
35
++
36
++
37
+     pKeyValues = pSection->pKeyValues;
38
+     for(; pKeyValues; pKeyValues = pKeyValues->pNext)
39
+     {
40
+@@ -55,6 +70,16 @@ pmd_get_rest_config(
41
+         {
42
+             pRestConfig->nPort = atoi(pKeyValues->pszValue);
43
+         }
44
++        else if(!strcmp(PMD_CONFIG_KEY_REST_WORKER_THREAD_COUNT,
45
++                        pKeyValues->pszKey))
46
++        {
47
++            pRestConfig->nWorkerThreadCount = atoi(pKeyValues->pszValue);
48
++        }
49
++        else if(!strcmp(PMD_CONFIG_KEY_REST_CLIENT_COUNT,
50
++                        pKeyValues->pszKey))
51
++        {
52
++            pRestConfig->nClientCount = atoi(pKeyValues->pszValue);
53
++        }
54
+         else if(!strcmp(PMD_CONFIG_KEY_REST_APISPEC, pKeyValues->pszKey))
55
+         {
56
+             dwError = PMDAllocateString(pKeyValues->pszValue,
57
+@@ -66,6 +91,24 @@ pmd_get_rest_config(
58
+             pRestConfig->nUseKerberos =
59
+                 strcmp(pKeyValues->pszValue, "kerberos") == 0;
60
+         }
61
++        else if(!strcmp(PMD_CONFIG_KEY_REST_SSL_CERT, pKeyValues->pszKey))
62
++        {
63
++            dwError = PMDAllocateString(pKeyValues->pszValue,
64
++                                        &pRestConfig->pszSSLCert);
65
++            BAIL_ON_PMD_ERROR(dwError);
66
++        }
67
++        else if(!strcmp(PMD_CONFIG_KEY_REST_SSL_KEY, pKeyValues->pszKey))
68
++        {
69
++            dwError = PMDAllocateString(pKeyValues->pszValue,
70
++                                        &pRestConfig->pszSSLKey);
71
++            BAIL_ON_PMD_ERROR(dwError);
72
++        }
73
++        else if(!strcmp(PMD_CONFIG_KEY_REST_LOG_FILE, pKeyValues->pszKey))
74
++        {
75
++            dwError = PMDAllocateString(pKeyValues->pszValue,
76
++                                        &pRestConfig->pszLogFile);
77
++            BAIL_ON_PMD_ERROR(dwError);
78
++        }
79
+     }
80
+ 
81
+     *ppRestConfig = pRestConfig;
82
+@@ -171,6 +214,9 @@ pmd_free_rest_config(
83
+         return;
84
+     }
85
+     PMD_SAFE_FREE_MEMORY(pRestConf->pszApiSpec);
86
++    PMD_SAFE_FREE_MEMORY(pRestConf->pszLogFile);
87
++    PMD_SAFE_FREE_MEMORY(pRestConf->pszSSLCert);
88
++    PMD_SAFE_FREE_MEMORY(pRestConf->pszSSLKey);
89
+     PMD_SAFE_FREE_MEMORY(pRestConf);
90
+ }
91
+ 
92
+diff --git a/server/defines.h b/server/defines.h
93
+index 513a1f2..43e1022 100644
94
+--- a/server/defines.h
95
+@@ -33,6 +33,11 @@ typedef struct _PMDHANDLE_* PPMDHANDLE;
96
+ #define PMD_CONFIG_KEY_REST_PORT    "port"
97
+ #define PMD_CONFIG_KEY_REST_APISPEC "apispec"
98
+ #define PMD_CONFIG_KEY_REST_AUTH    "authenticate"
99
++#define PMD_CONFIG_KEY_REST_SSL_CERT "sslcert"
100
++#define PMD_CONFIG_KEY_REST_SSL_KEY "sslkey"
101
++#define PMD_CONFIG_KEY_REST_WORKER_THREAD_COUNT "worker-thread-count"
102
++#define PMD_CONFIG_KEY_REST_CLIENT_COUNT "client-count"
103
++#define PMD_CONFIG_KEY_REST_LOG_FILE "logfile"
104
+ 
105
+ #define PMD_CONFIG_KEY_SERVERTYPE "servertype"
106
+ #define PMD_CONFIG_KEY_CURRENTHASH "currenthash"
107
+@@ -51,3 +56,10 @@ typedef struct _PMDHANDLE_* PPMDHANDLE;
108
+ #define PKG_PRIVSEP "pkg_privsep"
109
+ #define NET_PRIVSEP "net_privsep"
110
+ #define USERMGMT_PRIVSEP "usermgmt_privsep"
111
++
112
++#define VMREST_STOP_TIMEOUT_SECS       2
113
++#define PMD_REST_DEFAULT_WORKER_THREAD 5
114
++#define PMD_REST_DEFAULT_CLIENTS       5
115
++#define PMD_REST_DEFAULT_LOG_FILE      "/var/log/pmd/restServer.log"
116
++#define PMD_REST_DEFAULT_SSL_CERT      "/etc/pmd/server.crt"
117
++#define PMD_REST_DEFAULT_SSL_KEY       "/etc/pmd/server.key"
118
+diff --git a/server/restserver.c b/server/restserver.c
119
+index 4f8f337..41d0c13 100644
120
+--- a/server/restserver.c
121
+@@ -22,6 +22,7 @@ StartRestServer(
122
+     PREST_API_DEF pApiDef = NULL;
123
+     PREST_PROCESSOR pRestProcessor = NULL;
124
+     PPMD_REST_CONFIG pRestConfig = NULL;
125
++    REST_CONF stRestConfig = {0};
126
+ 
127
+     MODULE_REG_MAP stRegMap[] =
128
+     {
129
+@@ -46,9 +47,19 @@ StartRestServer(
130
+         BAIL_ON_PMD_ERROR(dwError);
131
+     }
132
+ 
133
++    stRestConfig.serverPort = pRestConfig->nPort;
134
++    stRestConfig.nWorkerThr = pRestConfig->nWorkerThreadCount;
135
++    stRestConfig.nClientCnt = pRestConfig->nClientCount;
136
++    stRestConfig.pszSSLCertificate = pRestConfig->pszSSLCert;
137
++    stRestConfig.pszSSLKey = pRestConfig->pszSSLKey;
138
++    stRestConfig.pszDebugLogFile = pRestConfig->pszLogFile;
139
++    stRestConfig.isSecure = 1;
140
++    stRestConfig.debugLogLevel = VMREST_LOG_LEVEL_ERROR;
141
++    stRestConfig.useSysLog = 1;
142
++fprintf(stdout, "log = %s\n", stRestConfig.pszDebugLogFile);
143
++
144
+     dwError =  VmRESTInit(
145
+-                   NULL,
146
+-                   "/etc/pmd/restconfig.txt",
147
++                   &stRestConfig,
148
+                    &gpServerEnv->pRestHandle);
149
+     BAIL_ON_PMD_ERROR(dwError);
150
+ 
151
+@@ -96,7 +107,7 @@ StopRestServer()
152
+         fprintf(stdout, "rest server not started. skipping stop.\n");
153
+         return;
154
+     }
155
+-    VmRESTStop(gpServerEnv->pRestHandle);
156
++    VmRESTStop(gpServerEnv->pRestHandle, VMREST_STOP_TIMEOUT_SECS);
157
+     gpServerEnv->pRestHandle = NULL;
158
+     fprintf(stdout, "stopped rest server.\n");
159
+ }
160
+diff --git a/server/restutils/restutils.c b/server/restutils/restutils.c
161
+index bf2b9fc..cd0509f 100644
162
+--- a/server/restutils/restutils.c
163
+@@ -387,7 +387,7 @@ get_uri_from_request(
164
+     char *pszURI = NULL;
165
+     char *pszTempURI = NULL;
166
+ 
167
+-    dwError = VmRESTGetHttpURI(pRequest, &pszRealURI);
168
++    dwError = VmRESTGetHttpURI(pRequest, 1, &pszRealURI);
169
+     BAIL_ON_PMD_ERROR(dwError);
170
+ 
171
+     pszTempURI = strchr(pszRealURI, '?');
172
+diff --git a/server/structs.h b/server/structs.h
173
+index 6d17d0a..5714bc7 100644
174
+--- a/server/structs.h
175
+@@ -23,7 +23,12 @@ typedef struct _PMD_REST_CONFIG_
176
+     int nEnabled;
177
+     int nPort;
178
+     int nUseKerberos;
179
++    int nWorkerThreadCount;
180
++    int nClientCount;
181
+     char *pszApiSpec;
182
++    char *pszSSLCert;
183
++    char *pszSSLKey;
184
++    char *pszLogFile;
185
+ }PMD_REST_CONFIG, *PPMD_REST_CONFIG;
186
+ 
187
+ typedef struct _PMD_CONFIG_
... ...
@@ -9,14 +9,14 @@
9 9
 Summary:	Photon Management Daemon
10 10
 Name:		pmd
11 11
 Version:	0.0.5
12
-Release:	3%{?dist}
12
+Release:	4%{?dist}
13 13
 Vendor:		VMware, Inc.
14 14
 Distribution:	Photon
15 15
 License:	Apache 2.0
16 16
 URL:            https://www.github.com/vmware/pmd
17 17
 Group:		Applications/System
18 18
 Requires:       copenapi
19
-Requires:	c-rest-engine
19
+Requires:	c-rest-engine >= 1.1
20 20
 Requires:       jansson
21 21
 Requires:	likewise-open >= 6.2.9
22 22
 Requires:       netmgmt
... ...
@@ -26,7 +26,7 @@ Requires:       lightwave-client-libs
26 26
 Requires:       %{name}-libs = %{version}-%{release}
27 27
 Requires:       shadow
28 28
 BuildRequires:  copenapi-devel
29
-BuildRequires:	c-rest-engine-devel
29
+BuildRequires:	c-rest-engine-devel >= 1.1
30 30
 BuildRequires:	curl-devel
31 31
 BuildRequires:	hawkey-devel >= 2017.1
32 32
 BuildRequires:  jansson-devel
... ...
@@ -38,6 +38,7 @@ BuildRequires:	tdnf-devel >= 1.2.0
38 38
 BuildRequires:  lightwave-devel
39 39
 Source0:	%{name}-%{version}-3.tar.gz
40 40
 %define sha1 pmd=fe9b4b81410497d209fc4b6efb9574a049557b25
41
+Patch0:         pmd-update-to-c-rest-engine-1.1.patch
41 42
 
42 43
 %description
43 44
 Photon Management Daemon
... ...
@@ -87,6 +88,7 @@ Python3 bindings for photon management daemon
87 87
 
88 88
 %prep
89 89
 %setup -q
90
+%patch0 -p1
90 91
 
91 92
 %build
92 93
 sed -i 's/pmd, 0.0.1/pmd, 0.0.5/' configure.ac
... ...
@@ -305,6 +307,8 @@ rm -rf %{buildroot}/*
305 305
     %{_python3_sitearch}/%{name}_python-*.egg-info
306 306
 
307 307
 %changelog
308
+*       Thu Nov 30 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 0.0.5-4
309
+-       update to use c-rest-engine-1.11
308 310
 *       Tue Oct 24 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 0.0.5-3
309 311
 -       Bug fixes and net commands fixes
310 312
 *       Sat Sep 30 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 0.0.5-2