Browse Source

newcamd: Do not use crypt_r() because it breaks OS X compilation.

Georgi Chorbadzhiyski 13 years ago
parent
commit
a94de9f157
2 changed files with 6 additions and 6 deletions
  1. 5
    1
      Makefile
  2. 1
    5
      camd-newcamd.c

+ 5
- 1
Makefile View File

@@ -45,9 +45,13 @@ tsdecrypt_SRC = data.c \
45 45
  tables.c \
46 46
  notify.c \
47 47
  tsdecrypt.c
48
-tsdecrypt_LIBS = -lcrypt -lcrypto -ldvbcsa -lpthread
48
+tsdecrypt_LIBS = -lcrypto -ldvbcsa -lpthread
49 49
 tsdecrypt_OBJS = $(FUNCS_LIB) $(TS_LIB) $(tsdecrypt_SRC:.c=.o)
50 50
 
51
+ifeq "$(shell uname -s)" "Linux"
52
+tsdecrypt_LIBS += -lcrypt
53
+endif
54
+
51 55
 CLEAN_OBJS = tsdecrypt $(tsdecrypt_SRC:.c=.{o,d})
52 56
 
53 57
 PROGS = tsdecrypt

+ 1
- 5
camd-newcamd.c View File

@@ -17,12 +17,10 @@
17 17
  */
18 18
 
19 19
 #define _XOPEN_SOURCE 700 // Needed to pull crypt() from unistd.h
20
-#define _GNU_SOURCE 1 // Needed to pull crypt_r() from crypt.h
21 20
 
22 21
 #include <stdlib.h>
23 22
 #include <string.h>
24 23
 #include <unistd.h>
25
-#include <crypt.h>
26 24
 
27 25
 #include <openssl/des.h>
28 26
 
@@ -296,9 +294,7 @@ static int newcamd_login(struct camd *c) {
296 294
 		return 0;
297 295
 	}
298 296
 
299
-	struct crypt_data crypt_data;
300
-	crypt_data.initialized = 0;
301
-	char *crPasswd = crypt_r(c->pass, "$1$abcdefgh$", &crypt_data);
297
+	char *crPasswd = crypt(c->pass, "$1$abcdefgh$");
302 298
 
303 299
 	const int userLen = strlen(c->user) + 1;
304 300
 	const int passLen = strlen(crPasswd) + 1;

Loading…
Cancel
Save