diff options
author | vorlon <Unknown> | 2006-10-23 10:26:45 +0000 |
---|---|---|
committer | vorlon <Unknown> | 2006-10-23 10:26:45 +0000 |
commit | f58f14b5c62ebac8ad9f58afcf98a65c66d9eb9f (patch) | |
tree | 168cd9818a23c588fda80a88ac45c9ce35a72c50 | |
parent | 298c5587d455e67fc79a68bd8088acf3bf03622f (diff) | |
download | pam-f58f14b5c62ebac8ad9f58afcf98a65c66d9eb9f.tar.gz pam-f58f14b5c62ebac8ad9f58afcf98a65c66d9eb9f.tar.bz2 pam-f58f14b5c62ebac8ad9f58afcf98a65c66d9eb9f.zip |
clean up patch 008 and re-apply
-rw-r--r-- | patches-applied/008_modules_pam_limits_chroot | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/patches-applied/008_modules_pam_limits_chroot b/patches-applied/008_modules_pam_limits_chroot index 024d3ae1..8f8e7241 100644 --- a/patches-applied/008_modules_pam_limits_chroot +++ b/patches-applied/008_modules_pam_limits_chroot @@ -1,6 +1,6 @@ Index: Linux-PAM/doc/modules/pam_limits.sgml =================================================================== ---- Linux-PAM/doc/modules/pam_limits.sgml (revision 274) +--- Linux-PAM/doc/modules/pam_limits.sgml (revision 379) +++ Linux-PAM/doc/modules/pam_limits.sgml (working copy) @@ -155,6 +155,7 @@ <item><tt/priority/ - the priority to run user process with (negative @@ -20,17 +20,17 @@ Index: Linux-PAM/doc/modules/pam_limits.sgml </tscreen> Index: Linux-PAM/modules/pam_limits/pam_limits.c =================================================================== ---- Linux-PAM/modules/pam_limits/pam_limits.c (revision 274) +--- Linux-PAM/modules/pam_limits/pam_limits.c (revision 381) +++ Linux-PAM/modules/pam_limits/pam_limits.c (working copy) -@@ -72,6 +72,7 @@ +@@ -73,6 +73,7 @@ int flag_numsyslogins; /* whether to limit logins only for a specific user or to count all logins */ int priority; /* the priority to run user process with */ -+ char chroot_dir[8092] ; /* directory to chroot into */ ++ char chroot_dir[8092]; /* directory to chroot into */ int supported[RLIM_NLIMITS]; struct user_limits_struct limits[RLIM_NLIMITS]; char conf_file[BUFSIZ]; -@@ -83,6 +84,7 @@ +@@ -84,6 +85,7 @@ #define LIMIT_NUMSYSLOGINS RLIM_NLIMITS+2 #define LIMIT_PRI RLIM_NLIMITS+3 @@ -38,7 +38,7 @@ Index: Linux-PAM/modules/pam_limits/pam_limits.c #define LIMIT_SOFT 1 #define LIMIT_HARD 2 -@@ -251,6 +253,8 @@ +@@ -255,6 +257,8 @@ pl->login_limit = -2; pl->login_limit_def = LIMITS_DEF_NONE; @@ -47,7 +47,7 @@ Index: Linux-PAM/modules/pam_limits/pam_limits.c return retval; } -@@ -309,6 +313,8 @@ +@@ -322,6 +326,8 @@ pl->flag_numsyslogins = 1; } else if (strcmp(lim_item, "priority") == 0) { limit_item = LIMIT_PRI; @@ -56,30 +56,21 @@ Index: Linux-PAM/modules/pam_limits/pam_limits.c } else { _pam_log(LOG_DEBUG,"unknown limit item '%s'", lim_item); return; -@@ -368,7 +374,8 @@ +@@ -402,7 +408,9 @@ + break; + } - if ( (limit_item != LIMIT_LOGIN) +- if ( (limit_item != LIMIT_LOGIN) ++ if (limit_item == LIMIT_CHROOT) ++ strncpy(pl->chroot_dir, value_orig, sizeof(pl->chroot_dir)); ++ else if ( (limit_item != LIMIT_LOGIN) && (limit_item != LIMIT_NUMSYSLOGINS) -- && (limit_item != LIMIT_PRI) ) { -+ && (limit_item != LIMIT_PRI) -+ && (limit_item != LIMIT_CHROOT)) { + && (limit_item != LIMIT_PRI) ) { if (limit_type & LIMIT_SOFT) { - if (pl->limits[limit_item].src_soft < source) { - return; -@@ -390,6 +397,8 @@ - - if (limit_item == LIMIT_PRI) { - pl->priority = limit_value; -+ } else if (limit_item == LIMIT_CHROOT) { -+ strncpy(pl->chroot_dir, value_orig, sizeof(pl->chroot_dir)); - } else { - if (pl->login_limit_def < source) { - return; -@@ -567,6 +576,14 @@ +@@ -602,6 +610,13 @@ retval |= LOGIN_ERR; } -+ + if (!retval && pl->chroot_dir[0]) { + i = chdir(pl->chroot_dir); + if (i == 0) |