• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

external/ppp


Commit MetaInfo

Revision1cbc875d04e732bc075af15a1e48f9c8268afdb6 (tree)
Time2009-06-19 14:39:12
AuthorChia-chi Yeh <chiachi@andr...>
CommiterThe Android Open Source Project

Log Message

am 12f72b25: Few changes to pppd for VPN.

Merge commit '12f72b25ea06006706eb0cdbbe1c965eb8fc03be'

* commit '12f72b25ea06006706eb0cdbbe1c965eb8fc03be':

Few changes to pppd for VPN.

Change Summary

Incremental Difference

--- a/pppd/Android.mk
+++ b/pppd/Android.mk
@@ -34,7 +34,6 @@ LOCAL_C_INCLUDES := \
3434
3535 LOCAL_CFLAGS := -DANDROID_CHANGES -DCHAPMS=1 -DMPPE=1 -Iexternal/openssl/include
3636
37-LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
3837 LOCAL_MODULE:= pppd
3938
4039 include $(BUILD_EXECUTABLE)
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -825,6 +825,7 @@ static void
825825 create_pidfile(pid)
826826 int pid;
827827 {
828+#ifndef ANDROID_CHANGES
828829 FILE *pidfile;
829830
830831 slprintf(pidfilename, sizeof(pidfilename), "%s%s.pid",
@@ -836,12 +837,14 @@ create_pidfile(pid)
836837 error("Failed to create pid file %s: %m", pidfilename);
837838 pidfilename[0] = 0;
838839 }
840+#endif
839841 }
840842
841843 void
842844 create_linkpidfile(pid)
843845 int pid;
844846 {
847+#ifndef ANDROID_CHANGES
845848 FILE *pidfile;
846849
847850 if (linkname[0] == 0)
@@ -858,6 +861,7 @@ create_linkpidfile(pid)
858861 error("Failed to create pid file %s: %m", linkpidfile);
859862 linkpidfile[0] = 0;
860863 }
864+#endif
861865 }
862866
863867 /*
@@ -865,12 +869,14 @@ create_linkpidfile(pid)
865869 */
866870 void remove_pidfiles()
867871 {
872+#ifndef ANDROID_CHANGES
868873 if (pidfilename[0] != 0 && unlink(pidfilename) < 0 && errno != ENOENT)
869874 warn("unable to delete pid file %s: %m", pidfilename);
870875 pidfilename[0] = 0;
871876 if (linkpidfile[0] != 0 && unlink(linkpidfile) < 0 && errno != ENOENT)
872877 warn("unable to delete pid file %s: %m", linkpidfile);
873878 linkpidfile[0] = 0;
879+#endif
874880 }
875881
876882 /*
@@ -1636,6 +1642,21 @@ run_program(prog, args, must_exist, done, arg)
16361642 int pid;
16371643 struct stat sbuf;
16381644
1645+#ifdef ANDROID_CHANGES
1646+ /* Originally linkname is used to create named pid files, which is
1647+ * meaningless to android. Here we use it as a suffix of program names,
1648+ * so different users can run their own program by specifying it. For
1649+ * example, "/etc/ppp/ip-up-vpn" will be executed when IPCP is up and
1650+ * linkname is "vpn". Note that "/" is not allowed for security reasons. */
1651+ char file[MAXPATHLEN];
1652+
1653+ if (linkname[0] && !strchr(linkname, '/')) {
1654+ snprintf(file, MAXPATHLEN, "%s-%s", prog, linkname);
1655+ file[MAXPATHLEN - 1] = '\0';
1656+ prog = file;
1657+ }
1658+#endif
1659+
16391660 /*
16401661 * First check if the file exists and is executable.
16411662 * We don't use access() because that would use the