Tilde prefix returns invalid home directory.

Thread Tools Search this Thread
Operating Systems Solaris Tilde prefix returns invalid home directory.
# 8  
Old 04-04-2014
All the shells I know that support the tilde expansion do exhibit on every OS the same behavior as the one bash is documenting.

I suspect either a user mistake or a directory related configuration or error.
# 9  
Old 04-04-2014
Then you don't know csh.
tcsh 6.12 on Solaris:
> set nonomatch
> echo ~nonsense
> unset nonomatch
> echo ~nonsense
Unknown user: nonsense.

# 10  
Old 04-04-2014
Good catch. I have to admit I avoid and disregard csh for any purpose since 30 years or so ...
# 11  
Old 04-07-2014
Originally Posted by jlliagre
What says:
ldaplist -v user1

Actually ldaplist isn't available. I suspect this to be an implementation issue where in LDAP may have a default home directory specified for certain non-existent users on the server?

---------- Post updated at 03:34 PM ---------- Previous update was at 03:28 PM ----------

Its KSH on both AIX/Solaris but it looks to be a problem with the way it was configured. directory? Again I am suspecting this for the reason that certain users when echoed do have a default home directory but has not been granted access to that machine and neither does the home directory exist.

Also I would like to expand on previous post with one more behavior for clarity which I had originally posted in the query:

Common LDAP -
--- non-existent user1 - echo ~user1 outputs ~user1
--- non-existent user2 - echo ~user2 - says non-existent user.
--- non-existent user3 - echo ~user3 outputs /home/user3 .

Last edited by thinkster; 04-07-2014 at 04:42 PM..
# 12  
Old 04-07-2014
Originally Posted by thinkster
Actually ldaplist isn't available.
on the Solaris machine ?? If you have not ldaplist installed, you are unlikely to have any ldap authentication in the first place.
I suspect this to be an implementation issue where in LDAP may have a default home directory specified for certain non-existent users on the server?
What directory server are you using ?
--- non-existent user2 - echo ~user2 - says non-existent user.
"non-existent" doesn't seem to appear in ksh error messages. What ksh version are you using ? Is this really the precise error message you get ? on Solaris ? What Solaris release ?
# 13  
Old 04-07-2014
My bad - I didn't try that on Solaris - its available and I do get a response like below
+++ database=user1
+++ filter=objectclass=*
+++ template for merging SSD filter=%s
ldaplist: Object not found (LDAP ERROR (32): No such object.)

But this gives a valid output for getent. Is that same grepping the /etc/passwd file?

Directory Server as far as I know is a Windows AD server but not sure of the exact version.

The error message was something like no valid user. I am unable to reproduce that error message now it just prints ~xxxxx. So something has changed.

ksh version is M-11/16/88i and Solaris is 5.10.

Last edited by Don Cragun; 04-07-2014 at 07:43 PM.. Reason: Use CODE (not ICODE) tags for multi-line code and data displays.
# 14  
Old 04-07-2014
getent is not the same as grepping /etc/password. getent looks to the backend databases listed in the /etc/nsswitch.conf files in order and report the first match, if any. Might be from /etc/passwd or not.

The ~xxxxx behavior is the one expected with unknown users.
This User Gave Thanks to jlliagre For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Home Questions Tags Users Unanswered Windows 2016 DNS server returns SERVFAIL for non-existing doma

I have two DNS resolvers in /etc/resolv.conf file. The top one is Windows DNS server, and the bottom one is my wi-fi router. Please see below. nameserver nameserver In Windows DNS server, the sole "Forward Lookup Zone" is biman.net When I query for host in the zone... (6 Replies)
Discussion started by: broy32000
6 Replies

2. Solaris

SunOS confusing root directory and user home directory

Hello, I've just started using a Solaris machine with SunOS 5.10. After the machine is turned on, I open a Console window and at the prompt, if I execute a pwd command, it tells me I'm at my home directory (someone configured "myuser" as default user after init). ... (2 Replies)
Discussion started by: egyassun
2 Replies

3. Shell Programming and Scripting

Extract Uniq prefix from a start and end prefix

Dear All, assume i have a file with content: <Start>6000</Start> <Stop>7599</Stop> the output is: 6000 7000 7100 7200 7300 7400 7599 how should we use any awk, sed, perl can do this task, means to extract the uniq prefixes from the start and stop prefix. Thanks Jimmy (3 Replies)
Discussion started by: jimmy_y
3 Replies

4. Shell Programming and Scripting

rm -rf ab returns find: `./ab': No such file or directory

Hi Gurus. This is driving me a bit batty. I now if must be a simple matter but I cant find anything that references it. I have a housekeeping script that searches for some huge dump directories then removes them using rm -rf. find ./ -name 'ab' -exec rm -rf {} \; This works but always... (7 Replies)
Discussion started by: rinser
7 Replies

5. Shell Programming and Scripting

Find all images, append unique prefix to name and move to different directory

Hi, I have a directory with Multiple subdirectories and 1000s of pictures (jpg) in each directory. The problem is that each directory has a 001.jpg in them. I want to append a unique name (the directory_name)would be fine. and then move them to one main backup directory once they have been... (1 Reply)
Discussion started by: kmaq7621
1 Replies

6. Shell Programming and Scripting

for $word in $line returns filenames in the current directory unexpectedly

I am writing a script below, which has 2 loops. The outer one reads file sufffixed with a number and inner inside which loop through each line of the file and display each space delimited string. However, i find that the string printed out in the inner loop includes not only the delimited string in... (2 Replies)
Discussion started by: martie
2 Replies

7. Solaris

Restricting SFTP user to a defined directory and home directory

Hi, I've created solaris user which has both FTP and SFTP Access. Using the "ftpaccess" configuration file options "guest-root" and "restricted-uid", i can restrict the user to a specific directory. But I'm unable to restrict the user when the user is logged in using SFTP. The aim is to... (1 Reply)
Discussion started by: sftpuser
1 Replies

8. Programming

Getting Home Directory

Hi I need to get the home directory of current user who is running the program, also i need to store the value in a particular variable and pass to the function. thanks in advance (4 Replies)
Discussion started by: cutechaps
4 Replies

9. UNIX for Dummies Questions & Answers

c++ home directory??

when i compile *.cpp files the compiler didn't find the non standart includes.If i have to put the full path of the includet files where shall i begin from root dirctory or i heve to put includet files in cpp home directory??? can i compile java files in unix(linux mandrake 7) if yes haw... (3 Replies)
Discussion started by: user666
3 Replies
Login or Register to Ask a Question

Featured Tech Videos