HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Installing Openssh-3.5p1
Operating System - HP-UX
1833341
Members
3845
Online
110051
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2003 10:57 AM
03-19-2003 10:57 AM
Installing Openssh-3.5p1
I am configuring an ftp server and am attempting to incorporate the chroot functionality. I downloaded the patch openssh-3.5p1-chroot-patch.tmaletic.txt (found from another forum response), however when I execute the command:
patch session.c openssh-3.5p1-chroot-patch.tmaletic.txt
I get the following message:
Hmm... Looks like a new-style context diff to me...
The text leading up to this was:
--------------------------
|*** session.c.dist Wed Sep 25 20:38:50 2002
|--- session.c Tue Jan 14 14:55:45 2003
--------------------------
Patching file session.c using Plan A...
Hunk #1 failed at 1195.
Hunk #2 failed at 1247.
2 out of 2 hunks failed--saving rejects to session.c.rej
done
session.c.rj contains the following:
***************
*** 1195,1200 ****
void
do_setusercontext(struct passwd *pw)
{
#ifdef HAVE_CYGWIN
if (is_winnt) {
#else /* HAVE_CYGWIN */
--- 1195,1202 ----
void
do_setusercontext(struct passwd *pw)
{
+ char *user_dir;
+ char *new_root;
#ifdef HAVE_CYGWIN
if (is_winnt) {
#else /* HAVE_CYGWIN */
***************
*** 1245,1250 ****
# ifdef _AIX
aix_usrinfo(pw);
# endif /* _AIX */
/* Permanently switch to the desired uid. */
permanently_set_uid(pw);
#endif
--- 1247,1268 ----
# ifdef _AIX
aix_usrinfo(pw);
# endif /* _AIX */
+ user_dir = xstrdup(pw->pw_dir);
+ new_root = user_dir + 1;
+ while((new_root = strchr(new_root, '.')) != NULL) {
+ new_root--;
+ if(strncmp(new_root, "/./", 3) == 0) {
+ *new_root = '\0';
+ new_root += 2;
+ debug("Attempting to chroot to %s", user_dir);
+ if(chroot(user_dir) != 0)
+ fatal("Couldn't chroot to user directory %s: %s", user_dir, strerror(errno));
+ pw->pw_dir = new_root;
+ options.print_lastlog = NULL;
+ break;
+ }
+ new_root += 2;
+ }
/* Permanently switch to the desired uid. */
permanently_set_uid(pw);
#endif
Much needed help in resolving this problem, is greatly appreciated.
Thanks
Youlette
patch session.c openssh-3.5p1-chroot-patch.tmaletic.txt
I get the following message:
Hmm... Looks like a new-style context diff to me...
The text leading up to this was:
--------------------------
|*** session.c.dist Wed Sep 25 20:38:50 2002
|--- session.c Tue Jan 14 14:55:45 2003
--------------------------
Patching file session.c using Plan A...
Hunk #1 failed at 1195.
Hunk #2 failed at 1247.
2 out of 2 hunks failed--saving rejects to session.c.rej
done
session.c.rj contains the following:
***************
*** 1195,1200 ****
void
do_setusercontext(struct passwd *pw)
{
#ifdef HAVE_CYGWIN
if (is_winnt) {
#else /* HAVE_CYGWIN */
--- 1195,1202 ----
void
do_setusercontext(struct passwd *pw)
{
+ char *user_dir;
+ char *new_root;
#ifdef HAVE_CYGWIN
if (is_winnt) {
#else /* HAVE_CYGWIN */
***************
*** 1245,1250 ****
# ifdef _AIX
aix_usrinfo(pw);
# endif /* _AIX */
/* Permanently switch to the desired uid. */
permanently_set_uid(pw);
#endif
--- 1247,1268 ----
# ifdef _AIX
aix_usrinfo(pw);
# endif /* _AIX */
+ user_dir = xstrdup(pw->pw_dir);
+ new_root = user_dir + 1;
+ while((new_root = strchr(new_root, '.')) != NULL) {
+ new_root--;
+ if(strncmp(new_root, "/./", 3) == 0) {
+ *new_root = '\0';
+ new_root += 2;
+ debug("Attempting to chroot to %s", user_dir);
+ if(chroot(user_dir) != 0)
+ fatal("Couldn't chroot to user directory %s: %s", user_dir, strerror(errno));
+ pw->pw_dir = new_root;
+ options.print_lastlog = NULL;
+ break;
+ }
+ new_root += 2;
+ }
/* Permanently switch to the desired uid. */
permanently_set_uid(pw);
#endif
Much needed help in resolving this problem, is greatly appreciated.
Thanks
Youlette
If at first you don't succeed, change the rules!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP