[Pkg-ocaml-maint-commits] r3236 - in
/trunk/packages/mldonkey/trunk/debian: changelog
utils/mldonkey_server.ml
smimram at users.alioth.debian.org
smimram at users.alioth.debian.org
Thu Oct 12 21:20:41 UTC 2006
Author: smimram
Date: Thu Oct 12 21:20:41 2006
New Revision: 3236
URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/?sc=1&rev=3236
Log:
Integrate various patchs from Géraud Meyer.
Modified:
trunk/packages/mldonkey/trunk/debian/changelog
trunk/packages/mldonkey/trunk/debian/utils/mldonkey_server.ml
Modified: trunk/packages/mldonkey/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/mldonkey/trunk/debian/changelog?rev=3236&op=diff
==============================================================================
--- trunk/packages/mldonkey/trunk/debian/changelog (original)
+++ trunk/packages/mldonkey/trunk/debian/changelog Thu Oct 12 21:20:41 2006
@@ -2,9 +2,14 @@
* Creating mldonkey group as system group, closes: #389455.
* Flushing after password prompt in mldonkey_command, closes: #391729.
+ * Patched mldonkey_server to be able to run mldonkey even when HOME is not
+ set (thanks Géraud Meyer), closes: #392604.
+ * Cleanly handle erroneous --chuid / --chgid / --umask arguments in
+ mldonkey_server (thanks Géraud Meyer), closes: #392605.
+ * Fixed a typo in mldonkey_server (thanks Géraud Meyer), closes: #392617.
* Change address of Sylvain Le Gall to gildor at debian.org.
- -- Samuel Mimram <smimram at debian.org> Sun, 8 Oct 2006 12:06:48 +0000
+ -- Samuel Mimram <smimram at debian.org> Thu, 12 Oct 2006 21:10:55 +0000
mldonkey (2.8.1-1) unstable; urgency=low
Modified: trunk/packages/mldonkey/trunk/debian/utils/mldonkey_server.ml
URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/mldonkey/trunk/debian/utils/mldonkey_server.ml?rev=3236&op=diff
==============================================================================
--- trunk/packages/mldonkey/trunk/debian/utils/mldonkey_server.ml (original)
+++ trunk/packages/mldonkey/trunk/debian/utils/mldonkey_server.ml Thu Oct 12 21:20:41 2006
@@ -181,7 +181,11 @@
"--chuid",
Arg.String (fun x ->
let passwd_ent =
- Unix.getpwnam x
+ try
+ Unix.getpwnam x
+ with
+ | Not_found ->
+ raise (Arg.Bad ("wrong argument `"^x^"'; option `--chuid' expects a user name"))
in
state := {!state with chuid = passwd_ent.pw_uid}
),
@@ -189,13 +193,24 @@
"--chgid",
Arg.String (fun x ->
let group_ent =
- Unix.getgrnam x
+ try
+ Unix.getgrnam x
+ with
+ | Not_found ->
+ raise (Arg.Bad ("wrong argument `"^x^"'; option `--chgid' expects a group name"))
in
state := {!state with chgid = group_ent.gr_gid}
),
"Which group own the process";
"--umask",
- Arg.String (fun x -> state := {!state with umask = int_of_string ( "0o"^x )}),
+ Arg.String (fun x ->
+ let mask =
+ try
+ int_of_string ("0o"^x)
+ with
+ | Failure "int_of_string" -> raise (Arg.Bad ("wrong argument `"^x^"'; option `--umask' expects an octal umask"))
+ in
+ state := {!state with umask = mask}),
"What umask to use";
"--nice",
Arg.Int (fun x -> state := {!state with nice = x}),
@@ -273,8 +288,7 @@
ignore (print_log st str)
let go_home st =
- debug st ("Chdir to home dir: " ^ (user_home st));
- Unix.putenv "HOME" (user_home st);
+ debug st ("Chdir to chdir dir: " ^ (get_chdir st));
Unix.putenv "MLDONKEY_STRINGS" (Filename.concat (get_chdir st) "mlnet_strings");
Sys.chdir (get_chdir st)
@@ -819,7 +833,7 @@
exit 0
with
| No_home_variable ->
- prerr_string (" Could not guess $HOME environnement variable: provide a --chdir or $HOME");
+ prerr_string (" Could not guess $HOME environment variable: provide a --chdir or $HOME");
prerr_newline ()
| No_home_to_chdir ->
prerr_string (" Home dir doesn't exist");
More information about the Pkg-ocaml-maint-commits
mailing list